Hack datepicker to make it work with Turbolinks 5.x

Patch extracted from here the comments on turbolinks issue 253 and
converted to vanilla javascript.

The hide action over datepickers ensures us that opened datepickers
will be closed before leving the page. Previously if you open any
datepicker and then move to previous page you will keep seeing the
datepicker in the restored page.
This commit is contained in:
Senén Rodero Rodríguez
2020-07-02 12:24:32 +02:00
parent 6bb9ebf12f
commit da658f3d8c
3 changed files with 61 additions and 0 deletions

View File

@@ -111,6 +111,7 @@
//= require cookies
//= require columns_selector
//= require budget_edit_associations
//= require datepicker
var initialize_modules = function() {
"use strict";
@@ -169,6 +170,7 @@ var initialize_modules = function() {
var destroy_non_idempotent_modules = function() {
"use strict";
App.Datepicker.destroy();
App.HTMLEditor.destroy();
};