Skip to content

Commit a5e93a0

Browse files
committed
Merge pull request #2518 from dkarzon/windows
fix(windows8.1): touch scrolling
2 parents 99046fb + dd66b7b commit a5e93a0

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed

js/angular/controller/scrollController.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,10 @@ function($scope, scrollViewOptions, $timeout, $window, $location, $document, $io
6767

6868
$scope.$on('$destroy', function() {
6969
deregisterInstance();
70-
scrollView.__cleanup();
70+
//Windows: make sure the scrollView.__cleanup exists before calling it
71+
if (scrollView.__cleanup) {
72+
scrollView.__cleanup();
73+
}
7174
ionic.off('resize', resize, $window);
7275
$window.removeEventListener('resize', resize);
7376
scrollViewOptions = null;

js/angular/service/viewService.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +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+
// always reset the keyboard state when change stage
13+
$rootScope.$on('$stateChangeStart', function(){
14+
//Windows: no hide method available
15+
if (ionic.keyboard.hide) {
16+
ionic.keyboard.hide();
17+
}
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+
}
1242
warn('', '');
1343

1444
var methodsMap = {

release/js/ionic-angular.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6559,7 +6559,10 @@ function($scope, scrollViewOptions, $timeout, $window, $location, $document, $io
65596559

65606560
$scope.$on('$destroy', function() {
65616561
deregisterInstance();
6562-
scrollView.__cleanup();
6562+
//Windows: make sure the scrollView.__cleanup exists before calling it
6563+
if (scrollView.__cleanup) {
6564+
scrollView.__cleanup();
6565+
}
65636566
ionic.off('resize', resize, $window);
65646567
$window.removeEventListener('resize', resize);
65656568
scrollViewOptions = null;

scss/_scaffolding.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ body,
4141
text-rendering: optimizeLegibility;
4242
-webkit-backface-visibility: hidden;
4343
-webkit-user-drag: none;
44+
-ms-content-zooming: none;
4445
}
4546

4647
body.grade-b,

0 commit comments

Comments
 (0)