Move onclick handling of tou checkbox to ujs

This commit is contained in:
Simon Poole 2018-10-26 20:00:00 +02:00
parent 077834704e
commit d3d03a3177
2 changed files with 6 additions and 1 deletions

View file

@ -124,4 +124,9 @@ $(document).ready(function () {
$("#contributorTerms").html("<img src='" + OSM.SEARCHING + "' />");
$("#contributorTerms").load(url);
});
$("#read_tou").on("click", function () {
var agreebtn = document.getElementById('agree');
agreebtn.disabled=!this.checked;
});
});

View file

@ -47,7 +47,7 @@
<p class="deemphasize"><%= t '.tou_explain' %></p>
<div class="form-row">
<label for="read_tou">
<%= check_box_tag 'read_tou',1,false,:onclick=>"agreebtn = document.getElementById('agree');agreebtn.disabled=!this.checked;"%>
<%= check_box_tag 'read_tou',1,false %>
<%= t '.read_tou_html', :tou_link => link_to(t('layouts.tou'), "https://wiki.osmfoundation.org/wiki/Terms_of_Use", :target => :new) %>
</label>