ricardo
ricardo

Reputation: 621

TinyMCE method remove does not work in Internet Explorer

I´ve worked on the text editor and there are one plugin that was created to putting header and footer (basically a row of table) in the editor and one of the business rules is don´t to permit move the header or footer (My version is 3.3.8 but I tested in the last 3.4.6).

I created a method in the basic_config.js, basically inside of the method "ed.onChange.add(function(ed, l)" to readjust the position of header or footer when the user try to move the table to another place, like this:

               //find out the div of the header
                var elm = tinyMCE.activeEditor.dom.get("testeHeader");

               //case the elm move of position...
               if(elm != null) {
                    var txt = tinyMCE.activeEditor.dom.getOuterHTML(elm);
                    //method remove does not work in Internet Explorer
                    tinyMCE.activeEditor.dom.remove("testeHeader");
                    //relocates the header to the top
                    $('#editor1_ifr').contents().find('body').prepend(txt);
                }

In the Firefox it works but in the Internet Explorer de method remove fail, nothing happers.

There any response for this cause?

There are some form to block the mouse selection of the header or footer of table?

Thank a bunch for all that get help!

Upvotes: 1

Views: 810

Answers (1)

Thariama
Thariama

Reputation: 50840

You can try the following:

tinyMCE.activeEditor.getBody().removeChild(elm);  

instead of

tinyMCE.activeEditor.dom.remove("testeHeader");

Upvotes: 1

Related Questions