Browse Source

Add item with ctrlKey/metaKey when dagging on a selected item (#3379)

revert-3409-performance
Yotam Berkowitz 7 years ago
committed by GitHub
parent
commit
0ac1ce405f
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      lib/timeline/component/ItemSet.js

+ 6
- 6
lib/timeline/component/ItemSet.js View File

@ -1358,8 +1358,7 @@ ItemSet.prototype._onDragStart = function (event) {
};
this.touchParams.itemProps = [props];
}
else if (dragRightItem) {
} else if (dragRightItem) {
props = {
item: dragRightItem,
initialX: event.center.x,
@ -1368,8 +1367,10 @@ ItemSet.prototype._onDragStart = function (event) {
};
this.touchParams.itemProps = [props];
}
else {
} else if (this.options.editable.add && (event.srcEvent.ctrlKey || event.srcEvent.metaKey)) {
// create a new range item when dragging with ctrl key down
this._onDragStartAddItem(event);
} else {
if(this.groupIds.length < 1) {
// Mitigates a race condition if _onDragStart() is
// called after markDirty() without redraw() being called between.
@ -1393,8 +1394,7 @@ ItemSet.prototype._onDragStart = function (event) {
}
event.stopPropagation();
}
else if (this.options.editable.add && (event.srcEvent.ctrlKey || event.srcEvent.metaKey)) {
} else if (this.options.editable.add && (event.srcEvent.ctrlKey || event.srcEvent.metaKey)) {
// create a new range item when dragging with ctrl key down
this._onDragStartAddItem(event);
}

Loading…
Cancel
Save