Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rich Text (YUI) Editor Broken on IE11

I'm running Internet Explorer 11 and YUI 2: Rich Text Editor seems not working. Please see attached screen shot for more detail. Any ideas how to fix this under IE11?

enter image description here

like image 516
Tester Avatar asked Nov 22 '13 16:11

Tester


1 Answers

For IE changed its User-Agent, YUI(2.9) need a surgery.

  1. Modify yahoo-dom-event.js: Find this: YAHOO.env.parseUA, then at last add something that tell YAHOO.env.ua now is undering IE 11. like this:

     if (g.ie == 0 && c.indexOf('Trident') != -1){
         g.ie = 11;
     }
    
  2. Modify editor.js: Find the _setInitialContent function, and after the if-branch that includes "BackCompat", add this:

    this.browser = YAHOO.env.parseUA();
    

    then just in the following if-branch (if (this.browser.ie || this.browser.webkit || this.browser.opera || (navigator.userAgent.indexOf('Firefox/1.5') != -1))): add this:

     if (this.browser.ie == 11) {
         this.browser.ie = 0;
     }
    

Hope Works, Good Luck!

like image 50
kinglomei Avatar answered Sep 21 '22 18:09

kinglomei