]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
toastergui: mute label for filter actions with no records
authorElliot Smith <elliot.smith@intel.com>
Fri, 15 Jan 2016 11:01:01 +0000 (13:01 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 15 Jan 2016 16:29:19 +0000 (16:29 +0000)
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@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/toaster/toastergui/static/js/table.js

index a253917b61371a53f63f0cdc1502466ca85da936..9384386718cbdde5baf9fafdc7424d64be27e0e5 100644 (file)
@@ -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 + ')' +