Fix layout of sharing buttons

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2017-03-14 22:50:32 -06:00
parent be45d6aac9
commit 13aae43d89
No known key found for this signature in database
GPG Key ID: 9CE5ED29E7FCD38A
2 changed files with 26 additions and 13 deletions

View File

@ -28,8 +28,16 @@
padding: 14px;
}
/* fix the popup menu because the button is shifted and then the menu is not aligned */
.shareTabView .popovermenu.socialSharingMenu {
right: -7px;
}
.shareTabView .popovermenu .clipboardButton {
position: relative;
top: initial;
right: initial;
padding: 18px 0 18px 36px;
}
.shareTabView label {

View File

@ -70,22 +70,21 @@
'{{/if}}'
;
var TEMPLATE_POPOVER_MENU =
'<div class="popovermenu bubble hidden menu">' +
'<div class="popovermenu bubble hidden menu socialSharingMenu">' +
'<ul>' +
'<li>' +
'<span class="shareOption menuitem">' +
'<button class="icon clipboardButton icon-clippy"' +
'data-clipboard-target="#linkText-{{cid}}">{{copyLabel}}' +
'</button>' +
'</span>' +
'<a href="#" class="shareOption menuitem clipboardButton" data-clipboard-target="#linkText-{{cid}}">' +
'<span class="icon icon-clippy" ></span>' +
'<span>{{copyLabel}}</span>' +
'</a>' +
'</li>' +
'{{#each social}}' +
'<li>' +
'<span class="shareOption menuitem">' +
'<button class="icon {{iconClass}} pop-up"' +
'data-url="{{url}}">{{label}}' +
'</button>' +
'</span>' +
'<a href="#" class="shareOption menuitem pop-up" data-url="{{url}}">' +
'<span class="icon {{iconClass}}"' +
'></span><span>{{label}}' +
'</span>' +
'</a>' +
'</li>' +
'{{/each}}' +
'</ul>' +
@ -173,6 +172,9 @@
var clipboard = new Clipboard('.clipboardButton');
clipboard.on('success', function(e) {
event.preventDefault();
event.stopPropagation();
var $input = $(e.trigger);
$input.tooltip('hide')
.attr('data-original-title', t('core', 'Copied!'))
@ -489,8 +491,11 @@
},
onPopUpClick: function(event) {
var url = $(event.target).data('url');
$(event.target).tooltip('hide');
event.preventDefault();
event.stopPropagation();
var url = $(event.currentTarget).data('url');
$(event.currentTarget).tooltip('hide');
if (url) {
var width = 600;
var height = 400;