| 1116 | | |
| | 1116 | if(command == 'indent'){ |
| | 1117 | //should not allow user to indent neither a non-list node nor list item which is the first item in its parent |
| | 1118 | var li=dojo.withGlobal(this.window, "getAncestorElement",dijit._editor.selection, ['li']); |
| | 1119 | var n=li && li.previousSibling; |
| | 1120 | while(n){ |
| | 1121 | if(n.nodeType==1){ |
| | 1122 | return true; |
| | 1123 | } |
| | 1124 | n = n.previousSibling; |
| | 1125 | } |
| | 1126 | return false; |
| | 1127 | }else if(command == 'outdent'){ |
| | 1128 | //should not allow user to outdent a non-list node |
| | 1129 | return dojo.withGlobal(this.window, "hasAncestorElement",dijit._editor.selection, ['li']); |
| | 1130 | } |