diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2016-11-16 17:57:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-16 17:57:35 +0100 |
commit | 7100a1b3472f35ba8edb6e427fa6657dc53ef63b (patch) | |
tree | e72440996e3016a5a488efb58195c4f19c4258c6 /settings/js/authtoken_view.js | |
parent | 61453f5fd5eb3e742d1c757def36ce8f6be408f3 (diff) | |
parent | b7e6e9f83ce9d3ef3754813fe6bfb520e0fb11a2 (diff) | |
download | nextcloud-server-7100a1b3472f35ba8edb6e427fa6657dc53ef63b.tar.gz nextcloud-server-7100a1b3472f35ba8edb6e427fa6657dc53ef63b.zip |
Merge pull request #2146 from nextcloud/add_copy_tooltip_to_clipboard
Adds copy tooltip to clipboards
Diffstat (limited to 'settings/js/authtoken_view.js')
-rw-r--r-- | settings/js/authtoken_view.js | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/settings/js/authtoken_view.js b/settings/js/authtoken_view.js index 20fe5235eb0..0939913cc1a 100644 --- a/settings/js/authtoken_view.js +++ b/settings/js/authtoken_view.js @@ -233,14 +233,21 @@ this._hideAppPasswordBtn = $('#app-password-hide'); this._hideAppPasswordBtn.click(_.bind(this._hideToken, this)); + this._result.find('.clipboardButton').tooltip({placement: 'bottom', title: t('core', 'Copy'), trigger: 'hover'}); + // Clipboard! var clipboard = new Clipboard('.clipboardButton'); clipboard.on('success', function(e) { var $input = $(e.trigger); - $input.tooltip({placement: 'bottom', trigger: 'manual', title: t('core', 'Copied!')}); - $input.tooltip('show'); + $input.tooltip('hide') + .attr('data-original-title', t('core', 'Copied!')) + .tooltip('fixTitle') + .tooltip({placement: 'bottom', trigger: 'manual'}) + .tooltip('show'); _.delay(function() { - $input.tooltip('hide'); + $input.tooltip('hide') + .attr('data-original-title', t('core', 'Copy')) + .tooltip('fixTitle'); }, 3000); }); clipboard.on('error', function (e) { @@ -254,14 +261,15 @@ actionMsg = t('core', 'Press Ctrl-C to copy.'); } - $input.tooltip({ - placement: 'bottom', - trigger: 'manual', - title: actionMsg - }); - $input.tooltip('show'); + $input.tooltip('hide') + .attr('data-original-title', actionMsg) + .tooltip('fixTitle') + .tooltip({placement: 'bottom', trigger: 'manual'}) + .tooltip('show'); _.delay(function () { - $input.tooltip('hide'); + $input.tooltip('hide') + .attr('data-original-title', t('core', 'Copy')) + .tooltip('fixTitle'); }, 3000); }); }, |