File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 6363 # tree {
6464 position : absolute;
6565 z-index : 999 ;
66- left : -300px ;
66+ left : 0 ;
67+ transform : translateX (-100% );
68+ transition : 1s transform;
69+ }
70+
71+ # tree .in {
72+ transform : translateX (0 );
6773 }
6874}
6975
Original file line number Diff line number Diff line change 11var show_list ;
2- var show_tree = false ;
32var sort_type = 'alphabetic' ;
43var multi_selection_enabled = false ;
54var selected = [ ] ;
@@ -137,23 +136,18 @@ $('#to-previous').click(function () {
137136} ) ;
138137
139138function toggleMobileTree ( should_display ) {
140- if ( should_display ) {
141- var position = '0px' ;
142- } else {
143- var position = '-' + $ ( '#tree' ) . width ( ) + 'px' ;
139+ if ( should_display === undefined ) {
140+ should_display = ! $ ( '#tree' ) . hasClass ( 'in' ) ;
144141 }
145-
146- $ ( '#tree' ) . animate ( { 'left' : position } , 1000 , 'easeOutExpo' , function ( ) {
147- show_tree = should_display ;
148- } ) ;
142+ $ ( '#tree' ) . toggleClass ( 'in' , should_display ) ;
149143}
150144
151145$ ( '#show_tree' ) . click ( function ( e ) {
152- toggleMobileTree ( ! show_tree ) ;
146+ toggleMobileTree ( ) ;
153147} ) ;
154148
155149$ ( '#main' ) . click ( function ( e ) {
156- if ( show_tree ) {
150+ if ( $ ( '#tree' ) . hasClass ( 'in' ) ) {
157151 toggleMobileTree ( false ) ;
158152 }
159153} ) ;
You can’t perform that action at this time.
0 commit comments