Ticket #3234: 3234.patch
File 3234.patch, 2.6 KB (added by , 15 years ago) |
---|
-
_source/plugins/dialog/plugin.js
335 335 { 336 336 this._.currentFocusIndex = -1; 337 337 changeFocus( true ); 338 339 /* 340 * IE BUG: If the initial focus went into a non-text element (e.g. button), 341 * then IE would still leave the caret inside the editing area. 342 */ 343 if ( CKEDITOR.env.ie ) 344 { 345 var $selection = editor.document.$.selection, 346 $range = $selection.createRange(); 347 348 if ( $range ) 349 { 350 if ( $range.parentElement && $range.parentElement().ownerDocument == editor.document.$ 351 || $range.item && $range.item( 0 ).ownerDocument == editor.document.$ ) 352 { 353 var $myRange = document.body.createTextRange(); 354 $myRange.moveToElementText( this.getElement().getFirst().$ ); 355 $myRange.collapse( true ); 356 $myRange.select(); 357 } 358 } 359 } 338 360 } 339 361 }, this, null, 0xffffffff ); 340 362 … … 397 419 for ( i = 0 ; i < buttons.length ; i++ ) 398 420 this._.buttons[ buttons[i].id ] = buttons[i]; 399 421 400 // Insert dummy text box for grabbing focus away from the editing area.401 this._.dummyText = CKEDITOR.dom.element.createFromHtml( '<input type="text" style="position: absolute; left: -100000px; top: -100000px" />' );402 this._.dummyText.appendTo( themeBuilt.element );403 404 422 CKEDITOR.skins.load( editor, 'dialog' ); 405 423 }; 406 424 … … 444 462 { 445 463 if ( !this._.updateSize ) 446 464 return this._.size; 447 var element = this._.element.get ElementsByTag( 'div' ).getItem( 0);465 var element = this._.element.getFirst(); 448 466 var size = this._.size = { width : element.$.offsetWidth || 0, height : element.$.offsetHeight || 0}; 449 467 450 468 // If either the offsetWidth or offsetHeight is 0, the element isn't visible. … … 468 486 { 469 487 // The dialog may be fixed positioned or absolute positioned. Ask the 470 488 // browser what is the current situation first. 471 var element = this._.element.get ElementsByTag( 'div' ).getItem( 0);489 var element = this._.element.getFirst(); 472 490 if ( isFixed === undefined ) 473 491 isFixed = element.getComputedStyle( 'position' ) == 'fixed'; 474 492 … … 564 582 // Save editor selection and grab the focus. 565 583 if ( !this._.parentDialog ) 566 584 this.saveSelection(); 567 this._.dummyText.focus();568 this._.dummyText.$.select();569 585 570 586 // Reset the hasFocus state. 571 587 this._.hasFocus = false;