summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-01-22 15:29:45 +0100
committerJulius Härtl <jus@bitgrid.net>2019-01-22 15:30:44 +0100
commitd36f2af1613223f2ef325cec606591cbc290cfba (patch)
tree07b3c18002dc88808905b94a1287816b165b3e87 /core
parent0d33302350faba0eb7cf543d8eef225c7e77fddd (diff)
downloadnextcloud-server-d36f2af1613223f2ef325cec606591cbc290cfba.tar.gz
nextcloud-server-d36f2af1613223f2ef325cec606591cbc290cfba.zip
Fix integration of social sharing into the link popover menu
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'core')
-rw-r--r--core/js/sharedialoglinkshareview.js28
1 files changed, 13 insertions, 15 deletions
diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js
index 716df70c376..91101e47b2e 100644
--- a/core/js/sharedialoglinkshareview.js
+++ b/core/js/sharedialoglinkshareview.js
@@ -579,19 +579,6 @@
!this.model.isFolder()
&& this.model.updatePermissionPossible();
- var social = [];
- OC.Share.Social.Collection.each(function(model) {
- var url = model.get('url');
- url = url.replace('{{reference}}', link);
-
- social.push({
- url: url,
- label: t('core', 'Share to {name}', {name: model.get('name')}),
- name: model.get('name'),
- iconClass: model.get('iconClass'),
- newWindow: model.get('newWindow')
- });
- });
var isExpirationEnforced = this.configModel.get('isDefaultExpireDateEnforced');
// what if there is another date picker on that page?
@@ -612,7 +599,6 @@
}
var popoverBase = {
- social: social,
urlLabel: t('core', 'Link'),
hideDownloadLabel: t('core', 'Hide download'),
enablePasswordLabel: isPasswordEnforced ? t('core', 'Password protection enforced') : t('core', 'Password protect'),
@@ -653,8 +639,20 @@
var linkShares = this.getShareeList();
if(_.isArray(linkShares)) {
for (var i = 0; i < linkShares.length; i++) {
+ var social = [];
+ OC.Share.Social.Collection.each(function (model) {
+ var url = model.get('url');
+ url = url.replace('{{reference}}', linkShares[i].shareLinkURL);
+ social.push({
+ url: url,
+ label: t('core', 'Share to {name}', {name: model.get('name')}),
+ name: model.get('name'),
+ iconClass: model.get('iconClass'),
+ newWindow: model.get('newWindow')
+ });
+ });
var popover = this.getPopoverObject(linkShares[i])
- linkShares[i].popoverMenu = this.popoverMenuTemplate(_.extend({}, popoverBase, popover));
+ linkShares[i].popoverMenu = this.popoverMenuTemplate(_.extend({}, popoverBase, popover, {social: social}));
linkShares[i].pendingPopoverMenu = pendingPopoverMenu
}
}