Ticket #3203: 3203_2.patch
File 3203_2.patch, 2.9 KB (added by , 15 years ago) |
---|
-
_source/plugins/wsc/dialogs/wsc.js
118 118 119 119 return { 120 120 title : editor.lang.spellCheck.title, 121 minWidth : 4 90,122 minHeight : 3 90,121 minWidth : 485, 122 minHeight : 380, 123 123 buttons : [ CKEDITOR.dialog.cancelButton ], 124 124 onShow : function() 125 125 { … … 146 146 { 147 147 id : 'general', 148 148 label : editor.lang.spellCheck.title, 149 padding : 0, 149 150 elements : [ 150 151 { 151 152 type : 'html', 152 153 id : 'content', 153 style : 'width: 500px;height:400px',154 style : 'width:485;height:380px', 154 155 html : '<div></div>' 155 156 } 156 157 ] -
_source/plugins/dialog/plugin.js
121 121 editor : editor, 122 122 element : themeBuilt.element, 123 123 name : dialogName, 124 contentSize : { width : 0, height : 0 }, 124 125 size : { width : 0, height : 0 }, 126 updateSize : false, 125 127 contents : {}, 126 128 buttons : {}, 127 129 accessKeyMap : {}, … … 416 418 { 417 419 return function( width, height ) 418 420 { 419 if ( this._. size && this._.size.width == width && this._.size.height == height )421 if ( this._.contentSize && this._.contentSize.width == width && this._.contentSize.height == height ) 420 422 return; 421 423 422 424 CKEDITOR.dialog.fire( 'resize', … … 427 429 height : height 428 430 }, this._.editor ); 429 431 430 this._.size = { width : width, height : height }; 432 this._.contentSize = { width : width, height : height }; 433 this._.updateSize = true; 431 434 }; 432 435 })(), 433 436 … … 439 442 */ 440 443 getSize : function() 441 444 { 442 var element = this._.element.getFirst(); 443 return { width : element.$.offsetWidth, height : element.$.offsetHeight }; 445 if ( !this._.updateSize ) 446 return this._.size; 447 var element = this._.element.getElementsByTag( 'div' ).getItem( 0 ); 448 var size = this._.size = { width : element.$.offsetWidth || 0, height : element.$.offsetHeight || 0}; 449 450 // If either the offsetWidth or offsetHeight is 0, the element isn't visible. 451 this._.updateSize = !size.width || !size.height; 452 453 return size; 444 454 }, 445 455 446 456 /** … … 512 522 513 523 // Rearrange the dialog to the middle of the window. 514 524 var viewSize = CKEDITOR.document.getWindow().getViewPaneSize(); 515 this.move( ( viewSize.width - this._.size.width ) / 2, ( viewSize.height - this._.size.height ) / 2 ); 525 var dialogSize = this.getSize(); 526 this.move( ( viewSize.width - dialogSize.width ) / 2, ( viewSize.height - dialogSize.height ) / 2 ); 516 527 517 528 // Select the first tab by default. 518 529 this.selectPage( this.definition.contents[0].id );