diff --git a/resources/report/html/loot-plugin-item.html b/resources/report/html/loot-plugin-item.html
index 27f1c813..d3a3c0b3 100644
--- a/resources/report/html/loot-plugin-item.html
+++ b/resources/report/html/loot-plugin-item.html
@@ -141,13 +141,15 @@
observe: {
'data.userlist': 'onUserlistChange',
'data.modPriority': 'onPriorityChange',
- 'data.isGlobalPriority': 'onPriorityIsGlobalChange'
+ 'data.isGlobalPriority': 'onPriorityIsGlobalChange',
+ 'data.isEditorOpen': 'onEditorStateChange',
},
dataChanged: function(oldValue, newValue) {
this.onUserlistChange();
this.onPriorityChange();
this.onPriorityIsGlobalChange();
+ this.onEditorStateChange();
},
onUserlistChange: function(oldValue, newValue) {
@@ -178,6 +180,14 @@
}
},
+ onEditorStateChange: function(oldValue, newValue) {
+ if (this.data && this.data.isEditorOpen) {
+ this.setAttribute('data-editor-open', true);
+ } else {
+ this.removeAttribute('data-editor-open');
+ }
+ },
+
getName: function() {
return this.textContent.trim();
},
diff --git a/resources/report/js/events.js b/resources/report/js/events.js
index a6936400..98bb4384 100644
--- a/resources/report/js/events.js
+++ b/resources/report/js/events.js
@@ -374,11 +374,6 @@ function onEditorOpen(evt) {
for (var i = 0; i < elements.length; ++i) {
elements[i].draggable = true;
elements[i].addEventListener('dragstart', elements[i].onDragStart, false);
-
- /* Also add data-editor-is-open attribute to the plugin's item. */
- if (elements[i].getAttribute('data-id') == evt.target.id) {
- elements[i].setAttribute('data-editor-open', true);
- }
}
/* Now show editor. */
@@ -450,11 +445,6 @@ function onEditorClose(evt) {
for (var i = 0; i < elements.length; ++i) {
elements[i].removeAttribute('draggable');
elements[i].removeEventListener('dragstart', elements[i].onDragStart, false);
-
- /* Also remove data-editor-is-open attribute from the plugin's item. */
- if (elements[i].getAttribute('data-id') == evt.target.id) {
- elements[i].removeAttribute('data-editor-open');
- }
}
/* Disable priority hover in plugins list and enable header