grocy/js/viewjs/locations.js
Katharina Bogad fd61d1ef62 viewjs: Wrap in fuctions
This commit's contents were auto-generated. They wrap all viewjs
in functions and define a common prologue.

New file contents:

```js
function VIEWNAMEView(Grocy, scope = null)
{
    var $scope = $;
    if(scope != null)
    {
        $scope = $(scope).find;
    }

    // original contents indented with \t

}
```
2021-06-22 22:56:57 +02:00

28 lines
668 B
JavaScript

function locationsView(Grocy, scope = null)
{
var $scope = $;
if (scope != null)
{
$scope = $(scope).find;
}
var locationsTable = $('#locations-table').DataTable({
'order': [[1, 'asc']],
'columnDefs': [
{ 'orderable': false, 'targets': 0 },
{ 'searchable': false, "targets": 0 }
].concat($.fn.dataTable.defaults.columnDefs)
});
$('#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'
);
}