grocy/js/viewjs/locations.js
Katharina Bogad 2fbcefa8fd viewjs: scoped jquery
Most instances of $ have been replaced by $scope.
2021-06-23 15:00:53 +02:00

28 lines
678 B
JavaScript

function locationsView(Grocy, scope = null)
{
var $scope = $;
if (scope != null)
{
$scope = $(scope).find;
}
var locationsTable = $scope('#locations-table').DataTable({
'order': [[1, 'asc']],
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 }
].concat($.fn.dataTable.defaults.columnDefs)
});
$scope('#locations-table tbody').removeClass("d-none");
Grocy.FrontendHelpers.InitDataTable(locationsTable,);
Grocy.FrontendHelpers.MakeDeleteConfirmBox(
'Are you sure to delete location "%s"?',
'.location-delete-button',
'data-location-name',
'data-location-id',
'objects/locations/',
'/locations'
);
}