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?