diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2013-12-20 23:25:00 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2013-12-20 23:25:00 +0100 |
commit | c930b7c448fd394e9f12a82728f4fe4202879974 (patch) | |
tree | bd097b71a7f57407469850b0023265e1138339e1 /js | |
parent | 35316ec9331aa91087d6f695ed3935de2982416f (diff) |
debug
Diffstat (limited to 'js')
-rw-r--r-- | js/app/services/persistence.coffee | 8 | ||||
-rw-r--r-- | js/public/app.js | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/js/app/services/persistence.coffee b/js/app/services/persistence.coffee index 9aba6c777..a79dc1224 100644 --- a/js/app/services/persistence.coffee +++ b/js/app/services/persistence.coffee @@ -70,7 +70,6 @@ $rootScope, $q) -> # autopage prevention @_lastFeedChange = new Date().getTime() @_preventUselessAutoPageRequest = false - console.log 'free' else loading = @_autoPageLoading @@ -87,7 +86,6 @@ $rootScope, $q) -> lastChange == @_lastFeedChange && offset != 0 @_preventUselessAutoPageRequest = true - console.log 'lock' onSuccess(data) loading.decrease() failureCallbackWrapper = (data) -> @@ -103,10 +101,14 @@ $rootScope, $q) -> onFailure: failureCallbackWrapper if not @_preventUselessAutoPageRequest - console.log 'request' @_request.get 'news_items', params else + # this case happens if an autopage request is prevented if when + # there are no new items. we still have to remove the loading + # sign and call the success handler, otherwise the controller + # will block the request and the loading sign will not go away onSuccess() + loading.decrease() getNewItems: (type, id, lastModified, onSuccess) -> diff --git a/js/public/app.js b/js/public/app.js index c5488daed..5306dd0d8 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -2775,7 +2775,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. loading = this._feedLoading; this._lastFeedChange = new Date().getTime(); this._preventUselessAutoPageRequest = false; - console.log('free'); } else { loading = this._autoPageLoading; } @@ -2786,7 +2785,6 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. return successCallbackWrapper = function(data) { if (data.data.items.length === 0 && lastChange === _this._lastFeedChange && offset !== 0) { _this._preventUselessAutoPageRequest = true; - console.log('lock'); } onSuccess(data); return loading.decrease(); @@ -2806,10 +2804,10 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>. onFailure: failureCallbackWrapper }; if (!this._preventUselessAutoPageRequest) { - console.log('request'); return this._request.get('news_items', params); } else { - return onSuccess(); + onSuccess(); + return loading.decrease(); } }; |