Browse Source

Fix initial drag (#2474)

* Fix redraw order

* Fix initial drag item bug

* Fix indents
readme-improvements
yotamberk 7 years ago
committed by GitHub
parent
commit
73f880d9f4
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      lib/timeline/component/ItemSet.js

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

@ -1235,6 +1235,7 @@ ItemSet.prototype._onDragStart = function (event) {
var dragLeftItem = this.touchParams.dragLeftItem;
var dragRightItem = this.touchParams.dragRightItem;
this.touchParams.itemIsDragging = true;
this.touchParams.selectedItem = item;
if (dragLeftItem) {
props = {
@ -1257,8 +1258,6 @@ ItemSet.prototype._onDragStart = function (event) {
this.touchParams.itemProps = [props];
}
else {
this.touchParams.selectedItem = item;
var baseGroupIndex = this._getGroupIndex(item.data.group);
var itemsToDrag = (this.options.itemsAlwaysDraggable && !item.selected) ? [item.id] : this.getSelection();
@ -1323,7 +1322,8 @@ ItemSet.prototype._onDragStartAddItem = function (event) {
newItem.id = id; // TODO: not so nice setting id afterwards
newItem.data = this._cloneItemData(itemData);
this._addItem(newItem);
this.touchParams.selectedItem = newItem;
var props = {
item: newItem,
initialX: event.center.x,

Loading…
Cancel
Save