Skip to content

Commit

Permalink
Improved arch support for combobox, see phetsims/sun#162 and #34
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Mar 6, 2015
1 parent 76d4d6b commit f6130b7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
10 changes: 9 additions & 1 deletion js/concentration-api-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ define( function( require ) {
'concentrationScreen.concentrationMeterProbe': 'concentrationScreen.view.concentrationMeterNode.probeNode',

// TODO: Could be confusing here to refer to the button of the combobox as the combo box
'concentrationScreen.soluteComboBox': 'concentrationScreen.view.soluteControls.soluteComboBox.buttonNode'
'concentrationScreen.soluteComboBox': 'concentrationScreen.view.soluteControls.soluteComboBox.buttonNode',
'concentrationScreen.soluteComboBox.drinkMixButton': 'concentrationScreen.view.soluteControls.soluteComboBox.itemNodeList.drinkMix',
'concentrationScreen.soluteComboBox.cobaltIINitrate': 'concentrationScreen.view.soluteControls.soluteComboBox.itemNodeList.cobaltIINitrate',
'concentrationScreen.soluteComboBox.cobaltChloride': 'concentrationScreen.view.soluteControls.soluteComboBox.itemNodeList.cobaltChloride',
'concentrationScreen.soluteComboBox.potassiumDichromate': 'concentrationScreen.view.soluteControls.soluteComboBox.itemNodeList.potassiumDichromate',
'concentrationScreen.soluteComboBox.potassiumChromate': 'concentrationScreen.view.soluteControls.soluteComboBox.itemNodeList.potassiumChromate',
'concentrationScreen.soluteComboBox.nickelIIChloride': 'concentrationScreen.view.soluteControls.soluteComboBox.itemNodeList.nickelIIChloride',
'concentrationScreen.soluteComboBox.copperSulfate': 'concentrationScreen.view.soluteControls.soluteComboBox.itemNodeList.copperSulfate',
'concentrationScreen.soluteComboBox.potassiumPermanganate': 'concentrationScreen.view.soluteControls.soluteComboBox.itemNodeList.potassiumPermanganate',
};
} );
17 changes: 16 additions & 1 deletion js/concentration-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ define( function( require ) {
parent: Node // not exactly a button, see implementation
};

var ComboBoxButton = {
name: 'ComboBoxButton',
parent: Node // Also a special case
};

// Use explicit names for id keys so they will match what researchers see in data files
// Use id and type instead of componentID and typeID to simplify things for researchers
// Use a map so that JS will help us check that there are no duplicate names.
Expand Down Expand Up @@ -91,6 +96,16 @@ define( function( require ) {
},
'concentrationScreen.soluteComboBox': {
type: ComboBox
}
},
'concentrationScreen.soluteComboBox.drinkMixButton': {
type: ComboBoxButton
},
'concentrationScreen.soluteComboBox.cobaltIINitrate': { type: ComboBoxButton },
'concentrationScreen.soluteComboBox.cobaltChloride': { type: ComboBoxButton },
'concentrationScreen.soluteComboBox.potassiumDichromate': { type: ComboBoxButton },
'concentrationScreen.soluteComboBox.potassiumChromate': { type: ComboBoxButton },
'concentrationScreen.soluteComboBox.nickelIIChloride': { type: ComboBoxButton },
'concentrationScreen.soluteComboBox.copperSulfate': { type: ComboBoxButton },
'concentrationScreen.soluteComboBox.potassiumPermanganate': { type: ComboBoxButton }
};
} );

0 comments on commit f6130b7

Please sign in to comment.