Fixed #461 - PTR Android

This commit is contained in:
Max Lynch
2014-01-23 09:11:40 -06:00
parent 050870e5f4
commit 790c97a428
7 changed files with 19 additions and 6 deletions

View File

@@ -90,6 +90,10 @@ angular.module('ionic.ui.service.scrollDelegate', [])
}, element[0]);
},
finishRefreshing: function($scope) {
$scope.$broadcast('scroll.refreshComplete');
},
/**
* Attempt to get the current scroll view in scope (if any)
*

View File

File diff suppressed because one or more lines are too long

2
dist/js/ionic.js vendored
View File

@@ -3667,7 +3667,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
if (scrollTop > maxScrollTop || scrollTop < 0) {
// Slow down on the edges
if (self.options.bouncing) {
if (self.options.bouncing || (self.__refreshHeight && scrollTop < 0)) {
scrollTop += (moveY / 2 * this.options.speedMultiplier);

View File

File diff suppressed because one or more lines are too long

View File

@@ -30,6 +30,10 @@ angular.module('ionic.ui.service.scrollDelegate', [])
}, element[0]);
},
finishRefreshing: function($scope) {
$scope.$broadcast('scroll.refreshComplete');
},
/**
* Attempt to get the current scroll view in scope (if any)
*

View File

@@ -70,11 +70,11 @@
on-scroll-complete="onScrollComplete(scrollTop, scrollLeft)"
on-refresh="onRefresh()"
on-refresh-opening="onRefreshOpening(amount)"
refresh-complete="refreshComplete"
padding="true"
has-tabs="true"
has-header="true"
>
<refresher></refresher>
<div id="search-box" class="bar bar-header item-input-inset">
<label class="item-input-wrapper">
<i class="icon ion-ios7-search placeholder-icon"></i>
@@ -136,7 +136,7 @@
});
})
.controller('ThisCtrl', function($scope) {
.controller('ThisCtrl', function($scope, $timeout, $ionicScrollDelegate) {
var header = document.getElementById('header');
var content = document.getElementById('container');
var startTop = header.offsetTop;
@@ -146,6 +146,11 @@
console.log('Adding!');
};
var last = 0;
$scope.onRefresh = function() {
$timeout(function() {
$ionicScrollDelegate.finishRefreshing($scope);
}, 1000);
};
$scope.onScroll = function(event, scrollTop, scrollLeft) {
/*
if(scrollTop > startTop) {

View File

@@ -1496,7 +1496,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
if (scrollTop > maxScrollTop || scrollTop < 0) {
// Slow down on the edges
if (self.options.bouncing) {
if (self.options.bouncing || (self.__refreshHeight && scrollTop < 0)) {
scrollTop += (moveY / 2 * this.options.speedMultiplier);