post tooltips: add disable option (#3689).
* Add "disable post tooltips" account setting. * Add back title attribute for when fancy tooltips are disabled.
This commit is contained in:
@@ -56,7 +56,11 @@ Danbooru.PostTooltip.QTIP_OPTIONS = {
|
||||
|
||||
Danbooru.PostTooltip.initialize = function () {
|
||||
$(document).on("mouseenter", Danbooru.PostTooltip.POST_SELECTOR, function (event) {
|
||||
$(this).qtip(Danbooru.PostTooltip.QTIP_OPTIONS, event);
|
||||
if (Danbooru.PostTooltip.disabled()) {
|
||||
$(this).qtip("disable");
|
||||
} else {
|
||||
$(this).qtip(Danbooru.PostTooltip.QTIP_OPTIONS, event);
|
||||
}
|
||||
});
|
||||
|
||||
// Hide tooltips when clicking thumbnails.
|
||||
@@ -67,4 +71,8 @@ Danbooru.PostTooltip.hide = function (event) {
|
||||
$(".post-tooltip:visible").qtip("hide");
|
||||
};
|
||||
|
||||
Danbooru.PostTooltip.disabled = function (event) {
|
||||
return Danbooru.meta("disable-post-tooltips") === "true";
|
||||
};
|
||||
|
||||
$(document).ready(Danbooru.PostTooltip.initialize);
|
||||
|
||||
Reference in New Issue
Block a user