De-conflict asset bundles

This commit is contained in:
2022-03-05 17:22:25 +00:00
parent 5cf22b1715
commit 299a6709cd
10 changed files with 37 additions and 35 deletions

View File

@@ -0,0 +1,38 @@
/**
* Page-specific Javascript file. Should generally be included as a separate asset bundle in your page template.
* example: {{ assets.js('js/pages/sign-in-or-register') | raw }}
*
* This script depends on widgets/organisations.js, uf-table.js, moment.js, handlebars-helpers.js
*
* Target page: /organisations
*/
$(document).ready(function() {
if ($("#widget-organisations").length) {
$("#widget-organisations").ufTable({
dataUrl: site.uri.public + "/api/organisations",
useLoadingTransition: site.uf_table.use_loading_transition
});
// Bind creation button
bindOrganisationCreationButton($("#widget-organisations"));
// Bind registration button
bindOrganisationRegistrationButton($("#widget-organisations"));
// Bind table buttons
$("#widget-organisations").on("pagerComplete.ufTable", function () {
bindOrganisationButtons($(this));
});
} else {
$("#widget-deleted-organisations").ufTable({
dataUrl: site.uri.public + "/api/organisations/deleted",
useLoadingTransition: site.uf_table.use_loading_transition
});
// Bind table buttons
$("#widget-deleted-organisations").on("pagerComplete.ufTable", function () {
bindOrganisationButtons($(this));
});
}
});