From dcf12b9f879392a0752fdee4938eaf2f37db8b5d Mon Sep 17 00:00:00 2001 From: michal Date: Mon, 31 Oct 2011 16:03:23 +0100 Subject: [PATCH 4/4] [#1327196] Popup window no longer available --- includes/ckeditor.popup.html | 3 ++- includes/ckeditor.utils.js | 16 ++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/includes/ckeditor.popup.html b/includes/ckeditor.popup.html index 7f402f7..c0d6265 100644 --- a/includes/ckeditor.popup.html +++ b/includes/ckeditor.popup.html @@ -88,7 +88,8 @@ function get_element_id(){ $("#" + textarea_id).val(text); }); } - CKEDITOR.replace(textarea_id, Drupal.settings.ckeditor.settings[textarea_id]); + Drupal.settings.ckeditor.settings[textarea_id].toolbar = eval(Drupal.settings.ckeditor.settings[textarea_id].toolbar); + CKEDITOR.replace(textarea_id, Drupal.settings.ckeditor.settings[textarea_id]); }); diff --git a/includes/ckeditor.utils.js b/includes/ckeditor.utils.js index 212b97b..d9cb088 100644 --- a/includes/ckeditor.utils.js +++ b/includes/ckeditor.utils.js @@ -353,12 +353,15 @@ Drupal.behaviors.ckeditor = function (context) { return; } - $.each(CKEDITOR.instances, function(index, value){ - if ($('#'+index).length == 0){ - delete CKEDITOR.instances[index]; - } - }); - + if (typeof CKEDITOR.instances != 'undefined') + { + $.each(CKEDITOR.instances, function(index, value){ + if ($('#'+index).length == 0) + { + delete CKEDITOR.instances[index]; + } + }); + } $('.ckeditor_links').show(); // make sure the textarea behavior is run first, to get a correctly sized grippie // the textarea behavior requires the teaser behavior, so load that one as well @@ -428,6 +431,7 @@ Drupal.behaviors.ckeditor = function (context) { data: {'id': views_textarea_id, 'url': 'admin/build/views'}, type: 'POST', success: function( data ) { + if ($(data).length > 0 && typeof CKEDITOR.instances[views_textarea_id] == 'undefined'){ Drupal.settings.ckeditor.settings[views_textarea_id] = data; Drupal.ckeditorOn(views_textarea_id); -- 1.7.4.msysgit.0