diff --git a/config/asset_compress.ini b/config/asset_compress.ini index c8c32b8..0fb8b0e 100644 --- a/config/asset_compress.ini +++ b/config/asset_compress.ini @@ -10,7 +10,7 @@ files[]=https://cdn.jsdelivr.net/npm/jquery@3.7/dist/jquery.min.js files[]=https://cdn.jsdelivr.net/npm/bootstrap@5.3/dist/js/bootstrap.bundle.min.js files[]=https://cdn.jsdelivr.net/npm/flatpickr@4.6 files[]=https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js -files[]=https://cdn.jsdelivr.net/npm/jquery.dirtyforms@2.0/jquery.dirtyforms.min.js +files[]=https://cdn.jsdelivr.net/npm/jquery.dirtyforms@2.0 [crudview.js] files[]=plugin:CrudView:js/local.js diff --git a/webroot/js/local.js b/webroot/js/local.js index e6550cb..cec10c9 100644 --- a/webroot/js/local.js +++ b/webroot/js/local.js @@ -14,7 +14,9 @@ var CrudView = { }, flatpickr: function (selector) { - $(selector).flatpickr(); + if ($.flatpickr) { + $(selector).flatpickr(); + } }, select2: function (selector) { @@ -78,8 +80,10 @@ var CrudView = { }, dirtyForms: function () { - $.DirtyForms.dialog = false; - $('form[data-dirty-check=1]').dirtyForms(); + if ($.DirtyForms) { + $.DirtyForms.dialog = false; + $('form[data-dirty-check=1]').dirtyForms(); + } }, dropdown: function () {