post tooltips: position tooltips above thumbnail.

This commit is contained in:
evazion
2018-04-29 22:16:40 -05:00
parent 7e99a1b38b
commit 93471c99c9
2 changed files with 13 additions and 5 deletions

View File

@@ -9,7 +9,6 @@ Danbooru.PostTooltip.render_tooltip = function (event, qtip) {
// Hide the tooltip if the user stopped hovering before the ajax request completed. // Hide the tooltip if the user stopped hovering before the ajax request completed.
if (Danbooru.PostTooltip.lostFocus) { if (Danbooru.PostTooltip.lostFocus) {
console.log("hiding");
qtip.hide(); qtip.hide();
} }
}); });
@@ -31,16 +30,25 @@ Danbooru.PostTooltip.QTIP_OPTIONS = {
content: Danbooru.PostTooltip.render_tooltip, content: Danbooru.PostTooltip.render_tooltip,
overwrite: false, overwrite: false,
position: { position: {
viewport: true,
my: "bottom left",
at: "top left",
effect: false,
adjust: {
y: -2,
method: "shift",
},
/* Position tooltip beneath mouse.
my: "top left", my: "top left",
at: "bottom left", at: "bottom left",
target: "mouse", target: "mouse",
// `viewport: $(window)` is better, but it requires jquery-migrate until https://github.com/qTip2/qTip2/issues/797 is fixed.
viewport: true, viewport: true,
adjust: { adjust: {
mouse: false, mouse: false,
y: 25, y: 25,
method: "shift", method: "shift",
}, },
*/
}, },
show: { show: {
solo: true, solo: true,
@@ -50,10 +58,10 @@ Danbooru.PostTooltip.QTIP_OPTIONS = {
event: "mouseenter", event: "mouseenter",
}, },
hide: { hide: {
delay: 50, delay: 150,
fixed: true, fixed: true,
effect: false, effect: false,
event: "unfocus mouseleave", event: "unfocus click mouseleave",
}, },
events: { events: {
show: Danbooru.PostTooltip.on_show, show: Danbooru.PostTooltip.on_show,

View File

@@ -69,6 +69,6 @@ $tooltip-height: 160px;
} }
&.post-tooltip-loading { &.post-tooltip-loading {
display: none !important; visibility: hidden;
} }
} }