Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix #44 add the destroy method. $('#inputId').timepicker('destroy');

  • Loading branch information...
commit 0022bdb57f4b22a260f1526888afc5bd67ddc982 1 parent 398b8d5
@fgelinas authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 jquery.ui.timepicker.js
View
20 jquery.ui.timepicker.js
@@ -809,6 +809,26 @@
},
+ /* Detach a timepicker from its control.
+ @param target element - the target input field or division or span */
+ _destroyTimepicker: function(target) {
+ var $target = $(target);
+ var inst = $.data(target, PROP_NAME);
+ if (!$target.hasClass(this.markerClassName)) {
+ return;
+ }
+ var nodeName = target.nodeName.toLowerCase();
+ $.removeData(target, PROP_NAME);
+ if (nodeName == 'input') {
+ inst.append.remove();
+ inst.trigger.remove();
+ $target.removeClass(this.markerClassName)
+ .unbind('focus.timepicker', this._showTimepicker)
+ .unbind('click.timepicker', this._adjustZIndex);
+ } else if (nodeName == 'div' || nodeName == 'span')
+ $target.removeClass(this.markerClassName).empty();
+ },
+
/* Enable the date picker to a jQuery selection.
@param target element - the target input field or division or span */
_enableTimepicker: function(target) {
Please sign in to comment.
Something went wrong with that request. Please try again.