Fixed active states
authorAlexander Ebert <ebert@woltlab.com>
Thu, 5 Jan 2017 12:54:52 +0000 (13:54 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 5 Jan 2017 12:54:57 +0000 (13:54 +0100)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabObserve.js

index 807758d505556a7c8cb4d47e5455bd385adf5959..7f2e86d5d01d21f310867bc898778c40679f15ce 100644 (file)
@@ -64,6 +64,17 @@ $.Redactor.prototype.WoltLabObserve = function() {
                                        this.button.enable('horizontalrule');
                                }
                                
+                               if (this.utils.isCurrentOrParent(['table', 'li'])) {
+                                       this.button.disable('code');
+                                       this.button.disable('spoiler');
+                                       this.button.disable('woltlabQuote');
+                               }
+                               else {
+                                       this.button.enable('code');
+                                       this.button.enable('spoiler');
+                                       this.button.enable('woltlabQuote');
+                               }
+                               
                                // WoltLab modification: we know that there will be quite a few
                                // active button states, so we'll simply check all ancestors one
                                // by one instead of searching the DOM over and over again