diff options
-rw-r--r-- | js/controller/ShareController.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/js/controller/ShareController.js b/js/controller/ShareController.js index 94d60daf6..23b8c525e 100644 --- a/js/controller/ShareController.js +++ b/js/controller/ShareController.js @@ -102,6 +102,22 @@ app.controller('ShareController', function (ShareResource, Loading) { }); }; + this.isLoading = function(userId) { + return Loading.isLoading(userId); + }; + + this.isStatus = function(itemId, userId, status) { + let item = this.usersSharedArticles.find(i => i.id === itemId); + if (!item) { + return false; + } + let user = item.users.find(u => u.id === userId); + if (!user) { + return false; + } + return user.status === status; + }; + this.getFacebookUrl = function(url){ return 'https://www.facebook.com/sharer/sharer.php?u='+url; }; |