[Bps-public-commit] rt-extension-ajaxpreviewscrips branch, master, updated. 0.03-6-gcdd34d3

Alex Vandiver alexmv at bestpractical.com
Mon Nov 24 15:03:05 EST 2014


The branch, master has been updated
       via  cdd34d3128357868ecb53668cb7035832e78931b (commit)
      from  4b140e2081dedcee671d7310de1fe6aa29f61df9 (commit)

Summary of changes:
 html/Callbacks/AjaxPreviewScrips/Ticket/Update.html/AfterForm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit cdd34d3128357868ecb53668cb7035832e78931b
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Nov 24 14:59:17 2014 -0500

    Ensure that preview is kept in sync with one-time-cc checkboxes
    
    Triggering updates based on the "change" trigger of the one-time-Cc
    checkboxes can lead to out-of-sync previews, as the checkboxes propagate
    into the textarea onclick, whereas the preview happens onchange.
    
    Move the preview hooks to only be on the textarea's change, and update
    the checkboxes to push a change event to the textbox after they update.
    This ensures that the checkboxes have applied their changes before any
    AJAX preview requests are made.

diff --git a/html/Callbacks/AjaxPreviewScrips/Ticket/Update.html/AfterForm b/html/Callbacks/AjaxPreviewScrips/Ticket/Update.html/AfterForm
index f1d317b..55487f4 100644
--- a/html/Callbacks/AjaxPreviewScrips/Ticket/Update.html/AfterForm
+++ b/html/Callbacks/AjaxPreviewScrips/Ticket/Update.html/AfterForm
@@ -34,8 +34,15 @@ jQuery( function() {
            }
        );
    };
+
+   var old_checkboxToInput = checkboxToInput;
+   checkboxToInput = function (target,checkbox,val) {
+       old_checkboxToInput(target, checkbox, val);
+       jQuery('#' + escapeCssSelector(target)).change();
+   };
+
    updateScrips();
    CKEDITOR.instances['UpdateContent'].on('blur', updateScrips );
-   jQuery("#ticket-update-metadata :input, input[name^=UpdateCc], input[name^=UpdateBcc]").change( updateScrips );
+   jQuery("#ticket-update-metadata :input, #UpdateCc, #UpdateBcc").change( updateScrips );
 });
 </script>

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


More information about the Bps-public-commit mailing list