Ticket #12126: 0001-Add-new-configuration-option-editor.config.image_emp.patch

File 0001-Add-new-configuration-option-editor.config.image_emp.patch, 1.3 KB (added by Martin Dietze, 10 years ago)

Patch adding a 'editor.config.image_emptyHeightWidth' option to suppress pre-filling image dimensions in dialog.

  • plugins/image/dialogs/image.js

    From 6954099e88c8d1e10616433628885db45ce88856 Mon Sep 17 00:00:00 2001
    From: Martin Dietze <mdietze@gmail.com>
    Date: Tue, 24 Jun 2014 11:23:33 +0200
    Subject: [PATCH] Add new configuration option
     'editor.config.image_emptyHeightWidth' through which the pre-filling of the
     image dialog's 'width' and 'height' fields can be suppressed. This option is
     useful, because in some cases, users want no hard-set dimensions in the
     generated IMG tab by default.
    
    ---
     plugins/image/dialogs/image.js | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/plugins/image/dialogs/image.js b/plugins/image/dialogs/image.js
    index fe15c4f..ba1d755 100644
    a b  
    155155                                        if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) {
    156156                                                var widthField = dialog.getContentElement( 'info', 'txtWidth' ),
    157157                                                        heightField = dialog.getContentElement( 'info', 'txtHeight' );
    158                                                 widthField && widthField.setValue( oImageOriginal.$.width );
    159                                                 heightField && heightField.setValue( oImageOriginal.$.height );
     158                                                widthField && !editor.config.image_emptyHeightWidth && widthField.setValue( oImageOriginal.$.width );
     159                                                heightField && !editor.config.image_emptyHeightWidth && heightField.setValue( oImageOriginal.$.height );
    160160                                        }
    161161                                        updatePreview( dialog );
    162162                                };
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy