]> git.0d.be Git - panikdb.git/commitdiff
regie: add confirmation dialog to switch buttons
authorFrédéric Péters <fpeters@0d.be>
Wed, 12 May 2021 11:17:16 +0000 (13:17 +0200)
committerFrédéric Péters <fpeters@0d.be>
Wed, 12 May 2021 11:17:16 +0000 (13:17 +0200)
panikdb/regie/templates/regie-home.html

index 8d6b0330ee36213b81e4c34e409c189e2498ab9d..6987559691e793fdf4b95e4e7a5d391540321871 100644 (file)
@@ -219,7 +219,9 @@ $(function() {
   };
   {% if is_regie_computer %}
   $('[data-switch]').on('click', function() {
-    $.get({url: "{% url 'regie-switch' %}?selection=" + $(this).data('switch')});
+    if (confirm('Basculer vers ' + $(this).text() + ' ?')) {
+      $.get({url: "{% url 'regie-switch' %}?selection=" + $(this).data('switch')});
+    }
   });
   {% endif %}
 });