diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-04-20 17:59:55 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-20 17:59:55 -0500 |
commit | 9536cbf7397517114c202bb7c2158642696dac83 (patch) | |
tree | 742c1de7934c5efd0540aa6e3408e4c45ad73f8f /core/js | |
parent | 8a743e0359e52bdbfcfcdca781702976a6038640 (diff) | |
parent | 48fd0ee9f0383c9032780d1345876d18639c16e6 (diff) | |
download | nextcloud-server-9536cbf7397517114c202bb7c2158642696dac83.tar.gz nextcloud-server-9536cbf7397517114c202bb7c2158642696dac83.zip |
Merge pull request #4409 from nextcloud/socialharing_mail
Allow social sharing to specify if a new window is opened
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/sharedialoglinkshareview.js | 20 | ||||
-rw-r--r-- | core/js/sharesocialmanager.js | 4 |
2 files changed, 16 insertions, 8 deletions
diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js index 75e56a23f58..6017714b305 100644 --- a/core/js/sharedialoglinkshareview.js +++ b/core/js/sharedialoglinkshareview.js @@ -85,7 +85,7 @@ '</li>' + '{{#each social}}' + '<li>' + - '<a href="#" class="shareOption menuitem pop-up" data-url="{{url}}">' + + '<a href="#" class="shareOption menuitem pop-up" data-url="{{url}}" data-window="{{newWindow}}">' + '<span class="icon {{iconClass}}"' + '></span><span>{{label}}' + '</span>' + @@ -424,7 +424,8 @@ url: url, label: t('core', 'Share to {name}', {name: model.get('name')}), name: model.get('name'), - iconClass: model.get('iconClass') + iconClass: model.get('iconClass'), + newWindow: model.get('newWindow') }); }); @@ -515,14 +516,19 @@ event.stopPropagation(); var url = $(event.currentTarget).data('url'); + var newWindow = $(event.currentTarget).data('window'); $(event.currentTarget).tooltip('hide'); if (url) { - var width = 600; - var height = 400; - var left = (screen.width/2)-(width/2); - var top = (screen.height/2)-(height/2); + if (newWindow === true) { + var width = 600; + var height = 400; + var left = (screen.width / 2) - (width / 2); + var top = (screen.height / 2) - (height / 2); - window.open(url, 'name', 'width=' + width + ', height=' + height + ', top=' + top + ', left=' + left); + window.open(url, 'name', 'width=' + width + ', height=' + height + ', top=' + top + ', left=' + left); + } else { + window.location.href = url; + } } } diff --git a/core/js/sharesocialmanager.js b/core/js/sharesocialmanager.js index c1db48dda62..c0e10a47481 100644 --- a/core/js/sharesocialmanager.js +++ b/core/js/sharesocialmanager.js @@ -36,7 +36,9 @@ /** Name to show in the tooltip */ name: null, /** Icon class to display */ - iconClass: null + iconClass: null, + /** Open in new windows */ + newWindow: true } }); |