Skip to content

Commit 0563000

Browse files
committed
Do not save state of tables when Prototype is still installed.
1 parent c7c15cf commit 0563000

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/webapp/js/table.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jQuery3(document).ready(function () {
99
*/
1010
function createDataTable(table) {
1111
const defaultConfiguration = {
12-
stateSave: table.attr('data-disable-state-save') !== 'true',
12+
stateSave: typeof Prototype !== 'object', // do not save state when Prototype is still loaded
1313
language: {
1414
emptyTable: 'Loading - please wait ...'
1515
},
@@ -67,7 +67,8 @@ jQuery3(document).ready(function () {
6767
};
6868
const tableConfiguration = JSON.parse(table.attr('data-table-configuration'));
6969
// overwrite/merge the default configuration with values from the provided table configuration
70-
const dataTable = table.DataTable(Object.assign(defaultConfiguration, tableConfiguration));
70+
const mergedConfiguration = Object.assign(defaultConfiguration, tableConfiguration);
71+
const dataTable = table.DataTable(mergedConfiguration);
7172
// add the buttons to the top of the table
7273
if (tableConfiguration.buttons) {
7374
dataTable

0 commit comments

Comments
 (0)