mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
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);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -27,6 +27,16 @@
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.dashboard .widget-container.widget-lazy-loading {
|
||||
text-align: center;
|
||||
.fa-cog {
|
||||
color: #ccc;
|
||||
margin-top: 30px;
|
||||
-webkit-animation: fa-spin 4s infinite linear;
|
||||
animation: fa-spin 4s infinite linear;
|
||||
}
|
||||
}
|
||||
|
||||
.dashboard-panels .panel-heading .fa {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user