diff --git a/dist/js/ionic.js b/dist/js/ionic.js index 81d80ee5f3..494d8f93ca 100644 --- a/dist/js/ionic.js +++ b/dist/js/ionic.js @@ -2406,21 +2406,29 @@ window.ionic = { return; } + this.x = scrollLeft; + this.y = scrollTop; + // Grab the refresher element if using Pull to Refresh if(this.hasPullToRefresh) { this._refresher = document.querySelector('.scroll-refresher'); this._refresherHeight = parseFloat(this._refresher.firstElementChild.offsetHeight) || 100; // We always start the refresher hidden - this._isRefresherHidden = true; + if(this.y < 0) { + this._isRefresherHidden = true; + this._refresher.style.display = 'none'; + } else { + this._isRefresherHidden = false; + this._refresher.style.display = 'block'; + } + + this._isHoldingRefresh = false; if(this._refresher) { this._refresher.classList.remove('scroll-refreshing'); } } - this.x = scrollLeft; - this.y = scrollTop; - this._drag = { direction: 'v', pointX: e.gesture.touches[0].pageX, @@ -2530,6 +2538,14 @@ window.ionic = { // Update the new translated Y point of the container _this.el.style.webkitTransform = 'translate3d(' + newX + 'px,' + newY + 'px, 0)'; } else { + + _this._isHoldingRefresh = false; + + // Hide the refresher + if(_this.refresher && !_this._isRefresherHidden) { + _this._refresher.style.display = 'none'; + _this._isRefresherHidden = true; + } // Update the new translated Y point of the container _this.el.style.webkitTransform = 'translate3d(' + newX + 'px,' + newY + 'px, 0)'; } diff --git a/js/views/scrollView.js b/js/views/scrollView.js index bfefe6da4e..f7484ec633 100644 --- a/js/views/scrollView.js +++ b/js/views/scrollView.js @@ -497,21 +497,29 @@ return; } + this.x = scrollLeft; + this.y = scrollTop; + // Grab the refresher element if using Pull to Refresh if(this.hasPullToRefresh) { this._refresher = document.querySelector('.scroll-refresher'); this._refresherHeight = parseFloat(this._refresher.firstElementChild.offsetHeight) || 100; // We always start the refresher hidden - this._isRefresherHidden = true; + if(this.y < 0) { + this._isRefresherHidden = true; + this._refresher.style.display = 'none'; + } else { + this._isRefresherHidden = false; + this._refresher.style.display = 'block'; + } + + this._isHoldingRefresh = false; if(this._refresher) { this._refresher.classList.remove('scroll-refreshing'); } } - this.x = scrollLeft; - this.y = scrollTop; - this._drag = { direction: 'v', pointX: e.gesture.touches[0].pageX, @@ -621,6 +629,14 @@ // Update the new translated Y point of the container _this.el.style.webkitTransform = 'translate3d(' + newX + 'px,' + newY + 'px, 0)'; } else { + + _this._isHoldingRefresh = false; + + // Hide the refresher + if(_this.refresher && !_this._isRefresherHidden) { + _this._refresher.style.display = 'none'; + _this._isRefresherHidden = true; + } // Update the new translated Y point of the container _this.el.style.webkitTransform = 'translate3d(' + newX + 'px,' + newY + 'px, 0)'; }