FIX: uses tooltip to display local dates previews

This commit is contained in:
Joffrey JAFFEUX 2018-05-22 13:58:06 +02:00 committed by GitHub
parent 95db5f0c8c
commit 7285e7fbba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -46,9 +46,12 @@
html += relativeTime.replace("TZ", _formatTimezone(moment.tz.guess()).join(": "));
html += "</span>";
var joinedPreviews = previews.join("\n");
$element
.html(html)
.attr("title", previews.join("\n"))
.attr("title", joinedPreviews)
.attr("data-tooltip", joinedPreviews)
.addClass("cooked");
if (repeat) {

View File

@ -1,9 +1,11 @@
import { withPluginApi } from "discourse/lib/plugin-api";
import showModal from "discourse/lib/show-modal";
import { registerTooltip } from "discourse/lib/tooltip";
function initializeDiscourseLocalDates(api) {
api.decorateCooked($elem => {
$(".discourse-local-date", $elem).applyLocalDates();
registerTooltip($(".discourse-local-date", $elem));
});
api.addToolbarPopupMenuOptionsCallback(() => {