Fixed table editing in Firefox
authorAlexander Ebert <ebert@woltlab.com>
Tue, 10 Sep 2013 21:59:18 +0000 (23:59 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 10 Sep 2013 21:59:18 +0000 (23:59 +0200)
wcfsetup/install/files/js/3rdParty/ckeditor/plugins/wbbcode/plugin.js

index 6006d9a041197f09fc3c35cd4747e3ade6323910..5168ddf2d714c7c54e1a89d3d1a261c2118a022c 100644 (file)
                        $insertedText = ev.data;
                }, null, null, 1);
                event.editor.on('mode', function(ev) {
+                       if ($.browser.mozilla && ev.editor.mode === 'wysiwyg') {
+                               fixFirefox();
+                       }
+                       
                        ev.editor.focus();
                        
                        insertFakeSubmitButton(ev);
                insertFakeSubmitButton(event);
                
                // remove stupid title tag
-               $(event.editor.container.$).find('.cke_wysiwyg_div').removeAttr('title');
+               $(event.editor.container.$).removeAttr('title');
+               
+               if ($.browser.mozilla) {
+                       fixFirefox();
+               }
        });
        
        /**
                
        }
        
+       /**
+        * Disables object resizing and table handles in Firefox.
+        */
+       function fixFirefox() {
+               document.designMode = 'on';
+               document.execCommand('enableObjectResizing', false, false);
+               document.execCommand('enableInlineTableEditing', false, false);
+               document.designMode = 'off';
+       }
+       
        /**
         * Removes obsolete dialog elements.
         */