mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-07-18 12:02:26 +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 inline_javascript %}
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
(function() {
|
window.addEventListener('DOMContentLoaded',function() {
|
||||||
var message = "{% trans 'Do you really want to remove the selected e-mail address?' %}";
|
const message = "{% trans 'Do you really want to remove the selected e-mail address?' %}";
|
||||||
var actions = document.getElementsByName('action_remove');
|
const actions = document.getElementsByName('action_remove');
|
||||||
if (actions.length) {
|
if (actions.length) {
|
||||||
actions[0].addEventListener("click", function(e) {
|
actions[0].addEventListener("click", function(e) {
|
||||||
if (! confirm(message)) {
|
if (!confirm(message)) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})();
|
});
|
||||||
|
|
||||||
$('.form-group').removeClass('row');
|
$('.form-group').removeClass('row');
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user