FIX: uses tooltip to display local dates previews
This commit is contained in:
parent
95db5f0c8c
commit
7285e7fbba
|
@ -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) {
|
||||
|
|
|
@ -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(() => {
|
||||
|
|
Loading…
Reference in New Issue