Skip to content
This repository has been archived by the owner on Feb 6, 2021. It is now read-only.

Commit

Permalink
Fixed grouping within the catalog.
Browse files Browse the repository at this point in the history
Radio buttons are now given the "name" of their parent group.
This will undoubtably break someone elses configuration who used this bug
to create multi-leveld radio buttons. refs: geomoose/geomoose#8
  • Loading branch information
Dan Little committed Sep 18, 2013
1 parent e18f810 commit 44df402
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions geomoose/GeoMOOSE/Tab/Catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dojo.declare('GeoMOOSE.Tab._CatalogLayer', null, {

checkbox_id: '',

constructor: function(parent_id, layer_xml, multiple) {
constructor: function(parent_id, layer_xml, multiple, group_name) {
/* render ... */
var p = dojo.byId(parent_id);

Expand Down Expand Up @@ -75,12 +75,14 @@ dojo.declare('GeoMOOSE.Tab._CatalogLayer', null, {
}

var checkbox_class = dijit.form.CheckBox;
var construct_opts = {};

if(multiple === false) {
var checkbox_class = dijit.form.RadioButton;
construct_opts['name'] = group_name;
}

var cbox = new checkbox_class({}, checkbox);
var cbox = new checkbox_class(construct_opts, checkbox);
dojo.connect(cbox, 'onChange', dojo.hitch(this, function(v) {
/* toggle the paths values */
var paths = [];
Expand Down Expand Up @@ -265,7 +267,11 @@ dojo.declare('GeoMOOSE.Tab.Catalog', [GeoMOOSE.Tab], {
*/
renderLayer: function(groupElementId, layer_xml, overrideStatusList) {
var multiple = parseBoolean(layer_xml.parentNode.getAttribute('multiple'),true);
var layer = new GeoMOOSE.Tab._CatalogLayer(groupElementId, layer_xml, multiple);
var group_name = '';
if(multiple == false) {
group_name = layer_xml.parentNode.getAttribute('title');
}
var layer = new GeoMOOSE.Tab._CatalogLayer(groupElementId, layer_xml, multiple, group_name);
this.catalog_layers.push(layer);
},

Expand Down

0 comments on commit 44df402

Please sign in to comment.