diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-10-31 10:28:18 +0100 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-11-01 21:30:45 +0100 |
commit | 106ed07d6ac306420d091b44ddc4427bd5cf228f (patch) | |
tree | 1fd9b6edafcbebc666de0b76440199ae32aa795d /core/js/sharedialoglinkshareview.js | |
parent | 1bd6d39b39dd527ad095510173e9012afaafd3b0 (diff) | |
download | nextcloud-server-106ed07d6ac306420d091b44ddc4427bd5cf228f.tar.gz nextcloud-server-106ed07d6ac306420d091b44ddc4427bd5cf228f.zip |
Copy link outside menu
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'core/js/sharedialoglinkshareview.js')
-rw-r--r-- | core/js/sharedialoglinkshareview.js | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js index 6e3fce04dfe..fc2292b4f46 100644 --- a/core/js/sharedialoglinkshareview.js +++ b/core/js/sharedialoglinkshareview.js @@ -97,25 +97,34 @@ throw 'missing OC.Share.ShareConfigModel'; } - var clipboard = new Clipboard('.clipboardButton'); + var clipboard = new Clipboard('.clipboard-button'); clipboard.on('success', function(e) { - var $menu = $(e.trigger); + var $trigger = $(e.trigger); - $menu.tooltip('hide') + $trigger.tooltip('hide') .attr('data-original-title', t('core', 'Copied!')) .tooltip('fixTitle') .tooltip({placement: 'bottom', trigger: 'manual'}) .tooltip('show'); _.delay(function() { - $menu.tooltip('hide'); - $menu.tooltip('destroy'); + $trigger.tooltip('hide') + .attr('data-original-title', t('core', 'Copy link')) + .tooltip('fixTitle') }, 3000); }); clipboard.on('error', function (e) { - var $menu = $(e.trigger); - var $linkTextMenu = $menu.parent().next('li.linkTextMenu'); + var $trigger = $(e.trigger); + var $menu = $trigger.next('.share-menu').find('.popovermenu'); + var $linkTextMenu = $menu.find('li.linkTextMenu'); var $input = $linkTextMenu.find('.linkText'); + var $li = $trigger.closest('li[data-share-id]'); + var shareId = $li.data('share-id'); + + // show menu + OC.showMenu(null, $menu); + this._menuOpen = shareId; + var actionMsg = ''; if (/iPhone|iPad/i.test(navigator.userAgent)) { actionMsg = t('core', 'Not supported!'); @@ -393,6 +402,8 @@ }, render: function() { + this.$el.find('.has-tooltip').tooltip(); + var linkShareTemplate = this.template(); var resharingAllowed = this.model.sharePermissionPossible(); @@ -456,7 +467,6 @@ this.$el.find('.datepicker').datepicker({dateFormat : 'dd-mm-yy'}); var popoverBase = { - copyLabel: t('core', 'Copy link'), social: social, urlLabel: t('core', 'Link'), hideDownloadLabel: t('core', 'Hide download'), @@ -508,7 +518,7 @@ shareAllowed: true, nolinkShares: linkShares.length === 0, newShareLabel: t('core', 'Share link'), - newShareTitle: t('core', 'New share link'), + newShareTitle: t('core', 'New share link') })); this.delegateEvents(); @@ -663,7 +673,10 @@ linkShareLabel: share.label !== '' ? share.label : t('core', 'Share link'), popoverMenu: {}, pendingPopoverMenu: {}, - showPending: this.showPending + showPending: this.showPending, + shareLinkURL: share.url, + newShareTitle: t('core', 'New share link'), + copyLabel: t('core', 'Copy link'), }) }, @@ -734,7 +747,6 @@ maxDate: maxDate, showHideDownloadCheckbox: showHideDownloadCheckbox, hideDownload: hideDownload, - newShareTitle: t('core', 'New share link'), } }, |