From 38e562a3ac5410e98e4fac4e03b8e2eb48790764 Mon Sep 17 00:00:00 2001 From: Varakh Date: Sun, 10 Nov 2019 15:48:14 +0100 Subject: [PATCH] Use separate JavaScript file to initialize DataTables --- CHANGELOG.md | 3 +++ config/Constants.php | 2 +- public/theme/bootstrap4/js/custom.js | 8 ++++++++ src/View/bootstrap4/layout.twig | 11 +---------- 4 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 public/theme/bootstrap4/js/custom.js diff --git a/CHANGELOG.md b/CHANGELOG.md index aec2310..37aa020 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG +## 2.2.1 - 2019/11/10 +* Use separate JavaScript file to initialize DataTables + ## 2.2.0 - 2019/11/10 * Add version tag to footer * Add sortable tables diff --git a/config/Constants.php b/config/Constants.php index 848dc07..257e3b2 100644 --- a/config/Constants.php +++ b/config/Constants.php @@ -13,7 +13,7 @@ class Constants /** * Version tag */ - const VERSION = '2.2.1-SNAPSHOT'; + const VERSION = '2.2.1'; /** * Return constant by it's class name diff --git a/public/theme/bootstrap4/js/custom.js b/public/theme/bootstrap4/js/custom.js new file mode 100644 index 0000000..20e5e95 --- /dev/null +++ b/public/theme/bootstrap4/js/custom.js @@ -0,0 +1,8 @@ +$(document).ready(function () { + $('#table').DataTable({ + "language": { + "url": "/theme/bootstrap4/DataTables/en_dataTable.json" + }, + "paging": false + }); +}); \ No newline at end of file diff --git a/src/View/bootstrap4/layout.twig b/src/View/bootstrap4/layout.twig index 46aaacd..443913a 100644 --- a/src/View/bootstrap4/layout.twig +++ b/src/View/bootstrap4/layout.twig @@ -68,18 +68,9 @@ + {% block js %} - {% endblock %}