[Rt-commit] rt branch, 4.0/datetimepicker-ui, updated. rt-4.0.2-115-g1b2787b

Alex Vandiver alexmv at bestpractical.com
Fri Jun 22 01:35:43 EDT 2012


The branch, 4.0/datetimepicker-ui has been updated
       via  1b2787b1bb87897eb1e93f817eb8581a1850ce8f (commit)
      from  d5c04c62e57ba7a8c6eedcfdcc691677bf129b85 (commit)

Summary of changes:
 etc/RT_Config.pm.in                                |    2 +-
 share/html/NoAuth/js/jquery-ui-patch-datepicker.js |   12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit 1b2787b1bb87897eb1e93f817eb8581a1850ce8f
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Jun 21 16:46:59 2012 -0400

    Patch timepicker to not force the textbox to update on click-away
    
    Hotpatch the timepicker to remove the part of the onClose method which
    forces an unnecessary update from the timepicker.  This allows the user
    to type "tomorrow" into the textarea, and have it accepted when the user
    clicks clicks away and the datetime picker closes.  This is particularly
    important given that the accepted way to remove a due date is to enter
    "0" or " " into the input.

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 59bd64a..79b1249 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -866,8 +866,8 @@ Set(@JSFiles, qw/
     jquery-1.4.2.min.js
     jquery_noconflict.js
     jquery-ui-1.8.4.custom.min.js
-    jquery-ui-patch-datepicker.js
     jquery-ui-timepicker-addon.js
+    jquery-ui-patch-datepicker.js
     titlebox-state.js
     util.js
     userautocomplete.js
diff --git a/share/html/NoAuth/js/jquery-ui-patch-datepicker.js b/share/html/NoAuth/js/jquery-ui-patch-datepicker.js
index 38d537a..c6497b2 100644
--- a/share/html/NoAuth/js/jquery-ui-patch-datepicker.js
+++ b/share/html/NoAuth/js/jquery-ui-patch-datepicker.js
@@ -77,4 +77,16 @@
 
         return offset;
     };
+
+
+    $.timepicker._newInst_orig = $.timepicker._newInst;
+    $.timepicker._newInst = function($input, o) {
+        var tp_inst = $.timepicker._newInst_orig($input, o);
+        tp_inst._defaults.onClose = function(dateText, dp_inst) {
+	    if ($.isFunction(o.onClose))
+		o.onClose.call($input[0], dateText, dp_inst, tp_inst);
+        };
+        return tp_inst;
+    };
+
 })(jQuery);

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


More information about the Rt-commit mailing list