Skip to content

Commit

Permalink
support for custom text on js-delete (#508)
Browse files Browse the repository at this point in the history
* support for custom text on js-delete

* Update lib/IHP/static/helpers.js

Co-authored-by: Marc Scholten <[email protected]>

* Update lib/IHP/static/helpers.js

Co-authored-by: Marc Scholten <[email protected]>
  • Loading branch information
fegu and mpscholten authored Oct 27, 2020
1 parent 1557e04 commit 5870752
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/IHP/static/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ function initDelete() {
event.preventDefault();

if (!event.target.classList.contains('js-delete-no-confirm')) {
if (!confirm('Are you sure you want to delete this?')) {
var confirmText = event.target.dataset.confirm || 'Are you sure you want to delete this?';
if (!confirm(confirmText)) {
return;
}
}
Expand Down Expand Up @@ -371,4 +372,4 @@ if (!('allIntervals' in window)) {
var oldLength = window.allTimeouts.length;
window.allTimeouts = new Array(oldLength);
};
}
}

0 comments on commit 5870752

Please sign in to comment.