Ticket #5649: 5649_2.patch
File 5649_2.patch, 2.3 KB (added by , 14 years ago) |
---|
-
_source/plugins/dialog/plugin.js
68 68 return null; 69 69 } 70 70 71 72 function clearOrRecoverTextInputValue( container, isRecover ) 73 { 74 var inputs = container.$.getElementsByTagName( 'input' ); 75 for ( var i = 0, length = inputs.length; i < length ; i++ ) 76 { 77 var item = new CKEDITOR.dom.element( inputs[ i ] ); 78 79 if ( item.getAttribute( 'type' ).toLowerCase() == 'text' ) 80 { 81 if ( isRecover ) 82 { 83 item.setAttribute( 'value', item.getCustomData( 'fake_value' ) || '' ); 84 item.removeCustomData( 'fake_value' ); 85 } 86 else 87 { 88 item.setCustomData( 'fake_value', item.getAttribute( 'value' ) ); 89 item.setAttribute( 'value', '' ); 90 } 91 } 92 } 93 } 94 71 95 /** 72 96 * This is the base class for runtime dialog objects. An instance of this 73 97 * class represents a single named dialog for a single editor instance. … … 685 709 // First, set the dialog to an appropriate size. 686 710 this.resize( definition.minWidth, definition.minHeight ); 687 711 688 // Select the first tab by default.689 this.selectPage( this.definition.contents[0].id );690 691 712 // Reset all inputs back to their default value. 692 713 this.reset(); 693 714 715 // Select the first tab by default. 716 this.selectPage( this.definition.contents[0].id ); 717 694 718 // Set z-index. 695 719 if ( CKEDITOR.dialog._.currentZIndex === null ) 696 720 CKEDITOR.dialog._.currentZIndex = this._.editor.config.baseFloatZIndex; … … 968 992 969 993 var selected = this._.tabs[id]; 970 994 selected[0].addClass( 'cke_dialog_tab_selected' ); 971 selected[1].show(); 995 996 // [IE] a unvisible input[type='text'] will enlarge it's width 997 // if it's value is long when it show( #5649 ) 998 // so we clear it's value before it shows and then recover it 999 if ( CKEDITOR.env.ie6Compat || CKEDITOR.env.ie7Compat ) 1000 { 1001 clearOrRecoverTextInputValue( selected[1] ); 1002 selected[1].show(); 1003 setTimeout( function() 1004 { 1005 clearOrRecoverTextInputValue( selected[1], true ); 1006 }, 0 ); 1007 } 1008 else 1009 { 1010 selected[1].show(); 1011 } 1012 1013 972 1014 this._.currentTabId = id; 973 1015 this._.currentTabIndex = CKEDITOR.tools.indexOf( this._.tabIdList, id ); 974 1016 },