Skip to content

Instantly share code, notes, and snippets.

@davglass
Created May 22, 2009 17:10
Show Gist options
  • Save davglass/116242 to your computer and use it in GitHub Desktop.
Save davglass/116242 to your computer and use it in GitHub Desktop.
var myEditor = new YAHOO.widget.Editor('editor', {
height: '300px',
width: '530px',
dompath: true,
animate: true,
extracss: '.yui-spellcheck { background-color: yellow; }'
});
/* {{{ Override _handleClick method to keep the window open on click */
myEditor._handleClick = function(ev) {
if (this._isNonEditable(ev)) {
return false;
}
this._setCurrentEvent(ev);
var tar =Event.getTarget(ev);
if (this.currentWindow) {
if (!Dom.hasClass(tar, 'yui-spellcheck')) {
this.closeWindow();
}
}
if (!Dom.hasClass(tar, 'yui-spellcheck')) {
if (YAHOO.widget.EditorInfo.window.win && YAHOO.widget.EditorInfo.window.scope) {
YAHOO.widget.EditorInfo.window.scope.closeWindow.call(YAHOO.widget.EditorInfo.window.scope);
}
}
if (this.browser.webkit) {
var tar =Event.getTarget(ev);
if (this._isElement(tar, 'a') || this._isElement(tar.parentNode, 'a')) {
Event.stopEvent(ev);
this.nodeChange();
}
} else {
this.nodeChange();
}
};
/* }}} */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment