From eefed2237457551a571737d695a39aa9a03899da Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sat, 27 Dec 2014 11:12:23 +0000 Subject: [PATCH] Sidebar priorities display made conditional. Stars only show for global priorities, and values only show for non-zero priorities. --- resources/report/html/loot-plugin-item.html | 23 ++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/resources/report/html/loot-plugin-item.html b/resources/report/html/loot-plugin-item.html index 4208beb4..2f333422 100644 --- a/resources/report/html/loot-plugin-item.html +++ b/resources/report/html/loot-plugin-item.html @@ -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(); },