X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fimage%2Fdialogs%2Fimage.js;h=3833e03ffdab6e89b1782bcd045e845448918501;hb=refs%2Ftags%2Fv3.6;hp=c604ebdfa3e6ba475c1a6d5cacfbfe9bd169011e;hpb=1056598c95187351dc58f4991d331e2258d038b5;p=ckeditor.git diff --git a/_source/plugins/image/dialogs/image.js b/_source/plugins/image/dialogs/image.js index c604ebd..3833e03 100644 --- a/_source/plugins/image/dialogs/image.js +++ b/_source/plugins/image/dialogs/image.js @@ -115,6 +115,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var switchLockRatio = function( dialog, value ) { + if ( !dialog.getContentElement( 'info', 'ratioLock' ) ) + return null; + var oImageOriginal = dialog.originalElement; // Dialog may already closed. (#5505) @@ -169,8 +172,10 @@ For licensing, see LICENSE.html or http://ckeditor.com/license var oImageOriginal = dialog.originalElement; if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) { - dialog.setValueOf( 'info', 'txtWidth', oImageOriginal.$.width ); - dialog.setValueOf( 'info', 'txtHeight', oImageOriginal.$.height ); + var widthField = dialog.getContentElement( 'info', 'txtWidth' ), + heightField = dialog.getContentElement( 'info', 'txtHeight' ); + widthField && widthField.setValue( oImageOriginal.$.width ); + heightField && heightField.setValue( oImageOriginal.$.height ); } updatePreview( dialog ); }; @@ -451,8 +456,12 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( dialogType != 'image' ) this.hidePage( 'Link' ); //Hide Link tab. var doc = this._.element.getDocument(); - this.addFocusable( doc.getById( btnResetSizeId ), 5 ); - this.addFocusable( doc.getById( btnLockSizesId ), 5 ); + + if ( this.getContentElement( 'info', 'ratioLock' ) ) + { + this.addFocusable( doc.getById( btnResetSizeId ), 5 ); + this.addFocusable( doc.getById( btnLockSizesId ), 5 ); + } this.commitContent = commitContent; }, @@ -612,6 +621,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license children : [ { + id : 'basic', type : 'vbox', children : [ @@ -728,6 +738,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license ] }, { + id : 'ratioLock', type : 'html', style : 'margin-top:30px;width:40px;height:40px;', onLoad : function() @@ -1059,6 +1070,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license [ { type : 'html', + id : 'htmlPreview', style : 'width:95%;', html : '
' + CKEDITOR.tools.htmlEncode( editor.lang.common.preview ) +'
'+ ''+