Temporary fix for undo/redo button on mobile
authorAlexander Ebert <ebert@woltlab.com>
Thu, 25 Jun 2015 13:35:37 +0000 (15:35 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 25 Jun 2015 13:35:37 +0000 (15:35 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wbutton.js

index 7ea3d5e51191dbd072cb5d40e9f70da2805d8891..043986629262361615c299f091e85b14f888b88f 100644 (file)
@@ -88,13 +88,16 @@ RedactorPlugins.wbutton = function() {
                        // handle image insert
                        this.button.addCallback(this.button.get('image'), $.proxy(this.wbutton.insertImage, this));
                        
-                       // handle redo/undo buttons
-                       var $undoButton = this.button.addAfter('html', 'undo', WCF.Language.get('wcf.bbcode.button.undo'));
-                       var $redoButton = this.button.addAfter('undo', 'redo', WCF.Language.get('wcf.bbcode.button.redo'));
-                       this.button.addCallback($undoButton, this.buffer.undo);
-                       this.button.addCallback($redoButton, this.buffer.redo);
+                       // handle redo/undo buttons (for some reason not available on mobile, disabled for now)
+                       if (this.utils.isDesktop()) {
+                               var $undoButton = this.button.addAfter('html', 'undo', WCF.Language.get('wcf.bbcode.button.undo'));
+                               var $redoButton = this.button.addAfter('undo', 'redo', WCF.Language.get('wcf.bbcode.button.redo'));
+                               this.button.addCallback($undoButton, this.buffer.undo);
+                               this.button.addCallback($redoButton, this.buffer.redo);
+                               
+                               $redoButton.parent().addClass('separator');
+                       }
                        
-                       $redoButton.parent().addClass('separator');
                },
                
                /**