Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow user to empty the input

fixes #83
  • Loading branch information...
commit 41cc352f72a5b2bb8305c3a05ebdfb816d687f89 1 parent f60d78c
@jdewit authored
Showing with 10 additions and 1 deletion.
  1. +5 −1 js/bootstrap-timepicker.js
  2. +5 −0 spec/js/KeyboardEventsSpec.js
View
6 js/bootstrap-timepicker.js
@@ -708,7 +708,11 @@
},
updateFromElementVal: function() {
- this.setTime(this.$element.val());
+ var val = this.$element.val();
+
+ if (val) {
+ this.setTime(val);
+ }
},
updateWidget: function() {
View
5 spec/js/KeyboardEventsSpec.js
@@ -192,6 +192,11 @@ describe('Keyboard events feature', function() {
expect(time).toBe('11:45 PM');
});
+ it('should still be empty if input is empty', function() {
+ $input1.autotype('{{back}}{{back}}{{back}}{{back}}{{back}}{{back}}{{back}}{{back}}{{tab}}');
+
+ expect($input1.val()).toBe('');
+ });
it('should allow time to be changed via widget inputs in a modal', function() {
//tp2.setTime('9:30 AM');
//tp2.update();
Please sign in to comment.
Something went wrong with that request. Please try again.