summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-11-16 15:36:44 +0100
committerMorris Jobke <hey@morrisjobke.de>2016-11-16 15:43:26 +0100
commitb7e6e9f83ce9d3ef3754813fe6bfb520e0fb11a2 (patch)
treee759d86e768fc36c520e820698f3b8f60b6a9c6f /settings
parentf7c637071ac7445404ccc1392827f424556ee3d4 (diff)
downloadnextcloud-server-b7e6e9f83ce9d3ef3754813fe6bfb520e0fb11a2.tar.gz
nextcloud-server-b7e6e9f83ce9d3ef3754813fe6bfb520e0fb11a2.zip
Fix tooltips - they now properly change on click
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'settings')
-rw-r--r--settings/js/authtoken_view.js28
-rw-r--r--settings/templates/personal.php2
2 files changed, 19 insertions, 11 deletions
diff --git a/settings/js/authtoken_view.js b/settings/js/authtoken_view.js
index 6eb04b63f20..391ac6c7a76 100644
--- a/settings/js/authtoken_view.js
+++ b/settings/js/authtoken_view.js
@@ -219,14 +219,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) {
@@ -240,14 +247,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);
});
},
diff --git a/settings/templates/personal.php b/settings/templates/personal.php
index ddf09444e5d..ea1c7ba6459 100644
--- a/settings/templates/personal.php
+++ b/settings/templates/personal.php
@@ -241,7 +241,7 @@ if($_['passwordChangeSupported']) {
<div class="app-password-row">
<span class="app-password-label"><?php p($l->t('Password')); ?></span>
<input id="new-app-password" type="text" readonly="readonly"/>
- <a class="clipboardButton icon icon-clippy hasTooltip" data-clipboard-target="#new-app-password" title="<?php p($l->t('Copy')); ?>"></a>
+ <a class="clipboardButton icon icon-clippy" data-clipboard-target="#new-app-password"></a>
<button id="app-password-hide" class="button"><?php p($l->t('Done')); ?></button>
</div>
</div>