summaryrefslogtreecommitdiffstats
path: root/js/app/directives/pulltorefresh.coffee
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-09-14 02:44:32 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-09-14 02:44:32 +0200
commitbfa090ed5d6fd8fa22487d239d3bb1e0b5e60f69 (patch)
tree9cc16eb2573fa7a8ff552230b2b9a612720c5474 /js/app/directives/pulltorefresh.coffee
parentdf8f6b5fee643c5b2af8e8d33a7865e898518485 (diff)
dont do pull to refresh when loading in items
Diffstat (limited to 'js/app/directives/pulltorefresh.coffee')
-rw-r--r--js/app/directives/pulltorefresh.coffee16
1 files changed, 13 insertions, 3 deletions
diff --git a/js/app/directives/pulltorefresh.coffee b/js/app/directives/pulltorefresh.coffee
index 436280793..00f3bcae5 100644
--- a/js/app/directives/pulltorefresh.coffee
+++ b/js/app/directives/pulltorefresh.coffee
@@ -20,11 +20,21 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
###
-angular.module('News').directive 'newsPullToRefresh', ->
+angular.module('News').directive 'newsPullToRefresh', ['$rootScope',
+($rootScope) ->
+
+ allowed = false
+ $rootScope.$on 'loadingNewItems', ->
+ allowed = false
+ $rootScope.$on 'loadedNewItems', ->
+ allowed = true
+
+
directive =
restrict: 'A'
link: (scope, elm, attrs) ->
scrollTop = 0
elm.scroll ->
- if @scrollTop == 0
- scope.$apply attrs.newsPullToRefresh \ No newline at end of file
+ if @scrollTop == 0 && allowed
+ scope.$apply attrs.newsPullToRefresh
+] \ No newline at end of file