Skip to content

Commit 221f038

Browse files
committed
Updates
1 parent f099e73 commit 221f038

File tree

2 files changed

+56
-50
lines changed

2 files changed

+56
-50
lines changed

js/hustle-ui.js

+55-49
Original file line numberDiff line numberDiff line change
@@ -6926,7 +6926,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
69266926
};
69276927
})(jQuery);
69286928
/**
6929-
* jQuery Timepicker
6929+
* jQuery Timepicker - v1.3.5 - 2016-07-10
69306930
* http://timepicker.co
69316931
*
69326932
* Enhances standard form input fields helping users to select (or type) times.
@@ -6972,18 +6972,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
69726972
widget.viewport = widget.ui.find('.ui-timepicker-viewport');
69736973

69746974
if (widget.container.length === 0) {
6975-
widget.container = $('<div></div>').addClass('hustle-timepicker').appendTo('body').removeClass('hustle-show');
6975+
widget.container = $('<div></div>').addClass('hustle-timepicker').addClass('ui-timepicker-hidden ui-helper-hidden').appendTo('body').removeClass('hustle-show');
69766976
widget.ui = $('<div></div>').addClass('ui-timepicker').addClass('ui-widget ui-widget-content ui-menu').appendTo(widget.container);
69776977
widget.viewport = $('<ul></ul>').addClass('ui-timepicker-viewport').appendTo(widget.ui);
69786978

69796979
if ($.fn.jquery >= '1.4.2') {
6980-
widget.ui.on('mouseenter.timepicker', 'a', function () {
6980+
widget.ui.delegate('a', 'mouseenter.timepicker', function () {
69816981
// passing false instead of an instance object tells the function
69826982
// to use the current instance
69836983
widget.activate(false, $(this).parent());
6984-
}).on('mouseleave.timepicker', 'a', function () {
6984+
}).delegate('a', 'mouseleave.timepicker', function () {
69856985
widget.deactivate(false);
6986-
}).on('click.timepicker', 'a', function (event) {
6986+
}).delegate('a', 'click.timepicker', function (event) {
69876987
event.preventDefault();
69886988
widget.select(false, $(this).parent());
69896989
});
@@ -6994,7 +6994,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
69946994
$.TimePicker.count = 0;
69956995

69966996
$.TimePicker.instance = function () {
6997-
$.TimePicker._instance = new $.TimePicker();
6997+
if (!$.TimePicker._instance) {
6998+
$.TimePicker._instance = new $.TimePicker();
6999+
}
7000+
69987001
return $.TimePicker._instance;
69997002
};
70007003

@@ -7190,7 +7193,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
71907193
},
71917194
_addInputEventsHandlers: function _addInputEventsHandlers(i) {
71927195
var widget = this;
7193-
i.element.on('keydown.timepicker', function (event) {
7196+
i.element.bind('keydown.timepicker', function (event) {
71947197
switch (event.which || event.keyCode) {
71957198
case widget.keyCode.ENTER:
71967199
case widget.keyCode.NUMPAD_ENTER:
@@ -7219,15 +7222,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
72197222

72207223
break;
72217224
}
7222-
}).on('focus.timepicker', function () {
7225+
}).bind('focus.timepicker', function () {
72237226
i.open();
7224-
}).on('blur.timepicker', function () {
7227+
}).bind('blur.timepicker', function () {
72257228
setTimeout(function () {
72267229
if (i.element.data('timepicker-user-clicked-outside')) {
72277230
i.close();
72287231
}
72297232
});
7230-
}).on('change.timepicker', function () {
7233+
}).bind('change.timepicker', function () {
72317234
if (i.closed()) {
72327235
i.setTime($.fn.timepicker.parseTime(i.element.val()));
72337236
}
@@ -7259,17 +7262,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
72597262
} else if (offset >= height) {
72607263
widget.ui.scrollTop(scroll + offset - height + item.height());
72617264
}
7262-
} //widget.active = item.eq(0).children('a').addClass('ui-state-hover').end();
7265+
}
72637266

7267+
widget.active = item.eq(0).children('a').addClass('ui-state-hover').attr('id', 'ui-active-item').end();
72647268
},
72657269
deactivate: function deactivate() {
72667270
var widget = this;
72677271

72687272
if (!widget.active) {
72697273
return;
7270-
} //widget.active.children('a').removeClass('ui-state-hover');
7271-
7274+
}
72727275

7276+
widget.active.children('a').removeClass('ui-state-hover').removeAttr('id');
72737277
widget.active = null;
72747278
},
72757279

@@ -7327,19 +7331,20 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
73277331
// idea from https://prototype.lighthouseapp.com/projects/8887/tickets/248-results-popup-from-ajaxautocompleter-disappear-when-user-clicks-on-scrollbars-in-ie6ie7
73287332

73297333

7330-
i.element.data('timepicker-event-namespace', Math.random()); // Append the timepicker within a relative div closer to the input.
7334+
i.element.data('timepicker-event-namespace', Math.random());
7335+
widget.container.insertAfter(i.element.closest('.hustle-layout'));
73317336

73327337
if (i.element.closest('.sui-form-field').length) {
73337338
i.element.closest('.sui-form-field').append(widget.container);
73347339
} else {
73357340
widget.container.insertAfter(i.element.closest('.hustle-layout'));
73367341
}
73377342

7338-
$(document).on('click.timepicker-' + i.element.data('timepicker-event-namespace'), function (event) {
7343+
$(document).bind('click.timepicker-' + i.element.data('timepicker-event-namespace'), function (event) {
73397344
if (i.element.get(0) === event.target) {
73407345
i.element.data('timepicker-user-clicked-outside', false);
73417346
} else {
7342-
i.element.data('timepicker-user-clicked-outside', true).blur();
7347+
widget.container.insertAfter(i.element.closest('.hustle-layout'));
73437348
}
73447349
}); // if a date is already selected and options.dynamic is true,
73457350
// arrange the items in the list so the first item is
@@ -7359,11 +7364,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
73597364
if ($.fn.jquery < '1.4.2') {
73607365
widget.viewport.children().remove();
73617366
widget.viewport.append(i.items);
7362-
widget.viewport.find('a').on('mouseover.timepicker', function () {
7367+
widget.viewport.find('a').bind('mouseover.timepicker', function () {
73637368
widget.activate(i, $(this).parent());
7364-
}).on('mouseout.timepicker', function () {
7369+
}).bind('mouseout.timepicker', function () {
73657370
widget.deactivate(i);
7366-
}).on('click.timepicker', function (event) {
7371+
}).bind('click.timepicker', function (event) {
73677372
event.preventDefault();
73687373
widget.select(i, $(this).parent());
73697374
});
@@ -7375,34 +7380,35 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
73757380

73767381
i.rebuild = false;
73777382
/**
7378-
* Theme Support
7379-
*
7380-
* @since Hustle UI 4.0
7381-
*/
7383+
* Theme Support
7384+
*
7385+
* @since Hustle UI 4.0
7386+
*/
73827387
// Remove standard theme classes
73837388

73847389
widget.container.removeClass('ui-timepicker-standard ui-timepicker-corners'); // Show time picker dropdown
73857390

73867391
widget.container.addClass('hustle-show');
73877392
$(document).trigger('hustle:module:displayed', widget);
7388-
/*
7389-
switch ( i.options.theme ) {
7390-
case 'standard' :
7391-
widget.container.addClass('ui-timepicker-standard');
7392-
break;
7393-
case 'standard-rounded-corners'
7394-
widget.container.addClass( 'ui-timepicker-standard ui-timepicker-corners' );
7395-
break;
7396-
default :
7397-
break;
7398-
}
7399-
*/
74007393

7394+
switch (i.options.theme) {
7395+
case 'standard':
7396+
widget.container.addClass('ui-timepicker-standard');
7397+
break;
7398+
7399+
case 'standard-rounded-corners':
7400+
widget.container.addClass('ui-timepicker-standard ui-timepicker-corners');
7401+
break;
7402+
7403+
default:
7404+
break;
7405+
}
74017406
/* resize ui */
74027407
// we are hiding the scrollbar in the dropdown menu adding a 40px
74037408
// padding to the wrapper element making the scrollbar appear in the
74047409
// part of the wrapper that's hidden by the container (a DIV).
74057410

7411+
74067412
if (!widget.container.hasClass('ui-timepicker-no-scrollbar') && !i.options.scrollbar) {
74077413
widget.container.addClass('ui-timepicker-no-scrollbar');
74087414
widget.viewport.css({
@@ -7413,8 +7419,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
74137419
var containerDecorationHeight = widget.container.outerHeight() - widget.container.height(),
74147420
zindex = i.options.zindex ? i.options.zindex : i.element.offsetParent().css('z-index'),
74157421
$field = i.element.closest('.hustle-field'),
7416-
elementOffset = $field.position(); //i.element.offset();
7417-
7422+
elementOffset = $field.position(),
7423+
//i.element.offset();
74187424
viewHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); // position the container right below the element, or as close to as possible.
74197425

74207426
widget.container.css({
@@ -7479,10 +7485,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
74797485

74807486
if (widget.instance === i) {
74817487
widget.container.removeClass('hustle-show');
7482-
widget.ui.scrollTop(0); //widget.ui.children().removeClass('ui-state-hover');
7488+
widget.ui.scrollTop(0); // widget.ui.children().removeClass('ui-state-hover');
74837489
}
74847490

7485-
$(document).off('click.timepicker-' + i.element.data('timepicker-event-namespace'));
7491+
$(document).unbind('click.timepicker-' + i.element.data('timepicker-event-namespace'));
74867492
return i.element;
74877493
},
74887494
closed: function closed() {
@@ -7491,7 +7497,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
74917497
destroy: function destroy(i) {
74927498
var widget = this;
74937499
widget.close(i, true);
7494-
return i.element.off('.timepicker').data('TimePicker', null);
7500+
return i.element.unbind('.timepicker').data('TimePicker', null);
74957501
},
74967502
//
74977503
parse: function parse(i, str) {
@@ -7550,7 +7556,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
75507556
if (previous !== null || i.selectedTime !== null) {
75517557
i.element.trigger('time-change', [time]);
75527558

7553-
if (typeof i.options.change === 'function') {
7559+
if ($.isFunction(i.options.change)) {
75547560
i.options.change.apply(i.element, [time]);
75557561
}
75567562
}
@@ -7598,7 +7604,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
75987604
startTime: null,
75997605
interval: 30,
76007606
dynamic: true,
7601-
theme: null,
7607+
theme: 'standard',
76027608
zindex: null,
76037609
dropdown: true,
76047610
scrollbar: false,
@@ -7701,13 +7707,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
77017707
* All non-digit characters are removed from the string before trying to
77027708
* parse the time.
77037709
*
7704-
* '' can't be converted and the function returns false.
7705-
* '1' is converted to 01:00:00 am
7706-
* '11' is converted to 11:00:00 am
7707-
* '111' is converted to 01:11:00 am
7708-
* '1111' is converted to 11:11:00 am
7709-
* '11111' is converted to 01:11:11 am
7710-
* '111111' is converted to 11:11:11 am
7710+
* '' can't be converted and the function returns false.
7711+
* '1' is converted to 01:00:00 am
7712+
* '11' is converted to 11:00:00 am
7713+
* '111' is converted to 01:11:00 am
7714+
* '1111' is converted to 11:11:00 am
7715+
* '11111' is converted to 01:11:11 am
7716+
* '111111' is converted to 11:11:11 am
77117717
*
77127718
* Only the first six (or less) characters are considered.
77137719
*

js/hustle-ui.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)