Convert UI filters to links and display always Remove the conditions which hides the 'Show All' and 'Needs + Blocked' filters when UI is not expanded. Also convert them to links rather than buttons. Change-Id: Ia13c25e73152a912fcb853d7b0ad5703be27e5e9
diff --git a/gr-task-plugin/gr-task-plugin.html b/gr-task-plugin/gr-task-plugin.html index c5c04ff..36813a0 100644 --- a/gr-task-plugin/gr-task-plugin.html +++ b/gr-task-plugin/gr-task-plugin.html
@@ -27,6 +27,11 @@ display: flex; padding: 6px 1rem; } + .links { + color: blue; + cursor: pointer; + text-decoration: underline; + } </style> <div id="tasks" hidden$="[[!_tasks.length]]"> @@ -43,14 +48,18 @@ class="cursor"> </iron-icon> <div style="display: flex; align-items: center; column-gap: 1em;"> <h3 on-tap="_switch_expand" class="cursor"> Tasks </h3> - <template is="dom-if" if="[[_expand_all]]"> - <gr-button - on-tap="_show_all_tap" - disabled="[[_is_show_all(_show_all)]]"> Show All ([[_all_count]]) </gr-button> - <gr-button - on-tap="_needs_and_blocked_tap" - disabled="[[!_is_show_all(_show_all)]]"> - Needs + Blocked ([[_ready_count]], [[_fail_count]]) </gr-button> + <template is="dom-if" if="[[_is_show_all(_show_all)]]"> + <p>All ([[_all_count]]) | + <span + on-click="_needs_and_blocked_tap" + class="links">Needs + Blocked ([[_ready_count]], [[_fail_count]])</span> + <p> + </template> + <template is="dom-if" if="[[!_is_show_all(_show_all)]]"> + <p> <span + class="links" + on-click="_show_all_tap">All ([[_all_count]])</span> + | Needs + Blocked ([[_ready_count]], [[_fail_count]])</p> </template> </div> </div>
diff --git a/gr-task-plugin/gr-task-plugin.js b/gr-task-plugin/gr-task-plugin.js index 3f284de..e49f493 100644 --- a/gr-task-plugin/gr-task-plugin.js +++ b/gr-task-plugin/gr-task-plugin.js
@@ -166,10 +166,12 @@ _show_all_tap() { this._show_all = 'true'; + this._expand_all = true; }, _needs_and_blocked_tap() { this._show_all = 'false'; + this._expand_all = true; }, _switch_expand() {