@@ -66,12 +66,17 @@ var TouchMenuLA = function (options) {
66
66
} ) ;
67
67
} ;
68
68
69
+ TouchMenuLA . prototype . animateToPosition = function ( pos ) {
70
+ options . target . style . transform = 'translate3d(' + pos + 'px, 0, 0)' ;
71
+ options . target . style . WebkitTransform = 'translate3d(' + pos + 'px, 0, 0)' ;
72
+ options . target . style . MozTransform = 'translate3d(' + pos + 'px, 0, 0)' ;
73
+
74
+ } ;
75
+
69
76
TouchMenuLA . prototype . changeMenuPos = function ( ) {
70
77
if ( newPos <= options . width ) {
71
78
options . target . className = menuClassName + ' tmla-menu' ;
72
- options . target . style . transform = 'translate3d(' + newPos + 'px, 0, 0)' ;
73
- options . target . style . WebkitTransform = 'translate3d(' + newPos + 'px, 0, 0)' ;
74
- options . target . style . MozTransform = 'translate3d(' + newPos + 'px, 0, 0)' ;
79
+ this . animateToPosition ( newPos ) ;
75
80
76
81
if ( ! options . disableMask ) {
77
82
this . setMaskOpacity ( newPos ) ;
@@ -147,9 +152,7 @@ var TouchMenuLA = function (options) {
147
152
148
153
TouchMenuLA . prototype . open = function ( ) {
149
154
options . target . className = menuClassName + " tmla-menu opened" ;
150
- options . target . style . transform = 'translate3d(' + options . width + 'px, 0, 0)' ;
151
- options . target . style . WebkitTransform = 'translate3d(' + options . width + 'px, 0, 0)' ;
152
- options . target . style . MozTransform = 'translate3d(' + options . width + 'px, 0, 0)' ;
155
+ this . animateToPosition ( options . width ) ;
153
156
154
157
currentPos = options . width ;
155
158
this . isVisible = true ;
0 commit comments