Ticket #7158: 7158.patch
File 7158.patch, 2.4 KB (added by , 13 years ago) |
---|
-
_source/plugins/iframe/dialogs/iframe.js
48 48 title : iframeLang.title, 49 49 minWidth : 350, 50 50 minHeight : 260, 51 onLoad : function() 52 { 53 var dialog = this, 54 styles = dialog.getContentElement( 'advanced', 'advStyles' ); 55 56 styles && styles.on( 'change', function() 57 { 58 // Synchronize width value. 59 var width = parseInt( this.getStyle( 'width', '' ) || '', 10 ), 60 txtWidth = dialog.getContentElement( 'info', 'width' ); 61 62 txtWidth && txtWidth.setValue( width, true ); 63 64 // Synchronize height value. 65 var height = parseInt( this.getStyle( 'height', '' ) || '', 10 ), 66 txtHeight = dialog.getContentElement( 'info', 'height' ); 67 68 txtHeight && txtHeight.setValue( height, true ); 69 }); 70 }, 51 71 onShow : function() 52 72 { 53 73 // Clear previously saved elements. … … 63 83 64 84 this.setupContent( iframeNode, fakeImage ); 65 85 } 86 87 // Call the onChange method for the widht and height fields so 88 // they get reflected into the Advanced tab. 89 var widthInput = this.getContentElement( 'info', 'width' ), 90 heightInput = this.getContentElement( 'info', 'height' ); 91 widthInput && widthInput.onChange(); 92 heightInput && heightInput.onChange(); 66 93 }, 67 94 onOk : function() 68 95 { … … 139 166 commitValue.apply( this, arguments ); 140 167 if ( this.getValue() ) 141 168 extraStyles.width = this.getValue() + 'px'; 169 }, 170 onChange : function() 171 { 172 var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' ), 173 value = this.getValue(); 174 styles && styles.updateStyle( 'width', value && ( value + 'px' ) ); 142 175 } 143 176 }, 144 177 { … … 163 196 commitValue.apply( this, arguments ); 164 197 if ( this.getValue() ) 165 198 extraStyles.height = this.getValue() + 'px'; 199 }, 200 onChange : function() 201 { 202 var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' ), 203 value = this.getValue(); 204 styles && styles.updateStyle( 'height', value && ( value + 'px' ) ); 166 205 } 167 206 }, 168 207 {