mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-09-21 19:39:08 +03:00
Add "defer" for inline Javascript
* Also utilize ECMAScript 6, 2015 syntax
This commit is contained in:
parent
607c9676f5
commit
1fa5d79813
|
@ -62,17 +62,17 @@
|
|||
{% block inline_javascript %}
|
||||
{{ block.super }}
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
var message = "{% trans 'Do you really want to remove the selected e-mail address?' %}";
|
||||
var actions = document.getElementsByName('action_remove');
|
||||
window.addEventListener('DOMContentLoaded',function() {
|
||||
const message = "{% trans 'Do you really want to remove the selected e-mail address?' %}";
|
||||
const actions = document.getElementsByName('action_remove');
|
||||
if (actions.length) {
|
||||
actions[0].addEventListener("click", function(e) {
|
||||
if (! confirm(message)) {
|
||||
if (!confirm(message)) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
})();
|
||||
});
|
||||
|
||||
$('.form-group').removeClass('row');
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue
Block a user