diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-09-06 15:42:51 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2015-09-06 15:42:51 +0200 |
commit | 70ff47a9b77797e75137ba02f0b7df9bc2745f56 (patch) | |
tree | aef60c640494dc3996ae565ce6f4b74cc2dee572 /js/build/app.js | |
parent | 5323fa1fb1bd43ef653a91f5bba6d63cd18078f3 (diff) |
fix # 848
Diffstat (limited to 'js/build/app.js')
-rw-r--r-- | js/build/app.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/js/build/app.js b/js/build/app.js index 99bd0f100..002587df6 100644 --- a/js/build/app.js +++ b/js/build/app.js @@ -847,6 +847,13 @@ app.controller('NavigationController', $route.reload(); }; + this.togglePinned = function (feedId) { + var feed = FeedResource.getById(feedId); + if (feed) { + return FeedResource.setPinned(feedId, !feed.pinned); + } + }; + this.toggleFullText = function (feed) { $rootScope.$broadcast('$routeChangeStart'); FeedResource.toggleFullText(feed.id).finally(function () { @@ -1317,6 +1324,19 @@ app.factory('FeedResource', ["Resource", "$http", "BASE_URL", "$q", function (Re }; + FeedResource.prototype.setPinned = function (feedId, isPinned) { + var feed = this.getById(feedId); + + if (feed) { + feed.pinned = isPinned; + var url = this.BASE_URL + '/feeds/' + feedId + '/pinned'; + return this.http.post(url, { + isPinned: isPinned + }); + } + }; + + FeedResource.prototype.toggleFullText = function (feedId) { var feed = this.getById(feedId); |