Skip to content
This repository has been archived by the owner on Oct 18, 2019. It is now read-only.

Commit

Permalink
Merge pull request #121 from ioos/issue60
Browse files Browse the repository at this point in the history
Fixes #60 - Form gets filled in when going back but JS doesnt
  • Loading branch information
benjwadams committed Aug 29, 2014
2 parents 7bb97a0 + fdae30e commit 6bd4ed9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion ioos_catalog/static/js/servicemappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* have illegal characters.
*/
function sanitizeServiceUrl(serviceNames) {
console.log(serviceNames);
if(!serviceNames || !serviceNames.length) {
return "null";
}
Expand Down
9 changes: 9 additions & 0 deletions ioos_catalog/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ <h3>Dataset Overview</h3>
}

$(function() {
/* Keep any values that were auto-filled, typically from a cache or by clicking back */
var autocompleteValue = $('#region-select').val();
$('#region-select').val([]);
$('#region-select').on('change', function() {
updateTypeBtns(
countsByProvider,
Expand Down Expand Up @@ -249,6 +252,12 @@ <h3>Dataset Overview</h3>
{placement:'left',
animation:false
});
/* If we had a value when the document loaded, apply it now */
if(autocompleteValue !== null) {
$('#region-select').val(autocompleteValue);
$('#region-select').change();
$('#region-select').trigger("chosen:updated");
}
});

function updateMap() {
Expand Down

0 comments on commit 6bd4ed9

Please sign in to comment.