Skip to content

Commit 4e4ba22

Browse files
committed
fixed tab alignment
1 parent 0275418 commit 4e4ba22

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

dist/ion-pullup.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ angular.module('ionic-pullup', [])
190190
}
191191
}
192192
}])
193-
.directive('ionPullUpHandle', ['$ionicGesture', function($ionicGesture) {
193+
.directive('ionPullUpHandle', ['$ionicGesture', '$timeout', function($ionicGesture, $timeout) {
194194
return {
195195
restrict: 'AE',
196196
require: '^ionPullUpFooter',
@@ -206,7 +206,7 @@ angular.module('ionic-pullup', [])
206206
background: background,
207207
position: 'absolute',
208208
top: 1-height + 'px',
209-
left: ((screen.width - width) / 2) + 'px',
209+
left: ((window.innerWidth - width) / 2) + 'px',
210210
height: height + 'px',
211211
width: width + 'px',
212212
//margin: '0 auto',
@@ -222,7 +222,9 @@ angular.module('ionic-pullup', [])
222222
});
223223

224224
window.addEventListener('orientationchange', function() {
225-
element.css('left', ((screen.width - width) / 2) + 'px');
225+
$timeout(function() {
226+
element.css('left', ((window.innerWidth - width) / 2) + 'px');
227+
}, 500);
226228
});
227229
}
228230
}

example/www/js/ion-pullup.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ angular.module('ionic-pullup', [])
190190
}
191191
}
192192
}])
193-
.directive('ionPullUpHandle', ['$ionicGesture', function($ionicGesture) {
193+
.directive('ionPullUpHandle', ['$ionicGesture', '$timeout', function($ionicGesture, $timeout) {
194194
return {
195195
restrict: 'AE',
196196
require: '^ionPullUpFooter',
@@ -206,7 +206,7 @@ angular.module('ionic-pullup', [])
206206
background: background,
207207
position: 'absolute',
208208
top: 1-height + 'px',
209-
left: ((screen.width - width) / 2) + 'px',
209+
left: ((window.innerWidth - width) / 2) + 'px',
210210
height: height + 'px',
211211
width: width + 'px',
212212
//margin: '0 auto',
@@ -222,7 +222,9 @@ angular.module('ionic-pullup', [])
222222
});
223223

224224
window.addEventListener('orientationchange', function() {
225-
element.css('left', ((screen.width - width) / 2) + 'px');
225+
$timeout(function() {
226+
element.css('left', ((window.innerWidth - width) / 2) + 'px');
227+
}, 500);
226228
});
227229
}
228230
}

0 commit comments

Comments
 (0)