mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Fixed inconsistent navigation via sidebar items.
Fixes #368. Also tidied up the priority observers.
This commit is contained in:
@@ -77,12 +77,12 @@
|
||||
|
||||
<paper-item class="two-line">
|
||||
<div id="text" flex>
|
||||
<div id="primary"><content select=".name"></content></div>
|
||||
<div id="primary"><content></content></div>
|
||||
<div id="secondary" layout horizontal center>
|
||||
<core-tooltip label="Global Priority" noarrow position="right">
|
||||
<core-icon icon="star"></core-icon>
|
||||
</core-tooltip>
|
||||
<content select=".priority"></content>
|
||||
<div id="priority"></div>
|
||||
</div>
|
||||
</div>
|
||||
<core-tooltip id="loadsBSA" label="Loads BSA" noarrow position="left">
|
||||
@@ -100,12 +100,13 @@
|
||||
observe: {
|
||||
'data.userlist': 'onUserlistChange',
|
||||
'data.modPriority': 'onPriorityChange',
|
||||
'data.isGlobalPriority': 'onPriorityChange'
|
||||
'data.isGlobalPriority': 'onPriorityIsGlobalChange'
|
||||
},
|
||||
|
||||
dataChanged: function(oldValue, newValue) {
|
||||
this.onUserlistChange();
|
||||
this.onPriorityChange();
|
||||
this.onPriorityIsGlobalChange();
|
||||
},
|
||||
|
||||
onUserlistChange: function(oldValue, newValue) {
|
||||
@@ -119,25 +120,25 @@
|
||||
},
|
||||
|
||||
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');
|
||||
}
|
||||
if (this.data && this.data.modPriority) {
|
||||
this.shadowRoot.getElementById('priority').textContent = this.data.modPriority;
|
||||
this.shadowRoot.getElementById('secondary').classList.remove('hidden');
|
||||
} else {
|
||||
this.shadowRoot.getElementById('priority').textContent = '';
|
||||
this.shadowRoot.getElementById('secondary').classList.add('hidden');
|
||||
}
|
||||
},
|
||||
|
||||
onPriorityIsGlobalChange: function(oldValue, newValue) {
|
||||
if (this.data && this.data.isGlobalPriority) {
|
||||
this.shadowRoot.getElementById('secondary').firstElementChild.classList.remove('hidden');
|
||||
} else {
|
||||
this.shadowRoot.getElementById('secondary').firstElementChild.classList.add('hidden');
|
||||
}
|
||||
},
|
||||
|
||||
getName: function() {
|
||||
return this.querySelector('.name').textContent.trim();
|
||||
return this.textContent.trim();
|
||||
},
|
||||
|
||||
handleDragStart: function(evt) {
|
||||
|
||||
@@ -54,8 +54,7 @@
|
||||
<core-list id="cardsNav" class="tab-content" flex>
|
||||
<template>
|
||||
<loot-plugin-item data-id="{{model.id}}" data-bsa?="{{model.loadsBSA}}" data="{{model}}" data-index="{{index}}">
|
||||
<div class="name">{{model.name}}</div>
|
||||
<div class="priority">{{model.modPriority}}</div>
|
||||
{{model.name}}
|
||||
</loot-plugin-item>
|
||||
</template>
|
||||
<!-- Generated <loot-plugin-item> elements go here. -->
|
||||
|
||||
Reference in New Issue
Block a user