From ea0f9b7ee6c65282f8a04f56feed97ec4e91d9ca Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 14 Jan 2014 15:36:08 +0100 Subject: [PATCH] =?utf8?q?jQuery=20UI=20fixes=20f=C3=BCr=20CKEditor=20in?= =?utf8?q?=20Dialog?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Form.pm | 2 +- js/jquery/fixes.js | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 js/jquery/fixes.js diff --git a/SL/Form.pm b/SL/Form.pm index a3990f9cb..0d6e9ae9a 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -472,7 +472,7 @@ sub header { $layout->use_javascript("$_.js") for (qw( jquery jquery-ui jquery.cookie jquery.checkall jquery.download - jquery/jquery.form client_js + jquery/jquery.form jquery/fixes client_js common part_selection switchmenuframe autocomplete_part ), "jquery/ui/i18n/jquery.ui.datepicker-$::myconfig{countrycode}"); diff --git a/js/jquery/fixes.js b/js/jquery/fixes.js new file mode 100644 index 000000000..ecaad6d87 --- /dev/null +++ b/js/jquery/fixes.js @@ -0,0 +1,40 @@ +// Allow CKeditor to work in jQuery dialogs. See +// http://bugs.jqueryui.com/ticket/9087 + +$.widget( "ui.dialog", $.ui.dialog, { + /*! jQuery UI - v1.10.2 - 2013-12-12 + * http://bugs.jqueryui.com/ticket/9087#comment:27 - bugfix + * http://bugs.jqueryui.com/ticket/4727#comment:23 - bugfix + * allowInteraction fix to accommodate windowed editors + */ + _allowInteraction: function( event ) { + if ( this._super( event ) ) { + return true; + } + + // address interaction issues with general iframes with the dialog + if ( event.target.ownerDocument != this.document[ 0 ] ) { + return true; + } + + // address interaction issues with dialog window + if ( $( event.target ).closest( ".cke_dialog" ).length ) { + return true; + } + + // address interaction issues with iframe based drop downs in IE + if ( $( event.target ).closest( ".cke" ).length ) { + return true; + } + }, + /*! jQuery UI - v1.10.2 - 2013-10-28 + * http://dev.ckeditor.com/ticket/10269 - bugfix + * moveToTop fix to accommodate windowed editors + */ + _moveToTop: function ( event, silent ) { + if ( !event || !this.options.modal ) { + this._super( event, silent ); + } + } + +}); -- 2.20.1