[bitbake-devel] [PATCH 18/23] toaster: toastergui: mute label for filter actions with no records

Ed Bartosh ed.bartosh at linux.intel.com
Fri Jan 15 11:01:01 UTC 2016


From: Elliot Smith <elliot.smith at intel.com>

The radio button for a filter action is disabled if that filter
action has no associated records. However, the label retains
the normal font styling, so it's unclear that the action is
not available.

Add the "muted" class to the label for a filter action (and still
disable its radio button) if it has no records associated with it.

[YOCTO #8738]

Signed-off-by: Elliot Smith <elliot.smith at intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
---
 lib/toaster/toastergui/static/js/table.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/toaster/toastergui/static/js/table.js b/lib/toaster/toastergui/static/js/table.js
index a253917..9384386 100644
--- a/lib/toaster/toastergui/static/js/table.js
+++ b/lib/toaster/toastergui/static/js/table.js
@@ -399,18 +399,21 @@ function tableInit(ctx){
    * show when selected
    */
   function createActionRadio(filterName, filterActionData) {
+    var hasNoRecords = (Number(filterActionData.count) == 0);
+
     var actionStr = '<div class="radio">' +
                     '<input type="radio" name="filter"' +
                     '       value="' + filterName + '"';
 
-    if (Number(filterActionData.count) == 0) {
+    if (hasNoRecords) {
       actionStr += ' disabled="disabled"';
     }
 
     actionStr += ' id="' + filterName + '">' +
                  '<input type="hidden" name="filter_value" value="on"' +
                  '       data-value-for="' + filterName + '">' +
-                 '<label class="filter-title"' +
+                 '<label class="filter-title' +
+                 (hasNoRecords ? ' muted' : '') + '"' +
                  '       for="' + filterName + '">' +
                  filterActionData.title +
                  ' (' + filterActionData.count + ')' +
-- 
2.1.4




More information about the bitbake-devel mailing list