dijit._editor.plugins.EnterKeyHandling.onKeyPressed
dojo.require("dijit._editor.plugins.EnterKeyHandling");
defined in dijit/_editor/plugins/EnterKeyHandling.js
Usage
function (e) (view source)
if(this._checkListLater){ if(dojo.withGlobal(this.editor.window, 'isCollapsed', dijit)){ if(!dojo.withGlobal(this.editor.window, 'hasAncestorElement', dijit._editor.selection, ['LI'])){ //circulate the undo detection code by calling RichText::execCommand directly dijit._editor.RichText.prototype.execCommand.apply(this.editor, ['formatblock',this.blockNodeForEnter]); //set the innerHTML of the new block node var block = dojo.withGlobal(this.editor.window, 'getAncestorElement', dijit._editor.selection, [this.blockNodeForEnter]); if(block){ block.innerHTML=this.bogusHtmlContent; if(dojo.isIE){ //the following won't work, it will move the caret to the last list item in the previous list // var newrange = dijit.range.create(); // newrange.setStart(block.firstChild,0); // var selection = dijit.range.getSelection(this.editor.window) // selection.removeAllRanges(); // selection.addRange(newrange); //move to the start by move backward one char var r = this.editor.document.selection.createRange(); r.move('character',-1); r.select(); } }else{ alert('onKeyPressed: Can not find the new block node'); //FIXME } } } this._checkListLater = false; }else if(this._pressedEnterInBlock){ //the new created is the original current P, so we have previousSibling below this.removeTrailingBr(this._pressedEnterInBlock.previousSibling); delete this._pressedEnterInBlock; }
parameter | type | description |
---|---|---|
e |