-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add gif region for a more dynamic region view
- Loading branch information
Showing
3 changed files
with
63 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
var defaultRegion = 'northwest_atlantic'; | ||
|
||
$(document).ready(function() { | ||
// Listen for changes in the radio buttons | ||
$('input[name="regionOptions"]').change(function() { | ||
// Get the ID of the selected label | ||
var labelId = $(this).next('label').attr('for'); | ||
console.log('Portal default region :', labelId); | ||
// change all regions to the radio options | ||
chooseDefaultRegion('reg-mom-cobalt',labelId) | ||
}); | ||
}); | ||
|
||
|
||
// function for create option for general options | ||
function chooseDefaultRegion(selectClass,defaultValue) { | ||
let elms = document.getElementsByClassName(selectClass); | ||
// loop through all region dropdown with the selectClassName | ||
for(let i = 0; i < elms.length; i++) { | ||
// Set the default option based on the option value | ||
elms[i].value = defaultValue | ||
} | ||
}; |