toggle settings with javascript

This commit is contained in:
Laura Klünder 2016-12-21 22:48:21 +01:00
parent 6aaba9a926
commit d11fbd9a83
3 changed files with 31 additions and 7 deletions

View file

@ -269,3 +269,12 @@ circle.pos {
footer {
text-align:center;
}
.showsettings {
display:none;
}
@media (min-width: 992px) {
.showsettings {
padding-top: 18px;
padding-bottom: 18px;
}
}

View file

@ -45,6 +45,14 @@ c3nav = {
$('#route-from-here').click(c3nav._click_route_from_here);
$('#route-to-here').click(c3nav._click_route_to_here);
$('.showsettings').show();
$('.savesettings, .settings').hide();
$('.showsettings a').click(function(e) {
e.preventDefault();
$('.showsettings').hide();
$('.savesettings, .settings').show();
});
window.onpopstate = c3nav._onpopstate;
},

View file

@ -51,15 +51,22 @@
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<div class="checkbox">
<label>
<input type="checkbox" name="save_settings" value="1"{% if save_settings %} checked{% endif %}> {% trans 'Save Settings in cookie' %}
</label>
<div class="col-md-6">
<div class="form-group">
<div class="checkbox savesettings">
<label>
<input type="checkbox" name="save_settings" value="1"{% if save_settings %} checked{% endif %}> {% trans 'Save Settings in cookie' %}
</label>
</div>
<div class="showsettings form-control-static">
<a href="#">{% trans 'Edit Settings' %}</a>
</div>
</div>
</div>
<div class="form-group col-md-6">
<button type="submit" id="submitbtn" class="btn btn-block btn-lg btn-primary">{% trans 'Get Route' %}</button>
<div class="col-md-6">
<div class="form-group">
<button type="submit" id="submitbtn" class="btn btn-block btn-lg btn-primary">{% trans 'Get Route' %}</button>
</div>
</div>
</div>
</div>