Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions scoring/static/scoring/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,20 @@ forEachElement('[data-methodology-switch-council-type]', function(trigger){
});
});

// Trigger council type filter from URL parameter
// Example: /sections/?type=combined would make the filter above to select "Combined Authorities"
(function(){
var urlParams = new URLSearchParams(window.location.search);
var typeParam = urlParams.get('type');

if (typeParam) {
var trigger = document.querySelector('[data-methodology-switch-council-type="' + typeParam + '"]');
if (trigger) {
trigger.click();
}
}
})();

// Previous year comparison toggle on council page
forEachElement('#js-toggle-previous-year-score', function(el) {
el.addEventListener('change', function() {
Expand Down
Loading