Reset columns_selector before caching the page

This will allow to initialize this module again without duplicating
columns checkboxes and without breaking the page.
This commit is contained in:
Senén Rodero Rodríguez
2020-07-28 14:11:08 +02:00
parent 137e0f5a64
commit 87339451de
3 changed files with 26 additions and 0 deletions

View File

@@ -170,6 +170,7 @@ var initialize_modules = function() {
var destroy_non_idempotent_modules = function() {
"use strict";
App.ColumnsSelector.destroy();
App.Datepicker.destroy();
App.HTMLEditor.destroy();
App.LegislationAnnotatable.destroy();

View File

@@ -85,6 +85,9 @@
$(".column-selectable").on("inserted", function() {
App.ColumnsSelector.initColumns();
});
},
destroy: function() {
$("#js-columns-selector-wrapper").children(":not(#column_selector_item_template)").remove();
}
};
}).call(this);