Changeset 13262

Show
Ignore:
Timestamp:
04/04/08 09:49:59 (8 months ago)
Author:
liucougar
Message:

fixes #6408

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dijit/trunk/_editor/RichText.js

    r13257 r13262  
    11141114                        } 
    11151115                } 
    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        } 
    11171131                // return this.document.queryCommandEnabled(command); 
    11181132                var elem = dojo.isIE ? this.document.selection.createRange() : this.document;