De-conflict asset bundles
This commit is contained in:
38
assets/organisations/js/pages/organisations.js
Normal file
38
assets/organisations/js/pages/organisations.js
Normal 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));
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user