Fix broken field demos (#3625)

This commit is contained in:
alschmiedt
2020-01-21 17:06:06 -08:00
committed by GitHub
parent 92a19d8340
commit 4efb917fc4
2 changed files with 5 additions and 9 deletions

View File

@@ -88,9 +88,8 @@ CustomFields.FieldPitch.prototype.showEditor_ = function() {
var editor = this.dropdownCreate_();
Blockly.DropDownDiv.getContentDiv().appendChild(editor);
var border = this.sourceBlock_.getColourBorder();
border = border.colourBorder || border.colourLight;
Blockly.DropDownDiv.setColour(this.sourceBlock_.getColour(), border);
Blockly.DropDownDiv.setColour(this.sourceBlock_.style.colourPrimary,
this.sourceBlock_.style.colourTertiary);
Blockly.DropDownDiv.showPositionedByField(
this, this.dropdownDispose_.bind(this));

View File

@@ -337,10 +337,8 @@ CustomFields.FieldTurtle.prototype.showEditor_ = function() {
// These allow us to have the editor match the block's colour.
var fillColour = this.sourceBlock_.getColour();
// This is technically a package function, meaning it could change.
var borderColours = this.sourceBlock_.getColourBorder();
var borderColour = borderColours.colourBorder || borderColours.colourDark;
Blockly.DropDownDiv.setColour(fillColour, borderColour);
Blockly.DropDownDiv.setColour(fillColour,
this.sourceBlock_.style.colourTertiary);
// Always pass the dropdown div a dispose function so that you can clean
// up event listeners when the editor closes.
@@ -483,9 +481,8 @@ CustomFields.FieldTurtle.prototype.updateColour = function() {
var fillColour = isShadow ?
this.sourceBlock_.getColourShadow() : this.sourceBlock_.getColour();
// This is technically a package function, meaning it could change.
var borderColours = this.sourceBlock_.getColourBorder();
var borderColour = isShadow ? fillColour :
borderColours.colourBorder || borderColours.colourDark;
this.sourceBlock_.style.colourTertiary;
var child = this.turtleGroup_.firstChild;
while(child) {