Parcourir la source

Add a select/deselect all orientation checkbox.

opi il y a 10 ans
Parent
commit
d323acb1fb
2 fichiers modifiés avec 9 ajouts et 2 suppressions
  1. 6 1
      assets/main.js
  2. 3 1
      views/wifi-form.tpl

+ 6 - 1
assets/main.js

@@ -89,4 +89,9 @@ $( document ).ready(function() {
         else { $('#contrib-type-share').slideUp(); }
     });
 
-});
+    // select/deselect all checkbox
+    $('#orientation-all').change(function(e){
+        $('input[name="orientation"]').prop('checked', $(e.target).is(':checked') );
+    });
+
+});

+ 3 - 1
views/wifi-form.tpl

@@ -170,7 +170,9 @@ Un moyen de contact au moins est nécessaire
     <p class="help-block">Les antennes peuvent être positionées soit sur le toit soit aux fenêtres</p>
 
     <div class="form-group">
-    <label for="orientation" />Orientation(s) de mes fenêtres</label><br />
+    <label for="orientation" />Orientation(s) de mes fenêtres</label>
+    (<label class="ceckbox-inline"><input type="checkbox" name="orientation-all" id="orientation-all" value="" />Vue à 360°</label>)
+    <br>
 %for val, label in orientations:
     <label class="checkbox-inline">
       <input type="checkbox" name="orientation" value="{{val}}"