12345678910111213141516171819202122 |
- ///import core
- ///import plugins\paragraph.js
- ///commands 首行缩进
- ///commandsName Outdent,Indent
- ///commandsTitle 取消缩进,首行缩进
- /**
- * 首行缩进
- * @function
- * @name baidu.editor.execCommand
- * @param {String} cmdName outdent取消缩进,indent缩进
- */
- UE.commands['indent'] = {
- execCommand : function() {
- var me = this,value = me.queryCommandState("indent") ? "0em" : (me.options.indentValue || '2em');
- me.execCommand('Paragraph','p',{style:'text-indent:'+ value});
- },
- queryCommandState : function() {
- var pN = domUtils.filterNodeList(this.selection.getStartElementPath(),'p h1 h2 h3 h4 h5 h6');
- return pN && pN.style.textIndent && parseInt(pN.style.textIndent) ? 1 : 0;
- }
- };
|