From b7e6e9f83ce9d3ef3754813fe6bfb520e0fb11a2 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 16 Nov 2016 15:36:44 +0100 Subject: Fix tooltips - they now properly change on click Signed-off-by: Morris Jobke --- apps/federatedfilesharing/js/settings-personal.js | 31 +++++++++++++++------- .../templates/settings-personal.php | 2 +- apps/updatenotification/js/admin.js | 2 ++ 3 files changed, 24 insertions(+), 11 deletions(-) (limited to 'apps') diff --git a/apps/federatedfilesharing/js/settings-personal.js b/apps/federatedfilesharing/js/settings-personal.js index f89022dc8a0..04096cb0416 100644 --- a/apps/federatedfilesharing/js/settings-personal.js +++ b/apps/federatedfilesharing/js/settings-personal.js @@ -20,14 +20,21 @@ $(document).ready(function() { } }); + $('#fileSharingSettings .clipboardButton').tooltip({placement: 'bottom', title: t('core', 'Copy'), trigger: 'hover'}); + // Clipboard! var clipboard = new Clipboard('.clipboardButton'); clipboard.on('success', function(e) { $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) { @@ -41,14 +48,18 @@ $(document).ready(function() { 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); }); + + + $('#fileSharingSettings .hasTooltip').tooltip({placement: 'right'}); }); diff --git a/apps/federatedfilesharing/templates/settings-personal.php b/apps/federatedfilesharing/templates/settings-personal.php index c8fc1caf7d6..98a1cd7f751 100644 --- a/apps/federatedfilesharing/templates/settings-personal.php +++ b/apps/federatedfilesharing/templates/settings-personal.php @@ -12,7 +12,7 @@ style('federatedfilesharing', 'settings-personal');

t('Your Federated Cloud ID:')); ?> - +


diff --git a/apps/updatenotification/js/admin.js b/apps/updatenotification/js/admin.js index 813ec48c87a..589765348af 100644 --- a/apps/updatenotification/js/admin.js +++ b/apps/updatenotification/js/admin.js @@ -72,4 +72,6 @@ $(document).ready(function(){ groups = JSON.stringify(groups); OCP.AppConfig.setValue('updatenotification', 'notify_groups', groups); }); + + $('#oca_updatenotification_section .icon-info').tooltip({placement: 'right'}); }); -- cgit v1.2.3