Browse Source

Fixed tool-tip surviving after item deleted (#2545)

fix2580
Lewis B 8 years ago
committed by yotamberk
parent
commit
e27de4f868
2 changed files with 15 additions and 1 deletions
  1. +7
    -0
      lib/shared/Popup.js
  2. +8
    -1
      lib/timeline/component/ItemSet.js

+ 7
- 0
lib/shared/Popup.js View File

@ -93,6 +93,13 @@ class Popup {
this.hidden = true;
this.frame.style.visibility = "hidden";
}
/**
* Remove the popup window
*/
destroy() {
this.frame.parentNode.removeChild(this.frame); // Remove element from DOM
}
}
export default Popup;

+ 8
- 1
lib/timeline/component/ItemSet.js View File

@ -869,7 +869,8 @@ ItemSet.prototype.getGroups = function() {
*/
ItemSet.prototype.removeItem = function(id) {
var item = this.itemsData.get(id),
dataset = this.itemsData.getDataSet();
dataset = this.itemsData.getDataSet(),
itemObj = this.items[id];
if (item) {
// confirm deletion
@ -878,6 +879,12 @@ ItemSet.prototype.removeItem = function(id) {
// remove by id here, it is possible that an item has no id defined
// itself, so better not delete by the item itself
dataset.remove(id);
// Remove it's popup
if (itemObj.popup) {
itemObj.popup.destroy();
itemObj.popup = null;
}
}
});
}

Loading…
Cancel
Save