Ticket #6112: 6112_haysmark.patch

File 6112_haysmark.patch, 1.7 kB (added by doughays, 10 months ago)

Fix blur/click scroll problem - bug#2 in the problem description remains

  • _editor/RichText.js

     
    257257                        var tmpFunc = dojo.hitch(this, function(){ 
    258258                                //some browsers refuse to submit display=none textarea, so 
    259259                                //move the textarea out of screen instead 
     260                                dojo.attr(this.textarea, 'tabIndex', '-1'); 
    260261                                with(this.textarea.style){ 
    261262                                        display = "block"; 
    262263                                        position = "absolute"; 
     
    654655                        this.editNode=this.document.body.firstChild; 
    655656                        var _this = this; 
    656657                        if(dojo.isIE){ // #4996 IE wants to focus the BODY tag 
    657                                 this.editNode.parentNode.onfocus = 
    658                                         function(){ 
    659                                                 if(!_this.editNode.blurring){ 
    660                                                         _this.editNode.focus(); 
    661                                                 } 
    662                                                 _this.editNode.blurring = false; 
    663                                         } 
     658                                var tabStop = this.tabStop = dojo.doc.createElement('<div tabIndex=-1>'); 
     659                                this.editingArea.appendChild(tabStop); 
     660                                this.iframe.onfocus = function(){ _this.editNode.setActive(); } 
    664661                        } 
    665662                } 
    666663 
     
    715712                if(dojo.isIE){ 
    716713                        if(e.keyCode == dojo.keys.TAB && e.shiftKey && !e.ctrlKey && !e.altKey){ 
    717714                                // focus the BODY so the browser will tab away from it instead 
    718                                 this.editNode.blurring = true; 
    719                                 this.editNode.parentNode.focus(); 
     715                                this.iframe.focus(); 
     716                        }else if(e.keyCode == dojo.keys.TAB && !e.shiftKey && !e.ctrlKey && !e.altKey){ 
     717                                // focus the BODY so the browser will tab away from it instead 
     718                                this.tabStop.focus(); 
    720719                        }else if(e.keyCode === dojo.keys.BACKSPACE && this.document.selection.type === "Control"){ 
    721720                                // IE has a bug where if a non-text object is selected in the editor, 
    722721                  // hitting backspace would act as if the browser's back button was