Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

augmented accordionPicker to handle a "selected" parameter from the JSON file; if it's true, that parameter will be selected on startup

Ryan Bollerd864f9234efd
diff --git a/js/accordionPicker.js b/js/accordionPicker.js
index 235281ef9..10fedca57 100644
--- a/js/accordionPicker.js
+++ b/js/accordionPicker.js
@@ -130,6 +130,12 @@ SOTE.widget.AccordionPicker.prototype.render = function(){
catListItem.innerHTML = "<input value='"+item.value+"' class='accordionFormItem' name='"+this.id+item.type+"' id='"+id+"' type='"+type+"'"+" "+disabled+"/>";
catListItem.innerHTML += "<label for='"+id+"'><span class='accordionLabel'>"+item.label+"</span><span class='accordionSub'>"+item.sublabel+"</span></label>";
catList.appendChild(catListItem);
+
+ // If "selected" value is true in json, add current item to list of default selection(s)
+ if ((item.selected !== undefined) && (item.selected=="true"))
+ {
+ defaultSelection = defaultSelection + "." + item.value;
+ }
}
}
accordion.appendChild(catList);