@@ -30,6 +30,7 @@ define([
30
30
// Parameters configured in the Modeler.
31
31
clsName : null ,
32
32
direction : null ,
33
+ transitionType : null ,
33
34
fixedPixelsTop : 0 ,
34
35
fixedPixelsBottom : 0 ,
35
36
@@ -89,19 +90,19 @@ define([
89
90
if ( typeof window . plugins !== "undefined" ) {
90
91
91
92
if ( typeof window . plugins . nativepagetransitions !== "undefined" ) {
92
- if ( this . direction === "fade" ) {
93
+ if ( this . transitionType === "fade" ) {
93
94
this . _listenerHandle = query ( "." + this . clsName ) . on ( "click" , lang . hitch ( this , function ( ) {
94
- window . plugins . nativepagetransitions . nextTransition = this . direction ;
95
+ window . plugins . nativepagetransitions . nextTransition = this . transitionType ;
95
96
window . plugins . nativepagetransitions . nextOptions = {
96
97
"duration" : this . duration , // in milliseconds (ms), default 400
97
98
"iosdelay" : - 1 , // ms to wait for the iOS webview to update before animation kicks in, default 60
98
99
"androiddelay" : - 1
99
100
} ;
100
101
} ) ) ;
101
- } else {
102
+ } else if ( this . transitionType === "slide" ) {
102
103
103
104
this . _listenerHandle = query ( "." + this . clsName ) . on ( "click" , lang . hitch ( this , function ( ) {
104
- window . plugins . nativepagetransitions . nextTransition = this . direction ;
105
+ window . plugins . nativepagetransitions . nextTransition = this . transitionType ;
105
106
window . plugins . nativepagetransitions . nextOptions = {
106
107
"direction" : this . direction , // "left|right|up|down", default "left" (which is like "next")
107
108
"duration" : this . duration , // in milliseconds (ms), default 400
@@ -113,6 +114,18 @@ define([
113
114
"fixedPixelsBottom" : this . fixedPixelsBottom // the number of pixels of your fixed footer (f.i. a tab bar), default 0 (iOS and Android)
114
115
} ;
115
116
} ) ) ;
117
+ } else if ( this . transitionType === "flip" ) {
118
+
119
+ this . _listenerHandle = query ( "." + this . clsName ) . on ( "click" , lang . hitch ( this , function ( ) {
120
+ window . plugins . nativepagetransitions . nextTransition = this . transitionType ;
121
+ window . plugins . nativepagetransitions . nextOptions = {
122
+ "direction" : this . direction , // "left|right|up|down", default "left" (which is like "next")
123
+ "duration" : this . duration , // in milliseconds (ms), default 400
124
+ "iosdelay" : - 1 , //defer transitions until they"re called later ////60, // ms to wait for the iOS webview to update before animation kicks in, default 60
125
+ "androiddelay" : - 1 , //defer transitions until they"re called later ////70 // same as above but for Android, default 70
126
+ "winphonedelay" : 200 , // same as above but for Windows Phone, default 200,
127
+ } ;
128
+ } ) ) ;
116
129
}
117
130
}
118
131
} else {
@@ -140,7 +153,7 @@ define([
140
153
alert ( "error: " + msg ) ;
141
154
} // called in case you pass in weird values
142
155
) ;
143
- } else {
156
+ } else if ( window . plugins . nativepagetransitions . nextTransition === "slide" ) {
144
157
window . plugins . nativepagetransitions . slide (
145
158
window . plugins . nativepagetransitions . nextOptions ,
146
159
function ( msg ) {
@@ -150,11 +163,21 @@ define([
150
163
alert ( "error: " + msg ) ;
151
164
} // called in case you pass in weird values
152
165
) ;
166
+ } else if ( window . plugins . nativepagetransitions . nextTransition === "flip" ) {
167
+ window . plugins . nativepagetransitions . flip (
168
+ window . plugins . nativepagetransitions . nextOptions ,
169
+ function ( msg ) {
170
+ //console.log("success: " + msg);
171
+ } , // called when the animation has finished
172
+ function ( msg ) {
173
+ alert ( "error: " + msg ) ;
174
+ } // called in case you pass in weird values
175
+ ) ;
153
176
}
154
177
window . plugins . nativepagetransitions . nextTransition = null ;
155
178
window . plugins . nativepagetransitions . nextOptions = null ;
156
179
//set a limit on how long we're going to keep the transition waiting, in case something breaks
157
- setTimeout ( this . _cancelTransition , 5000 ) ;
180
+ setTimeout ( this . _cancelTransition , 10000 ) ;
158
181
}
159
182
160
183
return deferred ;
0 commit comments