summaryrefslogtreecommitdiffstats
path: root/js/build/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/build/app.js')
-rw-r--r--js/build/app.js20
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);