@@ -6926,7 +6926,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
6926
6926
} ;
6927
6927
} ) ( jQuery ) ;
6928
6928
/**
6929
- * jQuery Timepicker
6929
+ * jQuery Timepicker - v1.3.5 - 2016-07-10
6930
6930
* http://timepicker.co
6931
6931
*
6932
6932
* 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
6972
6972
widget . viewport = widget . ui . find ( '.ui-timepicker-viewport' ) ;
6973
6973
6974
6974
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' ) ;
6976
6976
widget . ui = $ ( '<div></div>' ) . addClass ( 'ui-timepicker' ) . addClass ( 'ui-widget ui-widget-content ui-menu' ) . appendTo ( widget . container ) ;
6977
6977
widget . viewport = $ ( '<ul></ul>' ) . addClass ( 'ui-timepicker-viewport' ) . appendTo ( widget . ui ) ;
6978
6978
6979
6979
if ( $ . fn . jquery >= '1.4.2' ) {
6980
- widget . ui . on ( 'mouseenter.timepicker ', 'a ' , function ( ) {
6980
+ widget . ui . delegate ( 'a ', 'mouseenter.timepicker ' , function ( ) {
6981
6981
// passing false instead of an instance object tells the function
6982
6982
// to use the current instance
6983
6983
widget . activate ( false , $ ( this ) . parent ( ) ) ;
6984
- } ) . on ( 'mouseleave.timepicker ', 'a ' , function ( ) {
6984
+ } ) . delegate ( 'a ', 'mouseleave.timepicker ' , function ( ) {
6985
6985
widget . deactivate ( false ) ;
6986
- } ) . on ( 'click.timepicker ', 'a ' , function ( event ) {
6986
+ } ) . delegate ( 'a ', 'click.timepicker ' , function ( event ) {
6987
6987
event . preventDefault ( ) ;
6988
6988
widget . select ( false , $ ( this ) . parent ( ) ) ;
6989
6989
} ) ;
@@ -6994,7 +6994,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
6994
6994
$ . TimePicker . count = 0 ;
6995
6995
6996
6996
$ . TimePicker . instance = function ( ) {
6997
- $ . TimePicker . _instance = new $ . TimePicker ( ) ;
6997
+ if ( ! $ . TimePicker . _instance ) {
6998
+ $ . TimePicker . _instance = new $ . TimePicker ( ) ;
6999
+ }
7000
+
6998
7001
return $ . TimePicker . _instance ;
6999
7002
} ;
7000
7003
@@ -7190,7 +7193,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
7190
7193
} ,
7191
7194
_addInputEventsHandlers : function _addInputEventsHandlers ( i ) {
7192
7195
var widget = this ;
7193
- i . element . on ( 'keydown.timepicker' , function ( event ) {
7196
+ i . element . bind ( 'keydown.timepicker' , function ( event ) {
7194
7197
switch ( event . which || event . keyCode ) {
7195
7198
case widget . keyCode . ENTER :
7196
7199
case widget . keyCode . NUMPAD_ENTER :
@@ -7219,15 +7222,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
7219
7222
7220
7223
break ;
7221
7224
}
7222
- } ) . on ( 'focus.timepicker' , function ( ) {
7225
+ } ) . bind ( 'focus.timepicker' , function ( ) {
7223
7226
i . open ( ) ;
7224
- } ) . on ( 'blur.timepicker' , function ( ) {
7227
+ } ) . bind ( 'blur.timepicker' , function ( ) {
7225
7228
setTimeout ( function ( ) {
7226
7229
if ( i . element . data ( 'timepicker-user-clicked-outside' ) ) {
7227
7230
i . close ( ) ;
7228
7231
}
7229
7232
} ) ;
7230
- } ) . on ( 'change.timepicker' , function ( ) {
7233
+ } ) . bind ( 'change.timepicker' , function ( ) {
7231
7234
if ( i . closed ( ) ) {
7232
7235
i . setTime ( $ . fn . timepicker . parseTime ( i . element . val ( ) ) ) ;
7233
7236
}
@@ -7259,17 +7262,18 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
7259
7262
} else if ( offset >= height ) {
7260
7263
widget . ui . scrollTop ( scroll + offset - height + item . height ( ) ) ;
7261
7264
}
7262
- } //widget.active = item.eq(0).children('a').addClass('ui-state-hover').end();
7265
+ }
7263
7266
7267
+ widget . active = item . eq ( 0 ) . children ( 'a' ) . addClass ( 'ui-state-hover' ) . attr ( 'id' , 'ui-active-item' ) . end ( ) ;
7264
7268
} ,
7265
7269
deactivate : function deactivate ( ) {
7266
7270
var widget = this ;
7267
7271
7268
7272
if ( ! widget . active ) {
7269
7273
return ;
7270
- } //widget.active.children('a').removeClass('ui-state-hover');
7271
-
7274
+ }
7272
7275
7276
+ widget . active . children ( 'a' ) . removeClass ( 'ui-state-hover' ) . removeAttr ( 'id' ) ;
7273
7277
widget . active = null ;
7274
7278
} ,
7275
7279
@@ -7327,19 +7331,20 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
7327
7331
// idea from https://prototype.lighthouseapp.com/projects/8887/tickets/248-results-popup-from-ajaxautocompleter-disappear-when-user-clicks-on-scrollbars-in-ie6ie7
7328
7332
7329
7333
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' ) ) ;
7331
7336
7332
7337
if ( i . element . closest ( '.sui-form-field' ) . length ) {
7333
7338
i . element . closest ( '.sui-form-field' ) . append ( widget . container ) ;
7334
7339
} else {
7335
7340
widget . container . insertAfter ( i . element . closest ( '.hustle-layout' ) ) ;
7336
7341
}
7337
7342
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 ) {
7339
7344
if ( i . element . get ( 0 ) === event . target ) {
7340
7345
i . element . data ( 'timepicker-user-clicked-outside' , false ) ;
7341
7346
} else {
7342
- i . element . data ( 'timepicker-user-clicked-outside' , true ) . blur ( ) ;
7347
+ widget . container . insertAfter ( i . element . closest ( '.hustle-layout' ) ) ;
7343
7348
}
7344
7349
} ) ; // if a date is already selected and options.dynamic is true,
7345
7350
// 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
7359
7364
if ( $ . fn . jquery < '1.4.2' ) {
7360
7365
widget . viewport . children ( ) . remove ( ) ;
7361
7366
widget . viewport . append ( i . items ) ;
7362
- widget . viewport . find ( 'a' ) . on ( 'mouseover.timepicker' , function ( ) {
7367
+ widget . viewport . find ( 'a' ) . bind ( 'mouseover.timepicker' , function ( ) {
7363
7368
widget . activate ( i , $ ( this ) . parent ( ) ) ;
7364
- } ) . on ( 'mouseout.timepicker' , function ( ) {
7369
+ } ) . bind ( 'mouseout.timepicker' , function ( ) {
7365
7370
widget . deactivate ( i ) ;
7366
- } ) . on ( 'click.timepicker' , function ( event ) {
7371
+ } ) . bind ( 'click.timepicker' , function ( event ) {
7367
7372
event . preventDefault ( ) ;
7368
7373
widget . select ( i , $ ( this ) . parent ( ) ) ;
7369
7374
} ) ;
@@ -7375,34 +7380,35 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
7375
7380
7376
7381
i . rebuild = false ;
7377
7382
/**
7378
- * Theme Support
7379
- *
7380
- * @since Hustle UI 4.0
7381
- */
7383
+ * Theme Support
7384
+ *
7385
+ * @since Hustle UI 4.0
7386
+ */
7382
7387
// Remove standard theme classes
7383
7388
7384
7389
widget . container . removeClass ( 'ui-timepicker-standard ui-timepicker-corners' ) ; // Show time picker dropdown
7385
7390
7386
7391
widget . container . addClass ( 'hustle-show' ) ;
7387
7392
$ ( 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
- */
7400
7393
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
+ }
7401
7406
/* resize ui */
7402
7407
// we are hiding the scrollbar in the dropdown menu adding a 40px
7403
7408
// padding to the wrapper element making the scrollbar appear in the
7404
7409
// part of the wrapper that's hidden by the container (a DIV).
7405
7410
7411
+
7406
7412
if ( ! widget . container . hasClass ( 'ui-timepicker-no-scrollbar' ) && ! i . options . scrollbar ) {
7407
7413
widget . container . addClass ( 'ui-timepicker-no-scrollbar' ) ;
7408
7414
widget . viewport . css ( {
@@ -7413,8 +7419,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
7413
7419
var containerDecorationHeight = widget . container . outerHeight ( ) - widget . container . height ( ) ,
7414
7420
zindex = i . options . zindex ? i . options . zindex : i . element . offsetParent ( ) . css ( 'z-index' ) ,
7415
7421
$field = i . element . closest ( '.hustle-field' ) ,
7416
- elementOffset = $field . position ( ) ; //i.element.offset();
7417
-
7422
+ elementOffset = $field . position ( ) ,
7423
+ //i.element.offset();
7418
7424
viewHeight = Math . max ( document . documentElement . clientHeight , window . innerHeight || 0 ) ; // position the container right below the element, or as close to as possible.
7419
7425
7420
7426
widget . container . css ( {
@@ -7479,10 +7485,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
7479
7485
7480
7486
if ( widget . instance === i ) {
7481
7487
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');
7483
7489
}
7484
7490
7485
- $ ( document ) . off ( 'click.timepicker-' + i . element . data ( 'timepicker-event-namespace' ) ) ;
7491
+ $ ( document ) . unbind ( 'click.timepicker-' + i . element . data ( 'timepicker-event-namespace' ) ) ;
7486
7492
return i . element ;
7487
7493
} ,
7488
7494
closed : function closed ( ) {
@@ -7491,7 +7497,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
7491
7497
destroy : function destroy ( i ) {
7492
7498
var widget = this ;
7493
7499
widget . close ( i , true ) ;
7494
- return i . element . off ( '.timepicker' ) . data ( 'TimePicker' , null ) ;
7500
+ return i . element . unbind ( '.timepicker' ) . data ( 'TimePicker' , null ) ;
7495
7501
} ,
7496
7502
//
7497
7503
parse : function parse ( i , str ) {
@@ -7550,7 +7556,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
7550
7556
if ( previous !== null || i . selectedTime !== null ) {
7551
7557
i . element . trigger ( 'time-change' , [ time ] ) ;
7552
7558
7553
- if ( typeof i . options . change === 'function' ) {
7559
+ if ( $ . isFunction ( i . options . change ) ) {
7554
7560
i . options . change . apply ( i . element , [ time ] ) ;
7555
7561
}
7556
7562
}
@@ -7598,7 +7604,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
7598
7604
startTime : null ,
7599
7605
interval : 30 ,
7600
7606
dynamic : true ,
7601
- theme : null ,
7607
+ theme : 'standard' ,
7602
7608
zindex : null ,
7603
7609
dropdown : true ,
7604
7610
scrollbar : false ,
@@ -7701,13 +7707,13 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
7701
7707
* All non-digit characters are removed from the string before trying to
7702
7708
* parse the time.
7703
7709
*
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
7711
7717
*
7712
7718
* Only the first six (or less) characters are considered.
7713
7719
*
0 commit comments