Added missing button active states
authorAlexander Ebert <ebert@woltlab.com>
Tue, 30 Aug 2016 09:07:38 +0000 (11:07 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 30 Aug 2016 09:07:38 +0000 (11:07 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabButton.js

index 27aca9d697b956cef3b3a2e27235d0ad30f6ba68..c5cd1ed40002c1cdfd94c8ca5ef9f3a05dd4ccc3 100644 (file)
@@ -31,12 +31,18 @@ $.Redactor.prototype.WoltLabButton = function() {
                                
                                //noinspection JSUnresolvedVariable
                                buttonData = this.opts.woltlab.buttons[buttonName];
+                               if (buttonName === 'underline') {
+                                       this.opts.activeButtonsStates.u = 'underline'
+                               }
                                
                                switch (buttonName) {
                                        case 'subscript':
                                        case 'superscript':
                                                button = this.button.addAfter(this.opts.buttons[i - 1], buttonName, '');
                                                this.button.setEvent(button, buttonName, { func: 'inline.format' });
+                                               
+                                               this.opts.activeButtonsStates[(buttonName === 'subscript' ? 'sub' : 'sup')] = buttonName;
+                                               
                                                break;
                                        
                                        case 'redo':