Skip to content

Commit

Permalink
Move onclick handling of tou checkbox to ujs
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpoole committed Oct 26, 2018
1 parent 4e4ee6f commit 82e42b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/assets/javascripts/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,9 @@ $(document).ready(function () {
$("#contributorTerms").html("<img src='" + OSM.SEARCHING + "' />");
$("#contributorTerms").load(url);
});

$("#read_tou").on("click", function () {
agreebtn = document.getElementById('agree');
agreebtn.disabled=!this.checked;
});
});
2 changes: 1 addition & 1 deletion app/views/users/terms.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,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>

Expand Down

0 comments on commit 82e42b3

Please sign in to comment.