From 842b39c380a1996205042a62d00f0a22db94364a Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Sat, 23 Mar 2013 16:43:50 +0100 Subject: various bugfixes --- js/app/services/persistence.coffee | 4 ++-- js/app/services/services.coffee | 2 +- js/public/app.js | 15 ++++++++++----- 3 files changed, 13 insertions(+), 8 deletions(-) (limited to 'js') diff --git a/js/app/services/persistence.coffee b/js/app/services/persistence.coffee index 80d8d391d..6f75d4601 100644 --- a/js/app/services/persistence.coffee +++ b/js/app/services/persistence.coffee @@ -37,7 +37,7 @@ angular.module('News').factory '_Persistence', -> # items can only be loaded after the active feed is known @getActiveFeed => - @getItems @_activeFeed.getType(), @_activeFeed.getId(), null, => + @getItems @_activeFeed.getType(), @_activeFeed.getId(), 0, => @_loading.decrease() @getAllFolders(@_triggerHideRead) @@ -50,7 +50,7 @@ angular.module('News').factory '_Persistence', -> ITEM CONTROLLER ### getItems: (type, id, offset, onSuccess, updatedSince=null) -> - # TODO + if updatedSince != null data = updatedSince: updatedSince diff --git a/js/app/services/services.coffee b/js/app/services/services.coffee index 08d4d6274..dac4206a9 100644 --- a/js/app/services/services.coffee +++ b/js/app/services/services.coffee @@ -23,7 +23,7 @@ License along with this library. If not, see . # request related stuff angular.module('News').factory 'Persistence', ['_Persistence', 'Request', -'FeedLoading', 'Config', '$rootScope', 'ActiveFeed', +'FeedLoading', 'Config', 'ActiveFeed', '$rootScope', (_Persistence, Request, FeedLoading, Config, ActiveFeed, $rootScope) -> return new _Persistence(Request, FeedLoading, Config, ActiveFeed, $rootScope) ] diff --git a/js/public/app.js b/js/public/app.js index d7b0d2f2a..f57367fa0 100644 --- a/js/public/app.js +++ b/js/public/app.js @@ -103,8 +103,8 @@ License along with this library. If not, see . ]); angular.module('News').controller('ItemController', [ - '$scope', '_ItemController', 'ItemModel', function($scope, _ItemController, ItemModel) { - return new _ItemController($scope, ItemModel); + '$scope', '_ItemController', 'ItemModel', 'FeedLoading', function($scope, _ItemController, ItemModel, FeedLoading) { + return new _ItemController($scope, ItemModel, FeedLoading); } ]); @@ -184,9 +184,14 @@ License along with this library. If not, see . var ItemController; ItemController = (function() { - function ItemController($scope, itemModel) { + function ItemController($scope, itemModel, feedLoading) { + var _this = this; this.$scope = $scope; this.itemModel = itemModel; + this.feedLoading = feedLoading; + this.$scope.isLoading = function() { + return _this.feedLoading.isLoading(); + }; } return ItemController; @@ -651,7 +656,7 @@ License along with this library. If not, see . var _this = this; this._loading.increase(); this.getActiveFeed(function() { - return _this.getItems(_this._activeFeed.getType(), _this._activeFeed.getId(), null, function() { + return _this.getItems(_this._activeFeed.getType(), _this._activeFeed.getId(), 0, function() { return _this._loading.decrease(); }); }); @@ -1032,7 +1037,7 @@ License along with this library. If not, see . (function() { angular.module('News').factory('Persistence', [ - '_Persistence', 'Request', 'FeedLoading', 'Config', '$rootScope', 'ActiveFeed', function(_Persistence, Request, FeedLoading, Config, ActiveFeed, $rootScope) { + '_Persistence', 'Request', 'FeedLoading', 'Config', 'ActiveFeed', '$rootScope', function(_Persistence, Request, FeedLoading, Config, ActiveFeed, $rootScope) { return new _Persistence(Request, FeedLoading, Config, ActiveFeed, $rootScope); } ]); -- cgit v1.2.3