dijit._editor.plugins.EnterKeyHandling._fixNewLineBehaviorForIE
dojo.require("dijit._editor.plugins.EnterKeyHandling");
defined in dijit/_editor/plugins/EnterKeyHandling.js
Usage
function (d) (view source)
if(this.editor.document.__INSERTED_EDITIOR_NEWLINE_CSS === undefined){ var lineFixingStyles = "p{margin:0 !important;}"; var insertCssText = function( /*String*/ cssStr, /*Document*/ doc, /*String*/ URI) { // summary: // Attempt to insert CSS rules into the document through inserting a // style element // DomNode Style = insertCssText(String ".dojoMenu {color: green;}"[, DomDoc document, dojo.uri.Uri Url ]) if(!cssStr){ return null; // HTMLStyleElement } if(!doc){ doc = document; } // if(URI){// fix paths in cssStr // cssStr = dojo.html.fixPathsInCssText(cssStr, URI); // } var style = doc.createElement("style"); style.setAttribute("type", "text/css"); // IE is b0rken enough to require that we add the element to the doc // before changing it's properties var head = doc.getElementsByTagName("head")[0]; if(!head){ // must have a head tag console.debug("No head tag in document, aborting styles"); return null; // HTMLStyleElement }else{ head.appendChild(style); } if(style.styleSheet){// IE var setFunc = function(){ try{ style.styleSheet.cssText = cssStr; }catch(e){ console.debug(e); } }; if(style.styleSheet.disabled){ setTimeout(setFunc, 10); }else{ setFunc(); } }else{ // w3c var cssText = doc.createTextNode(cssStr); style.appendChild(cssText); } return style; // HTMLStyleElement } insertCssText(lineFixingStyles, this.editor.document); this.editor.document.__INSERTED_EDITIOR_NEWLINE_CSS = true; // this.regularPsToSingleLinePs(this.editNode); return d; } return null;
parameter | type | description |
---|---|---|
d |