FreeSTAR-Status-Engine/js/main.js
Tealk bf3048baf8
files reformatted
for better readability
2021-03-18 18:26:03 +01:00

30 lines
722 B
JavaScript

function timeago() {
$("time.timeago").timeago();
$("time.timeago").each(function () {
var date = new Date($(this).attr("datetime"));
$(this).attr("title", date.toLocaleString());
});
}
(function () {
jQuery.timeago.settings.allowFuture = true;
timeago();
$("body").on("click", ".navbar-toggle", function () {
$($(this).data("target")).toggleClass("collapse");
});
var incidents = $(".timeline");
$("body").on("click", "#loadmore", function (e) {
e.preventDefault();
var url = $("#loadmore").attr("href") + "&ajax=true";
$("#loadmore").remove();
$.get(url, function (data) {
incidents.append(data);
timeago();
});
});
})();