From 149b84d81d3b9320fe4510ee62a9f84e6f59a547 Mon Sep 17 00:00:00 2001 From: Oliver Hamlet Date: Sat, 27 Dec 2014 10:12:34 +0000 Subject: [PATCH] Hide priorities in sidebar when not in edit mode. --- resources/report/html/loot-plugin-item.html | 26 ++++++++++++++------- resources/report/js/script.js | 4 +++- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/resources/report/html/loot-plugin-item.html b/resources/report/html/loot-plugin-item.html index 63e5f78f..7aaa2621 100644 --- a/resources/report/html/loot-plugin-item.html +++ b/resources/report/html/loot-plugin-item.html @@ -21,37 +21,45 @@ /* paper-item (two-line) */ paper-item.two-line { - height: 48px; + /* Two-line items should be 72px high according to Material Design. + Squeeze the height to fit more items in. */ + /*height: 72px;*/ } - paper-item.two-line::shadow .button-content { + :host-context(body[data-editors]) paper-item.two-line::shadow .button-content { padding: 7.5px 16px; } - paper-item.two-line .text { + :host-context(body[data-editors]) paper-item.two-line #text { /* Padding is disabled as otherwise text won't fit in correctly. */ /*padding: 4px 0;*/ line-height: normal; } - paper-item.two-line .primary { + :host-context(body[data-editors]) paper-item.two-line #primary { /* MD spec says 16sp, but that doesn't fit, so use 14sp. */ /*font-size: 1.143rem;*/ font-size: 1rem; } - paper-item.two-line .secondary { + :host-context(body[data-editors]) paper-item.two-line #secondary { /* MD spec says 14sp, but that doesn't fit, so use 12sp. */ /*font-size: 1rem; */ font-size: 0.857rem; color: rgba(0, 0, 0, 0.54); + display: flex; } - paper-item.two-line .secondary core-icon { + :host-context(body[data-editors]) paper-item.two-line #secondary core-icon { height: 13px; margin-right: 0; } + + /* When not in edit mode, hide secondary text. */ + :host-context(body:not([data-editors])) paper-item.two-line #secondary { + display: none; + } -
-
-
+
+
+
diff --git a/resources/report/js/script.js b/resources/report/js/script.js index 774777ee..65003f89 100644 --- a/resources/report/js/script.js +++ b/resources/report/js/script.js @@ -904,6 +904,7 @@ function handleEditorClose(evt) { --numEditors; if (numEditors == 0) { + document.body.removeAttribute('data-editors'); /* Re-enable toolbar elements. */ document.getElementById('wipeUserlistButton').removeAttribute('disabled'); document.getElementById('copyContentButton').removeAttribute('disabled'); @@ -912,8 +913,9 @@ function handleEditorClose(evt) { document.getElementById('gameMenu').removeAttribute('disabled'); document.getElementById('updateMasterlistButton').removeAttribute('disabled'); document.getElementById('sortButton').removeAttribute('disabled'); + } else { + document.body.setAttribute('data-editors', numEditors); } - document.body.setAttribute('data-editors', numEditors); } function handleConflictsFilter(evt) { /* evt.detail is true if the filter has been activated. */