Skip to content

Commit

Permalink
Show/hide constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
EGiataganas committed Oct 23, 2024
1 parent cf71783 commit f7dedeb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/components/site_map_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
entity,
true,
class: "govuk-checkboxes__input",
id: "constraint_#{planning_application_constraint.planning_data_dataset}_#{index}"
id: "constraint_#{planning_application_constraint.planning_data_dataset}_#{index}",
data: {action: "change->map#handleEvent"}
)%>
<%= label_tag(
"constraint_#{planning_application_constraint.planning_data_dataset}_#{index}",
Expand Down
8 changes: 8 additions & 0 deletions app/javascript/controllers/map_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,14 @@ export default class extends Controller {
}
}

handleEvent(ev) {
if (ev.target.checked) {
console.log("true");
} else {
console.log("false");
}
}

filterNeighbourList(latlng) {
if (latlng !== null) {
this.showMapData({ target: this.element.querySelector("button") })
Expand Down

0 comments on commit f7dedeb

Please sign in to comment.