mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
@@ -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();
|
||||
},
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user