mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Sidebar priorities display made conditional.
Stars only show for global priorities, and values only show for non-zero priorities.
This commit is contained in:
@@ -98,11 +98,14 @@
|
||||
data: undefined,
|
||||
|
||||
observe: {
|
||||
'data.userlist': 'onUserlistChange'
|
||||
'data.userlist': 'onUserlistChange',
|
||||
'data.modPriority': 'onPriorityChange',
|
||||
'data.isGlobalPriority': 'onPriorityChange'
|
||||
},
|
||||
|
||||
dataChanged: function(oldValue, newValue) {
|
||||
this.onUserlistChange();
|
||||
this.onPriorityChange();
|
||||
},
|
||||
|
||||
onUserlistChange: function(oldValue, newValue) {
|
||||
@@ -115,6 +118,24 @@
|
||||
}
|
||||
},
|
||||
|
||||
onPriorityChange: function(oldValue, newValue) {
|
||||
if (this.data) {
|
||||
if (this.data.modPriority != 0) {
|
||||
this.shadowRoot.getElementById('secondary').classList.remove('hidden');
|
||||
} else {
|
||||
this.shadowRoot.getElementById('secondary').classList.add('hidden');
|
||||
}
|
||||
if (this.data.isGlobalPriority) {
|
||||
this.shadowRoot.getElementById('secondary').firstElementChild.classList.remove('hidden');
|
||||
} else {
|
||||
this.shadowRoot.getElementById('secondary').firstElementChild.classList.add('hidden');
|
||||
}
|
||||
} else {
|
||||
this.shadowRoot.getElementById('secondary').classList.add('hidden');
|
||||
this.shadowRoot.getElementById('secondary').firstElementChild.classList.add('hidden');
|
||||
}
|
||||
},
|
||||
|
||||
getName: function() {
|
||||
return this.textContent.trim();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user