Skip to content

Commit a3eccb4

Browse files
committed
1.7.0
1 parent e4754fa commit a3eccb4

File tree

4 files changed

+35
-8
lines changed

4 files changed

+35
-8
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ In the render function return
1919
<AboutPage key="about"
2020
levelPage={1}
2121
transitionIn={
22-
animatioPageIn:"fadeIn"
23-
,animatioPageOut:"fadeOut"
22+
animatioPageIn:"fadeInRight"
23+
,animatioPageOut:"fadeOutRight"
2424
}
25-
transitionOut={{
26-
animatioPageOut: "fadeOut"
25+
transitionOut={{
26+
animatioPageOut: "fadeOutRight"
2727
}}
2828
/>
2929
@@ -169,7 +169,9 @@ options = { animatioPageIn:"fadeInLeft" // have defult
169169
</tr>
170170
<tr>
171171
<td>transitionIn</td>
172-
<td>json</td>
172+
<td>json:{ animatioPageIn:string
173+
,animatioPageOut:string
174+
,animationTimeInMS:integer}</td>
173175
<td>optional</td>
174176
<td>-</td>
175177
<td></td>

dist/index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,19 @@ var Navigator = function (_React$Component) {
212212

213213
var fromPage = "" + this.historyPages[this.historyPages.length - 1] + "";
214214

215+
var aniTime = 250;
216+
if (this.props.children.filter(function (x) {
217+
return x.key === goToPage;
218+
}).length > 0) {
219+
if (this.props.children.filter(function (x) {
220+
return x.key === goToPage;
221+
})[0].props.animationTimeInMS) aniTime = this.props.children.filter(function (x) {
222+
return x.key === goToPage;
223+
})[0].props.animationTimeInMS;
224+
} else {
225+
if (this.props.animationTimeInMS) aniTime = this.props.animationTimeInMS;
226+
}
227+
215228
options = options === undefined ? [] : options;
216229

217230
var _options = options,
@@ -220,7 +233,7 @@ var Navigator = function (_React$Component) {
220233
_options$animationIn = _options.animationIn,
221234
animationIn = _options$animationIn === undefined ? this.componentTransitionIn[goToPage] ? this.componentTransitionIn[goToPage].animatioPageIn ? this.componentTransitionIn[goToPage].animatioPageIn : null : null : _options$animationIn,
222235
_options$timeAnimatio = _options.timeAnimationInMS,
223-
timeAnimationInMS = _options$timeAnimatio === undefined ? 250 : _options$timeAnimatio,
236+
timeAnimationInMS = _options$timeAnimatio === undefined ? aniTime : _options$timeAnimatio,
224237
_options$animationOut = _options.animationOut,
225238
animationOut = _options$animationOut === undefined ? this.swipeRight ? "slideOutRight" : this.componentTransitionOut[fromPage] ? this.componentTransitionOut[fromPage].animatioPageOut ? this.componentTransitionOut[fromPage].animatioPageOut : null : null : _options$animationOut,
226239
_options$callbackFun = _options.callbackFun,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react.cordova-navigation_controller",
3-
"version": "1.6.9",
3+
"version": "1.7.0",
44
"description": "Navigator for Cordova with React.js(react.cordova), This will help you to manage your pages history in the app and change pages with animation.",
55
"main": "dist/index.js",
66
"scripts": {

src/index.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,18 @@ export default class Navigator extends React.Component {
230230

231231
const fromPage = "" + this.historyPages[this.historyPages.length - 1] + "";
232232

233+
let aniTime = 250;
234+
if (this.props.children.filter((x) => x.key === goToPage).length > 0) {
235+
if (
236+
this.props.children.filter((x) => x.key === goToPage)[0].props
237+
.animationTimeInMS
238+
)
239+
aniTime = this.props.children.filter((x) => x.key === goToPage)[0].props
240+
.animationTimeInMS;
241+
} else {
242+
if (this.props.animationTimeInMS) aniTime = this.props.animationTimeInMS;
243+
}
244+
233245
options = options === undefined ? [] : options;
234246

235247
const {
@@ -239,7 +251,7 @@ export default class Navigator extends React.Component {
239251
? this.componentTransitionIn[goToPage].animatioPageIn
240252
: null
241253
: null,
242-
timeAnimationInMS = 250,
254+
timeAnimationInMS = aniTime,
243255
animationOut = this.swipeRight
244256
? "slideOutRight"
245257
: this.componentTransitionOut[fromPage]

0 commit comments

Comments
 (0)