From 57f168baa09a80ec6c408f7783cbec8357323ae8 Mon Sep 17 00:00:00 2001 From: Daniel Ma Date: Fri, 24 Oct 2014 13:48:43 -0700 Subject: [PATCH] Add ability to toggle datetimepicker --- jquery.datetimepicker.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jquery.datetimepicker.js b/jquery.datetimepicker.js index 68df804..4c3f6f8 100644 --- a/jquery.datetimepicker.js +++ b/jquery.datetimepicker.js @@ -1484,6 +1484,9 @@ } event.stopPropagation(); }) + .on('toggle.xdsoft', function (event) { + datetimepicker.is(':visible') ? datetimepicker.trigger('close.xdsoft') : datetimepicker.trigger('open.xdsoft'); + }) .data('input', input); timer = 0; @@ -1595,6 +1598,9 @@ case 'hide': datetimepicker.trigger('close.xdsoft'); break; + case 'toggle': + datetimepicker.trigger('toggle.xdsoft'); + break; case 'destroy': destroyDateTimePicker($(this)); break;