From ba74d8912c02c11442d78982d089e05eb5e93ff6 Mon Sep 17 00:00:00 2001 From: Tymewalk Date: Wed, 22 Feb 2017 14:47:12 -0600 Subject: [PATCH] Revert "Make it one if instead of two" This reverts commit e3ca6578ac3252c2e146d407e7e3282e865baff6. --- core/field_dropdown.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/field_dropdown.js b/core/field_dropdown.js index c7971e42b6..32258f90fe 100644 --- a/core/field_dropdown.js +++ b/core/field_dropdown.js @@ -237,11 +237,13 @@ Blockly.FieldDropdown.prototype.onHide = function() { this.dropDownOpen_ = false; // Update colour to look selected. if (!this.disableColourChange_) { - if (this.sourceBlock_ && this.sourceBlock_.isShadow()) { - this.sourceBlock_.setColour(this.savedPrimary_, - this.sourceBlock_.getColourSecondary(), this.sourceBlock_.getColourTertiary()); - } else if (this.box_) { - this.box_.setAttribute('fill', this.sourceBlock_.getColour()); + if (this.sourceBlock_) { + if (this.sourceBlock_.isShadow()) { + this.sourceBlock_.setColour(this.savedPrimary_, + this.sourceBlock_.getColourSecondary(), this.sourceBlock_.getColourTertiary()); + } else if (this.box_) { + this.box_.setAttribute('fill', this.sourceBlock_.getColour()); + } } } };