diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-11-17 16:59:24 +0000 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-11-17 16:59:24 +0000 |
commit | 31a049eb692d37387a2db972da754f7ec56218c7 (patch) | |
tree | 9e5f47abad904d30c08d2f340b543a631e436894 /syweb/webclient/js/ng-infinite-scroll-matrix.js | |
parent | Include room membership in room initialSync (diff) | |
parent | SYN-148: Add the alias after creating the room (diff) | |
download | synapse-31a049eb692d37387a2db972da754f7ec56218c7.tar.xz |
Merge branch 'develop' into room-initial-sync
Conflicts: synapse/handlers/message.py
Diffstat (limited to 'syweb/webclient/js/ng-infinite-scroll-matrix.js')
-rw-r--r-- | syweb/webclient/js/ng-infinite-scroll-matrix.js | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/syweb/webclient/js/ng-infinite-scroll-matrix.js b/syweb/webclient/js/ng-infinite-scroll-matrix.js deleted file mode 100644 index 045ec8d93e..0000000000 --- a/syweb/webclient/js/ng-infinite-scroll-matrix.js +++ /dev/null @@ -1,63 +0,0 @@ -/* ng-infinite-scroll - v1.0.0 - 2013-02-23 - Matrix: Modified to support scrolling UP to get infinite loading and to listen - to scroll events on the PARENT element, not the window. -*/ -var mod; - -mod = angular.module('infinite-scroll', []); - -mod.directive('infiniteScroll', [ - '$rootScope', '$window', '$timeout', function($rootScope, $window, $timeout) { - return { - link: function(scope, elem, attrs) { - var checkWhenEnabled, handler, scrollDistance, scrollEnabled; - $window = angular.element($window); - scrollDistance = 0; - if (attrs.infiniteScrollDistance != null) { - scope.$watch(attrs.infiniteScrollDistance, function(value) { - return scrollDistance = parseInt(value, 10); - }); - } - scrollEnabled = true; - checkWhenEnabled = false; - if (attrs.infiniteScrollDisabled != null) { - scope.$watch(attrs.infiniteScrollDisabled, function(value) { - scrollEnabled = !value; - if (scrollEnabled && checkWhenEnabled) { - checkWhenEnabled = false; - return handler(); - } - }); - } - handler = function() { - var elementTop, remaining, shouldScroll, windowTop; - windowTop = 0; - elementTop = elem.offset().top; - shouldScroll = elementTop >= 0; // top of list is at the top of the window or further down the page - if (shouldScroll && scrollEnabled) { - if ($rootScope.$$phase) { - return scope.$eval(attrs.infiniteScroll); - } else { - return scope.$apply(attrs.infiniteScroll); - } - } else if (shouldScroll) { - return checkWhenEnabled = true; - } - }; - elem.parent().on('scroll', handler); - scope.$on('$destroy', function() { - return elem.parent().off('scroll', handler); - }); - return $timeout((function() { - if (attrs.infiniteScrollImmediateCheck) { - if (scope.$eval(attrs.infiniteScrollImmediateCheck)) { - return handler(); - } - } else { - return handler(); - } - }), 0); - } - }; - } -]); |