forked from CGM_Public/pretix_original
Lazy-load dashboard widgets
This commit is contained in:
13
src/pretix/static/pretixcontrol/js/ui/dashboard.js
Normal file
13
src/pretix/static/pretixcontrol/js/ui/dashboard.js
Normal file
@@ -0,0 +1,13 @@
|
||||
/*global $,gettext*/
|
||||
|
||||
$(function () {
|
||||
if ($("div[data-lazy-id]").length == 0) {
|
||||
return;
|
||||
}
|
||||
$.getJSON("widgets.json", function (data) {
|
||||
$.each(data.widgets, function (k, v) {
|
||||
$("[data-lazy-id=" + v.lazy + "]").removeClass("widget-lazy-loading");
|
||||
$("[data-lazy-id=" + v.lazy + "] .widget").html(v.content);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user