Skip to content

Commit dd66b7b

Browse files
committed
Merge branch 'windows' of https://github.com/dkarzon/ionic into windows
Conflicts: js/angular/service/viewService.js
2 parents 8b4b800 + 6a5fdd0 commit dd66b7b

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

js/angular/service/viewService.js

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,36 @@ IonicModule
99
$log.warn('$ionicViewService' + oldMethod + ' is deprecated, please use $ionicHistory' + newMethod + ' instead: http://ionicframework.com/docs/nightly/api/service/$ionicHistory/');
1010
}
1111

12-
//Windows: no hide method available
12+
// always reset the keyboard state when change stage
13+
$rootScope.$on('$stateChangeStart', function(){
14+
//Windows: no hide method available
1315
if (ionic.keyboard.hide) {
1416
ionic.keyboard.hide();
1517
}
18+
});
19+
20+
$rootScope.$on('viewState.changeHistory', function(e, data) {
21+
if(!data) return;
22+
23+
var hist = (data.historyId ? $rootScope.$viewHistory.histories[ data.historyId ] : null );
24+
if(hist && hist.cursor > -1 && hist.cursor < hist.stack.length) {
25+
// the history they're going to already exists
26+
// go to it's last view in its stack
27+
var view = hist.stack[ hist.cursor ];
28+
return view.go(data);
29+
}
30+
31+
// this history does not have a URL, but it does have a uiSref
32+
// figure out its URL from the uiSref
33+
if(!data.url && data.uiSref) {
34+
data.url = $state.href(data.uiSref);
35+
}
36+
37+
if(data.url) {
38+
// don't let it start with a #, messes with $location.url()
39+
if(data.url.indexOf('#') === 0) {
40+
data.url = data.url.replace('#', '');
41+
}
1642
warn('', '');
1743

1844
var methodsMap = {

0 commit comments

Comments
 (0)