Misc cleanup.

This commit is contained in:
Neil Fraser
2016-01-15 15:36:06 -08:00
parent 4b0ed0d372
commit 36fe3994c9
11 changed files with 83 additions and 70 deletions

View File

@@ -265,6 +265,9 @@ Blockly.FieldDropdown.prototype.getValue = function() {
* @param {string} newValue New value to set.
*/
Blockly.FieldDropdown.prototype.setValue = function(newValue) {
if (newValue === null || newValue === this.value_) {
return; // No change if null.
}
this.value_ = newValue;
// Look up and display the human-readable text.
var options = this.getOptions_();