Fixed: HTML editing broken in IE11

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
SteveHiner
Lieutenant (LT)
Lieutenant (LT)
Posts: 58
Joined: Thu Jun 21, 2007 8:27 pm

Fixed: HTML editing broken in IE11

Post by SteveHiner » Sat Dec 14, 2013 10:31 pm

Able Gold uses TinyMCE 3.4.9 as the page editor in the admin. I found out tonight that on IE11, if you click the HTML button to edit the code directly you get a popup with no HTML in it. Behind the scenes the javascript is throwing an error because of the browser being misdetected. The bug is fixed in the newer versions of TinyMCE but I didn't want to upgrade that and risk breaking something else.

Here's how you fix it:
Open Scripts\tinymce\themes\advanced\js\source_editor.js

In the onLoadInit() method near the top of the file you will find this:

Code: Select all

        if (tinymce.isGecko)
            document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck");
The problem is that isGecko is true for IE11 but the getParam call fails. I made a dirty hack and decided to just ignore the error by wrapping it in a try...catch. I know, it makes my code smell but the long-term fix is for Able to start using a newer version of TinyMCE and I'm willing to have this in my code until they update it.

Now that code looks like this:

Code: Select all

    try { //SBH: IE11 chokes on this call and prevents the source from getting loaded
        if (tinymce.isGecko)
            document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck");
    } catch (ex) {
    }
Alternatively you could move the if block above to the bottom of the method and just let the error get thrown but this feels somewhat less dirty to me than that solution.
Steve

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: Fixed: HTML editing broken in IE11

Post by ForumsAdmin » Mon Dec 16, 2013 1:01 am

Thanks Steve. Till the time we have a proper fix in new version of TinyMCE, we will incorporate this in our code.

Post Reply