Commits

Luke Plant committed 616ce0e

Made class categories with no available options hidden.

  • Participants
  • Parent commits 335c681

Comments (0)

Files changed (1)

File semanticeditor/static/semanticeditor/javascript/wymeditor/plugins/semantic/wymeditor.semantic.js

             btn.removeClass("used");
         } else {
             btn.hide();
+            btn.addClass('disabled');
         }
     } else {
         if (style.prestype == "command") {
                 btn.removeClass("used");
             }
         } else {
+            btn.removeClass('disabled');
             btn.show();
             if (this.hasStyle(sectId, style)) {
                 btn.addClass("used");
                                             self.updateClassListItem(jQuery(this), styles[k]);
                                         });
         }
+        this.classList.find('li.class-category').each(function(k) {
+            var category = jQuery(this);
+            var total = category.find('li a').length;
+            var hidden = category.find('li a.disabled').length;
+            if ((total - hidden) > 0) {
+                category.show();
+            } else {
+                category.hide();
+            }
+        });
 
         // We also update the container list to set the class="used" for
         // consistent styling between that list and the command/class lists.