[Bps-public-commit] rt-extension-ajaxpreviewscrips branch, master, updated. 0.06-1-g57f1ffe

Alex Vandiver alexmv at bestpractical.com
Mon Mar 30 19:22:47 EDT 2015


The branch, master has been updated
       via  57f1ffe674f9ec54336b58ed7f662c07fed0de1c (commit)
      from  346b52fd82d5f1da1c2759d418c81a627b444c97 (commit)

Summary of changes:
 html/Callbacks/AjaxPreviewScrips/Ticket/Update.html/AfterForm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 57f1ffe674f9ec54336b58ed7f662c07fed0de1c
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Mar 30 16:07:45 2015 -0400

    Check the data structure; CKEditor can fail to instantiate
    
    Instead of checking the conditions that trigger CKEditor to be enabled,
    instead check against the data structure itself; CKEditor can decline to
    enable itself if it does not recognize the User-Agent provided by the
    browser, leaving the textarea with the "richtext" class, but no
    CKEDITOR.instances set up.

diff --git a/html/Callbacks/AjaxPreviewScrips/Ticket/Update.html/AfterForm b/html/Callbacks/AjaxPreviewScrips/Ticket/Update.html/AfterForm
index 34610ab..6e5ba96 100644
--- a/html/Callbacks/AjaxPreviewScrips/Ticket/Update.html/AfterForm
+++ b/html/Callbacks/AjaxPreviewScrips/Ticket/Update.html/AfterForm
@@ -8,7 +8,7 @@ return unless $Ticket->CurrentUserHasRight('ShowOutgoingEmail')
 <script type="text/javascript">
 jQuery( function() {
    var updateScrips = function() {
-       if (jQuery('#UpdateContent').hasClass("richtext")) {
+       if (CKEDITOR.instances && CKEDITOR.instances['UpdateContent']) {
            CKEDITOR.instances['UpdateContent'].updateElement();
        }
        var syncCheckboxes = function(ev) {
@@ -44,7 +44,7 @@ jQuery( function() {
    };
 
    updateScrips();
-   if (jQuery('#UpdateContent').hasClass("richtext")) {
+   if (CKEDITOR.instances && CKEDITOR.instances['UpdateContent']) {
        CKEDITOR.instances['UpdateContent'].on('blur', updateScrips );
    }
    jQuery("#ticket-update-metadata :input, #UpdateCc, #UpdateBcc").change( updateScrips );

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list