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

Commit 6bd4ed9

Browse files
committed
Merge pull request #121 from ioos/issue60
Fixes #60 - Form gets filled in when going back but JS doesnt
2 parents 7bb97a0 + fdae30e commit 6bd4ed9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Diff for: ioos_catalog/static/js/servicemappings.js

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* have illegal characters.
66
*/
77
function sanitizeServiceUrl(serviceNames) {
8-
console.log(serviceNames);
98
if(!serviceNames || !serviceNames.length) {
109
return "null";
1110
}

Diff for: ioos_catalog/templates/index.html

+9
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ <h3>Dataset Overview</h3>
217217
}
218218

219219
$(function() {
220+
/* Keep any values that were auto-filled, typically from a cache or by clicking back */
221+
var autocompleteValue = $('#region-select').val();
222+
$('#region-select').val([]);
220223
$('#region-select').on('change', function() {
221224
updateTypeBtns(
222225
countsByProvider,
@@ -249,6 +252,12 @@ <h3>Dataset Overview</h3>
249252
{placement:'left',
250253
animation:false
251254
});
255+
/* If we had a value when the document loaded, apply it now */
256+
if(autocompleteValue !== null) {
257+
$('#region-select').val(autocompleteValue);
258+
$('#region-select').change();
259+
$('#region-select').trigger("chosen:updated");
260+
}
252261
});
253262

254263
function updateMap() {

0 commit comments

Comments
 (0)