Skip to content

Commit 0cab89e

Browse files
committed
1.7.5
1 parent 9454fec commit 0cab89e

File tree

3 files changed

+45
-41
lines changed

3 files changed

+45
-41
lines changed

dist/index.js

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,15 @@ var Navigator = function (_React$Component) {
228228

229229
var fromPage = "" + this.historyPages[this.historyPages.length - 1] + "";
230230

231+
//סיום האפליקציה, סגור
232+
if (this.state.historyPages.length === 1 && goToPage === undefined) {
233+
console.log('"window.navigator.app.exitApp()"');
234+
// fthis.showSwalLater ?
235+
// fthis.myChildrens.swal.runSwal(true) :
236+
window.navigator.app.exitApp();
237+
return;
238+
}
239+
231240
var aniTime = 250;
232241

233242
if (this.props.children.filter(function (x) {
@@ -272,27 +281,20 @@ var Navigator = function (_React$Component) {
272281
if (goToPage !== fromPage) {
273282
//---ניהול חזרות----//
274283
this.busy = true;
275-
//סיום האפליקציה, סגור
276-
if (this.state.historyPages.length === 1 && goToPage === undefined) {
277-
console.log('"window.navigator.app.exitApp()"');
278-
// fthis.showSwalLater ?
279-
// fthis.myChildrens.swal.runSwal(true) :
280-
window.navigator.app.exitApp();
281-
} else {
282-
///שמור היסטוריה
283-
var new_historyPages = this.state.historyPages.slice();
284-
285-
if (this.listLevelPages[goToPage] <= this.listLevelPages[fromPage]) {
286-
//חוזרים אחורה, מחק את כל הדפים שהרמה שלהם גבוהה משלי.
287-
//new_historyPages.splice(new_historyPages.length - 1, 1);
288-
new_historyPages = new_historyPages.filter(function (x) {
289-
return _this3.listLevelPages[x] < _this3.listLevelPages[goToPage];
290-
});
291-
}
292-
new_historyPages.push(goToPage);
293-
//שמירת שינויים בהיסטוריה
294-
this.setState({ historyPages: new_historyPages });
284+
285+
///שמור היסטוריה
286+
var new_historyPages = this.state.historyPages.slice();
287+
288+
if (this.listLevelPages[goToPage] <= this.listLevelPages[fromPage]) {
289+
//חוזרים אחורה, מחק את כל הדפים שהרמה שלהם גבוהה משלי.
290+
//new_historyPages.splice(new_historyPages.length - 1, 1);
291+
new_historyPages = new_historyPages.filter(function (x) {
292+
return _this3.listLevelPages[x] < _this3.listLevelPages[goToPage];
293+
});
295294
}
295+
new_historyPages.push(goToPage);
296+
//שמירת שינויים בהיסטוריה
297+
this.setState({ historyPages: new_historyPages });
296298

297299
if (this.state.changeRoute) {
298300
window.location.href = window.location.href.substr(0, window.location.href.lastIndexOf("/") + 1) + "#" + (goToPage !== this.state.homePageKey ? goToPage : "");

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.7.4",
3+
"version": "1.7.5",
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: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,15 @@ export default class Navigator extends React.Component {
242242

243243
const fromPage = "" + this.historyPages[this.historyPages.length - 1] + "";
244244

245+
//סיום האפליקציה, סגור
246+
if (this.state.historyPages.length === 1 && goToPage === undefined) {
247+
console.log('"window.navigator.app.exitApp()"');
248+
// fthis.showSwalLater ?
249+
// fthis.myChildrens.swal.runSwal(true) :
250+
window.navigator.app.exitApp();
251+
return;
252+
}
253+
245254
let aniTime = 250;
246255

247256
if (
@@ -288,27 +297,20 @@ export default class Navigator extends React.Component {
288297
if (goToPage !== fromPage) {
289298
//---ניהול חזרות----//
290299
this.busy = true;
291-
//סיום האפליקציה, סגור
292-
if (this.state.historyPages.length === 1 && goToPage === undefined) {
293-
console.log('"window.navigator.app.exitApp()"');
294-
// fthis.showSwalLater ?
295-
// fthis.myChildrens.swal.runSwal(true) :
296-
window.navigator.app.exitApp();
297-
} else {
298-
///שמור היסטוריה
299-
let new_historyPages = this.state.historyPages.slice();
300-
301-
if (this.listLevelPages[goToPage] <= this.listLevelPages[fromPage]) {
302-
//חוזרים אחורה, מחק את כל הדפים שהרמה שלהם גבוהה משלי.
303-
//new_historyPages.splice(new_historyPages.length - 1, 1);
304-
new_historyPages = new_historyPages.filter(
305-
(x) => this.listLevelPages[x] < this.listLevelPages[goToPage]
306-
);
307-
}
308-
new_historyPages.push(goToPage);
309-
//שמירת שינויים בהיסטוריה
310-
this.setState({ historyPages: new_historyPages });
300+
301+
///שמור היסטוריה
302+
let new_historyPages = this.state.historyPages.slice();
303+
304+
if (this.listLevelPages[goToPage] <= this.listLevelPages[fromPage]) {
305+
//חוזרים אחורה, מחק את כל הדפים שהרמה שלהם גבוהה משלי.
306+
//new_historyPages.splice(new_historyPages.length - 1, 1);
307+
new_historyPages = new_historyPages.filter(
308+
(x) => this.listLevelPages[x] < this.listLevelPages[goToPage]
309+
);
311310
}
311+
new_historyPages.push(goToPage);
312+
//שמירת שינויים בהיסטוריה
313+
this.setState({ historyPages: new_historyPages });
312314

313315
if (this.state.changeRoute) {
314316
window.location.href =

0 commit comments

Comments
 (0)