Ticket #6491: 6491_2.patch
File 6491_2.patch, 2.1 KB (added by , 13 years ago) |
---|
-
_source/plugins/image/dialogs/image.js
121 121 if( !oImageOriginal ) 122 122 return null; 123 123 124 var ratioButton = CKEDITOR.document.getById( btnLockSizesId ); 125 126 if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) 124 // Check image ratio and original image ratio, but respecting user's preference. 125 if ( value == 'check' ) 127 126 { 128 if ( value == 'check' ) // Check image ratio and original image ratio.127 if ( !dialog.userlockRatio && oImageOriginal.getCustomData( 'isReady' ) == 'true' ) 129 128 { 130 129 var width = dialog.getValueOf( 'info', 'txtWidth' ), 131 130 height = dialog.getValueOf( 'info', 'txtHeight' ), … … 141 140 dialog.lockRatio = true; 142 141 } 143 142 } 144 else if ( value != undefined ) 145 dialog.lockRatio = value; 146 else 147 dialog.lockRatio = !dialog.lockRatio; 143 } 144 else if ( value != undefined ) 145 dialog.lockRatio = value; 146 else 147 { 148 dialog.userlockRatio = 1; 149 dialog.lockRatio = !dialog.lockRatio; 148 150 } 149 else if ( value != 'check' ) // I can't lock ratio if ratio is unknown.150 dialog.lockRatio = false;151 151 152 var ratioButton = CKEDITOR.document.getById( btnLockSizesId ); 152 153 if ( dialog.lockRatio ) 153 154 ratioButton.removeClass( 'cke_btn_unlocked' ); 154 155 else … … 275 276 this.linkEditMode = false; 276 277 277 278 this.lockRatio = true; 279 this.userlockRatio = 0; 278 280 this.dontResetSize = false; 279 281 this.firstLoad = true; 280 282 this.addLink = false; … … 335 337 336 338 // Fill out all fields. 337 339 this.setupContent( IMAGE, this.imageElement ); 338 339 // Refresh LockRatio button340 switchLockRatio ( this, true );341 340 } 342 341 else 343 342 this.imageElement = editor.document.createElement( 'img' ); 344 343 344 // Refresh LockRatio button 345 switchLockRatio ( this, true ); 346 345 347 // Dont show preview if no URL given. 346 348 if ( !CKEDITOR.tools.trim( this.getValueOf( 'info', 'txtUrl' ) ) ) 347 349 {