]> git.pld-linux.org Git - packages/ckeditor-addon-autogrow.git/commitdiff
add allow disable patch master AC-branch auto/ac/ckeditor-addon-autogrow-4.2.3-1 auto/th/ckeditor-addon-autogrow-4.2.3-1
authorElan Ruusamäe <glen@delfi.ee>
Wed, 22 Jan 2014 13:24:40 +0000 (15:24 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Wed, 22 Jan 2014 13:24:40 +0000 (15:24 +0200)
allow-disable.patch [new file with mode: 0644]
ckeditor-addon-autogrow.spec

diff --git a/allow-disable.patch b/allow-disable.patch
new file mode 100644 (file)
index 0000000..e926738
--- /dev/null
@@ -0,0 +1,46 @@
+--- autogrow/plugin.js 2013-11-14 13:14:39.000000000 +0200
++++ autogrow/plugin.js 2014-01-22 11:37:50.747323000 +0200
+@@ -40,6 +40,10 @@
+               if ( !editor.window )
+                       return null;
++              if (editor.config.autoGrow_disabled && typeof editor.config.autoGrow_disabled != 'undefined') {
++                      return null;
++              }
++
+               var maximize = editor.getCommand( 'maximize' );
+                       // Disable autogrow when the editor is maximized .(#6339)
+               if( maximize && maximize.state == CKEDITOR.TRISTATE_ON )
+@@ -84,7 +88,8 @@
+                       editor.on( 'instanceReady', function() {
+                               var editable = editor.editable(),
+-                                      lastHeight;
++                                      lastHeight,
++                                      lastResizedHeight;
+                               // Simply set auto height with div wysiwyg.
+                               if ( editable.isInline() )
+@@ -92,6 +97,22 @@
+                               // For framed wysiwyg we need to resize the editor.
+                               else
+                               {
++                                      editor.addCommand( 'autogrowDisable', {
++                                              exec: function( editor ) {
++                                                      editor.resize( '100%', lastResizedHeight, true );
++                                              }
++                                      } );
++                                      editor.addCommand( 'autogrowEnable', {
++                                              exec: function( editor, a ) {
++                                                      var scrollable = getScrollable( editor ),
++                                                              currentHeight = editor.window.getViewPaneSize().height;
++                                                      if (!currentHeight) {
++                                                              currentHeight = parseInt(editor.config.height);
++                                                      }
++                                                      lastResizedHeight = currentHeight;
++                                                      lastHeight = resizeEditor( editor );
++                                              }
++                                      } );
+                                       editor.addCommand( 'autogrow', {
+                                               exec: function( editor ) {
+                                                       lastHeight = resizeEditor( editor, lastHeight );
index ad77d93293106e060c5f37b1c7de2c0334ecffc7..229da3ae8e9dd652815ad8dee8143b8ba17a5330 100644 (file)
@@ -8,6 +8,7 @@ License:        LGPL v2.1+ / GPL v2+ / MPL
 Group:         Applications/WWW
 Source0:       http://download.ckeditor.com/autogrow/releases/autogrow_%{version}.zip
 # Source0-md5: 47d9ff305241de389e60c0c73de27d13
+Patch0:                allow-disable.patch
 URL:           http://ckeditor.com/addon/autogrow
 BuildRequires: rpmbuild(macros) >= 1.553
 BuildRequires: sed >= 4.0
@@ -31,6 +32,7 @@ Note: This plugin is to be used with the themedui creato
 
 %prep
 %setup -qc
+%patch0 -p0
 mv %{addon}/samples .
 
 %install
This page took 0.047403 seconds and 4 git commands to generate.