summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--js/controller/ShareController.js17
-rw-r--r--templates/part.content.php4
2 files changed, 6 insertions, 15 deletions
diff --git a/js/controller/ShareController.js b/js/controller/ShareController.js
index 0bb920eda..94d60daf6 100644
--- a/js/controller/ShareController.js
+++ b/js/controller/ShareController.js
@@ -102,20 +102,11 @@ app.controller('ShareController', function (ShareResource, Loading) {
});
};
- this.isLoading = function(userId) {
- return Loading.isLoading(userId);
+ this.getFacebookUrl = function(url){
+ return 'https://www.facebook.com/sharer/sharer.php?u='+url;
};
- 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.getTwitterUrl = function(url){
+ return 'https://twitter.com/intent/tweet?url='+url;
};
-
});
diff --git a/templates/part.content.php b/templates/part.content.php
index 71e070d50..8bcd33d14 100644
--- a/templates/part.content.php
+++ b/templates/part.content.php
@@ -142,12 +142,12 @@
<div class="col-4">
<a target="_blank"
class="icon-dropdown icon-facebook pr-5"
- ng-href="https://www.facebook.com/sharer/sharer.php?u={{ ::item.url }}"></a>
+ ng-href="{{Share.getFacebookUrl(item.url)}}"></a>
</div>
<div class="col-4">
<a target="_blank"
class="icon-dropdown icon-twitter pr-5"
- ng-href="https://twitter.com/intent/tweet?url={{ ::item.url }}"></a>
+ ng-href="{{Share.getTwitterUrl(item.url)}}"></a>
</div>
<div class="col-4">
<a class="icon-dropdown icon-mail pr-5"