@@ -83,12 +83,6 @@ $.fn.sidebar = function(parameters) {
83
83
84
84
transitionEvent = module . get . transitionEvent ( ) ;
85
85
86
- // cache on initialize
87
- if ( ( settings . useLegacy == 'auto' && module . is . legacy ( ) ) || settings . useLegacy === true ) {
88
- settings . transition = 'overlay' ;
89
- settings . useLegacy = true ;
90
- }
91
-
92
86
if ( module . is . ios ( ) ) {
93
87
module . set . ios ( ) ;
94
88
}
@@ -368,11 +362,6 @@ $.fn.sidebar = function(parameters) {
368
362
} ,
369
363
370
364
show : function ( callback ) {
371
- var
372
- animateMethod = ( settings . useLegacy === true )
373
- ? module . legacyPushPage
374
- : module . pushPage
375
- ;
376
365
callback = $ . isFunction ( callback )
377
366
? callback
378
367
: function ( ) { }
@@ -400,7 +389,7 @@ $.fn.sidebar = function(parameters) {
400
389
settings . transition = 'overlay' ;
401
390
}
402
391
}
403
- animateMethod ( function ( ) {
392
+ module . pushPage ( function ( ) {
404
393
callback . call ( element ) ;
405
394
settings . onShow . call ( element ) ;
406
395
} ) ;
@@ -413,19 +402,14 @@ $.fn.sidebar = function(parameters) {
413
402
} ,
414
403
415
404
hide : function ( callback ) {
416
- var
417
- animateMethod = ( settings . useLegacy === true )
418
- ? module . legacyPullPage
419
- : module . pullPage
420
- ;
421
405
callback = $ . isFunction ( callback )
422
406
? callback
423
407
: function ( ) { }
424
408
;
425
409
if ( module . is . visible ( ) || module . is . animating ( ) ) {
426
410
module . debug ( 'Hiding sidebar' , callback ) ;
427
411
module . refreshSidebars ( ) ;
428
- animateMethod ( function ( ) {
412
+ module . pullPage ( function ( ) {
429
413
callback . call ( element ) ;
430
414
settings . onHidden . call ( element ) ;
431
415
} ) ;
@@ -474,11 +458,9 @@ $.fn.sidebar = function(parameters) {
474
458
pushPage : function ( callback ) {
475
459
var
476
460
transition = module . get . transition ( ) ,
477
- $transition = ( transition == 'safe' )
478
- ? $context
479
- : ( transition === 'overlay' || module . othersActive ( ) )
480
- ? $module
481
- : $pusher ,
461
+ $transition = ( transition === 'overlay' || module . othersActive ( ) )
462
+ ? $module
463
+ : $pusher ,
482
464
animate ,
483
465
dim ,
484
466
transitionEnd
@@ -520,11 +502,9 @@ $.fn.sidebar = function(parameters) {
520
502
pullPage : function ( callback ) {
521
503
var
522
504
transition = module . get . transition ( ) ,
523
- $transition = ( transition == 'safe' )
524
- ? $context
525
- : ( transition == 'overlay' || module . othersActive ( ) )
526
- ? $module
527
- : $pusher ,
505
+ $transition = ( transition == 'overlay' || module . othersActive ( ) )
506
+ ? $module
507
+ : $pusher ,
528
508
animate ,
529
509
transitionEnd
530
510
;
@@ -562,62 +542,6 @@ $.fn.sidebar = function(parameters) {
562
542
requestAnimationFrame ( animate ) ;
563
543
} ,
564
544
565
- legacyPushPage : function ( callback ) {
566
- var
567
- distance = $module . width ( ) ,
568
- direction = module . get . direction ( ) ,
569
- properties = { }
570
- ;
571
- distance = distance || $module . width ( ) ;
572
- callback = $ . isFunction ( callback )
573
- ? callback
574
- : function ( ) { }
575
- ;
576
- properties [ direction ] = distance ;
577
- module . debug ( 'Using javascript to push context' , properties ) ;
578
- module . set . visible ( ) ;
579
- module . set . transition ( ) ;
580
- module . set . animating ( ) ;
581
- if ( settings . dimPage ) {
582
- $pusher . addClass ( className . dimmed ) ;
583
- }
584
- $context
585
- . css ( 'position' , 'relative' )
586
- . animate ( properties , settings . duration , settings . easing , function ( ) {
587
- module . remove . animating ( ) ;
588
- module . bind . clickaway ( ) ;
589
- callback . call ( element ) ;
590
- } )
591
- ;
592
- } ,
593
- legacyPullPage : function ( callback ) {
594
- var
595
- distance = 0 ,
596
- direction = module . get . direction ( ) ,
597
- properties = { }
598
- ;
599
- distance = distance || $module . width ( ) ;
600
- callback = $ . isFunction ( callback )
601
- ? callback
602
- : function ( ) { }
603
- ;
604
- properties [ direction ] = '0px' ;
605
- module . debug ( 'Using javascript to pull context' , properties ) ;
606
- module . unbind . clickaway ( ) ;
607
- module . set . animating ( ) ;
608
- module . remove . visible ( ) ;
609
- if ( settings . dimPage && ! module . othersActive ( ) ) {
610
- $pusher . removeClass ( className . dimmed ) ;
611
- }
612
- $context
613
- . css ( 'position' , 'relative' )
614
- . animate ( properties , settings . duration , settings . easing , function ( ) {
615
- module . remove . animating ( ) ;
616
- callback . call ( element ) ;
617
- } )
618
- ;
619
- } ,
620
-
621
545
scrollToTop : function ( ) {
622
546
module . verbose ( 'Scrolling to top of page to avoid animation issues' ) ;
623
547
currentScroll = $ ( window ) . scrollTop ( ) ;
@@ -782,30 +706,6 @@ $.fn.sidebar = function(parameters) {
782
706
return ( isIE11 || isIE ) ;
783
707
} ,
784
708
785
- legacy : function ( ) {
786
- var
787
- element = document . createElement ( 'div' ) ,
788
- transforms = {
789
- 'webkitTransform' :'-webkit-transform' ,
790
- 'OTransform' :'-o-transform' ,
791
- 'msTransform' :'-ms-transform' ,
792
- 'MozTransform' :'-moz-transform' ,
793
- 'transform' :'transform'
794
- } ,
795
- has3D
796
- ;
797
-
798
- // Add it to the body to get the computed style.
799
- document . body . insertBefore ( element , null ) ;
800
- for ( var transform in transforms ) {
801
- if ( element . style [ transform ] !== undefined ) {
802
- element . style [ transform ] = "translate3d(1px,1px,1px)" ;
803
- has3D = window . getComputedStyle ( element ) . getPropertyValue ( transforms [ transform ] ) ;
804
- }
805
- }
806
- document . body . removeChild ( element ) ;
807
- return ! ( has3D !== undefined && has3D . length > 0 && has3D !== 'none' ) ;
808
- } ,
809
709
ios : function ( ) {
810
710
var
811
711
userAgent = navigator . userAgent ,
@@ -1073,9 +973,7 @@ $.fn.sidebar.settings = {
1073
973
returnScroll : false ,
1074
974
delaySetup : false ,
1075
975
1076
- useLegacy : false ,
1077
976
duration : 500 ,
1078
- easing : 'easeInOutQuint' ,
1079
977
1080
978
onChange : function ( ) { } ,
1081
979
onShow : function ( ) { } ,
@@ -1121,13 +1019,5 @@ $.fn.sidebar.settings = {
1121
1019
1122
1020
} ;
1123
1021
1124
- // Adds easing
1125
- $ . extend ( $ . easing , {
1126
- easeInOutQuint : function ( x , t , b , c , d ) {
1127
- if ( ( t /= d / 2 ) < 1 ) return c / 2 * t * t * t * t * t + b ;
1128
- return c / 2 * ( ( t -= 2 ) * t * t * t * t + 2 ) + b ;
1129
- }
1130
- } ) ;
1131
-
1132
1022
1133
1023
} ) ( jQuery , window , document ) ;
0 commit comments