|
@ -287,6 +287,7 @@ Item.prototype._updateStyle = function(element) { |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Stringify the items contents |
|
|
* Stringify the items contents |
|
|
* @param {string | Element | undefined} content |
|
|
* @param {string | Element | undefined} content |
|
@ -315,4 +316,27 @@ Item.prototype.getWidthRight = function () { |
|
|
return 0; |
|
|
return 0; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Repaint a drag area on the center of the item when the item is selected |
|
|
|
|
|
* @protected |
|
|
|
|
|
*/ |
|
|
|
|
|
Item.prototype._repaintDragCenter = function () { |
|
|
|
|
|
if (this.selected && this.options.editable.updateTime && !this.dom.dragCenter) { |
|
|
|
|
|
// create and show drag area
|
|
|
|
|
|
var dragCenter = document.createElement('div'); |
|
|
|
|
|
dragCenter.className = 'vis-drag-center'; |
|
|
|
|
|
dragCenter.dragCenterItem = this; |
|
|
|
|
|
|
|
|
|
|
|
this.dom.box.appendChild(dragCenter); |
|
|
|
|
|
this.dom.dragCenter = dragCenter; |
|
|
|
|
|
} |
|
|
|
|
|
else if (!this.selected && this.dom.dragCenter) { |
|
|
|
|
|
// delete drag area
|
|
|
|
|
|
if (this.dom.dragCenter.parentNode) { |
|
|
|
|
|
this.dom.dragCenter.parentNode.removeChild(this.dom.dragCenter); |
|
|
|
|
|
} |
|
|
|
|
|
this.dom.dragCenter = null; |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
module.exports = Item; |
|
|
module.exports = Item; |