diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/app/services/persistence.coffee | 4 | ||||
-rw-r--r-- | js/app/services/services.coffee | 2 | ||||
-rw-r--r-- | js/public/app.js | 15 |
3 files changed, 13 insertions, 8 deletions
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 <http://www.gnu.org/licenses/>. # 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 <http://www.gnu.org/licenses/>. ]); 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 <http://www.gnu.org/licenses/>. 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 <http://www.gnu.org/licenses/>. 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 <http://www.gnu.org/licenses/>. (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); } ]); |