Skip to content

Commit

Permalink
Merge pull request #342 from FriendsOfCake/feat/js
Browse files Browse the repository at this point in the history
Fix error for optional JS features
  • Loading branch information
ADmad authored Nov 29, 2024
2 parents 21af8d0 + 9d84026 commit 82c58db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/asset_compress.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ files[]=https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
files[]=https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js
files[]=https://cdn.jsdelivr.net/npm/[email protected]
files[]=https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js
files[]=https://cdn.jsdelivr.net/npm/[email protected]/jquery.dirtyforms.min.js
files[]=https://cdn.jsdelivr.net/npm/[email protected]

[crudview.js]
files[]=plugin:CrudView:js/local.js
10 changes: 7 additions & 3 deletions webroot/js/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ var CrudView = {
},

flatpickr: function (selector) {
$(selector).flatpickr();
if ($.flatpickr) {
$(selector).flatpickr();
}
},

select2: function (selector) {
Expand Down Expand Up @@ -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 () {
Expand Down

0 comments on commit 82c58db

Please sign in to comment.