From 46881b36c9b0a3dec63dfc8bfd83ae863a22a860 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 22 Jan 2014 15:24:40 +0200 Subject: [PATCH] add allow disable patch --- allow-disable.patch | 46 ++++++++++++++++++++++++++++++++++++ ckeditor-addon-autogrow.spec | 2 ++ 2 files changed, 48 insertions(+) create mode 100644 allow-disable.patch diff --git a/allow-disable.patch b/allow-disable.patch new file mode 100644 index 0000000..e926738 --- /dev/null +++ b/allow-disable.patch @@ -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 ); diff --git a/ckeditor-addon-autogrow.spec b/ckeditor-addon-autogrow.spec index ad77d93..229da3a 100644 --- a/ckeditor-addon-autogrow.spec +++ b/ckeditor-addon-autogrow.spec @@ -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 -- 2.44.0