[Dojo-checkins] [dojo] #9427: [PATCH][CCLA] insertHorizontalLine is broken on IE.

dojo trac at dojotoolkit.org
Wed Jun 17 16:49:42 EDT 2009


#9427: [PATCH][CCLA] insertHorizontalLine is broken on IE.
----------------------+-----------------------------------------------------
 Reporter:  jaredj    |        Owner:  liucougar
     Type:  defect    |       Status:  new      
 Priority:  normal    |    Milestone:  tbd      
Component:  Editor    |      Version:  1.3.0    
 Severity:  critical  |   Resolution:           
 Keywords:            |  
----------------------+-----------------------------------------------------

Comment(by jaredj):

 This also works (and combines them)

                 var ihSelect = true;
                 if(command === "inserthorizontalrule" && dojo.isIE){
                         //IE doesn't do this right natively, so we have to
 use
                         //inserthtml logic with selection at the end
 disabled.
                         command = "inserthtml";
                         argument = "<hr>";
                         ihSelect = false;
                 }
                 if(command == "inserthtml"){
                         //TODO: we shall probably call
 _preDomFilterContent here as well
                         argument = this._preFilterContent(argument);
                         returnValue = true;
                         if(dojo.isIE){
                                 var insertRange =
 this.document.selection.createRange();
 if(this.document.selection.type.toUpperCase()=='CONTROL'){
                                         var n=insertRange.item(0);
                                         while(insertRange.length){
 insertRange.remove(insertRange.item(0));
                                         }
                                         n.outerHTML=argument;
                                 }else{
                                         insertRange.pasteHTML(argument);
                                 }
                                 if(ihSelect){
                                         insertRange.select();
                                 }
                                 //insertRange.collapse(true);
                         }else if(dojo.isMoz && !argument.length){
                                 //mozilla can not inserthtml an empty html
 to delete current selection
                                 //so we delete the selection instead in
 this case
                                 this._sCall("remove"); // FIXME
                         }else{
                                 returnValue =
 this.document.execCommand(command, false, argument);
                         }
                 }else if(

-- 
Ticket URL: <http://bugs.dojotoolkit.org/ticket/9427#comment:3>
dojo <http://dojotoolkit.org/>
The Dojo UI Toolkit


More information about the Dojo-checkins mailing list