From 835b49d941009842f3d37fd62970feddde38d512 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 3 Mar 2017 13:36:20 +0100 Subject: Make sure copy tooltip remains when we have no social providers Signed-off-by: Roeland Jago Douma --- core/js/sharedialoglinkshareview.js | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js index 014819d5103..dc8644ab4cd 100644 --- a/core/js/sharedialoglinkshareview.js +++ b/core/js/sharedialoglinkshareview.js @@ -180,8 +180,13 @@ .tooltip({placement: 'bottom', trigger: 'manual'}) .tooltip('show'); _.delay(function() { - $input.tooltip('hide') - .tooltip("destroy"); + $input.tooltip('hide'); + if (OC.Share.Social.Collection.size() == 0) { + $input.attr('data-original-title', t('core', 'Copy')) + .tooltip('fixTitle'); + } else { + $input.tooltip("destroy"); + } }, 3000); }); clipboard.on('error', function (e) { @@ -201,9 +206,13 @@ .tooltip({placement: 'bottom', trigger: 'manual'}) .tooltip('show'); _.delay(function () { - $input.tooltip('hide') - .attr('data-original-title', t('core', 'Copy')) - .tooltip("destroy"); + $input.tooltip('hide'); + if (OC.Share.Social.Collection.size() == 0) { + $input.attr('data-original-title', t('core', 'Copy')) + .tooltip('fixTitle'); + } else { + $input.tooltip("destroy"); + } }, 3000); }); @@ -431,6 +440,14 @@ popoverMenu: popover })); + if (OC.Share.Social.Collection.size() == 0) { + this.$el.find('.clipboardButton').tooltip({ + placement: 'bottom', + title: t('core', 'Copy'), + trigger: 'hover' + }); + } + this.delegateEvents(); return this; -- cgit v1.2.3