Commits

Luke Plant committed 616ce0e

Made class categories with no available options hidden.

Comments (0)

Files changed (1)

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.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.