Forum closed. New forum available at http://community.wymeditor.org/

Underline tool

Support forum for WYMeditor.

Underline tool

Postby ShalikoU on Fri Oct 29, 2010 2:12 pm

Hello,

I realized Underline Tool which works fine in FireFox, but it does not work in Chrome browser. Underline works in all browsers, but unwrap does not work in Chrome.

Here's the code:

Code: Select all
postInit: function(wym) {
  var html = "<li class='wym_tools_underline'>"
      + "<a href='#'"
      + " title='Wrap'>"
      + "Wrap"
      + "</a></li>";

    jQuery(wym._box)
     .find(wym._options.toolsSelector)
     .prepend(html);
     
     //handle click event
     jQuery(wym._box).find('.wym_tools_underline a').click(function() {
       if(jQuery(wym.selected()).hasClass("underline")) {
          wym.unwrap();
         //wym.insert(jQuery(wym.selected()).text());
       } else {
         wym.wrap('<span class="underline">', '</span>');
       }
       return false;
     });
}


Any ideas?
ShalikoU
 
Posts: 1
Joined: Fri Oct 29, 2010 2:02 pm

Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests