diff --git a/core/field_colour.js b/core/field_colour.js index 62fc44a73..54bfc532e 100644 --- a/core/field_colour.js +++ b/core/field_colour.js @@ -99,6 +99,22 @@ Blockly.FieldColour.prototype.titles_ = null; */ Blockly.FieldColour.prototype.columns_ = 0; +/** + * Border colour for the dropdown div showing the colour picker. Must be a CSS + * string. + * @type {string} + * @private + */ +Blockly.FieldColour.prototype.DROPDOWN_BORDER_COLOUR = 'silver'; + +/** + * Background colour for the dropdown div showing the colour picker. Must be a + * CSS string. + * @type {string} + * @private + */ +Blockly.FieldColour.prototype.DROPDOWN_BACKGROUND_COLOUR = 'white'; + /** * Install this field on a block. */ @@ -267,9 +283,8 @@ Blockly.FieldColour.prototype.showEditor_ = function() { var picker = this.createWidget_(); Blockly.DropDownDiv.getContentDiv().appendChild(picker); - // Dropdown div accepts CSS colours. - // But maybe this should be done with a class instead? - Blockly.DropDownDiv.setColour('white', 'silver'); + Blockly.DropDownDiv.setColour( + this.DROPDOWN_BACKGROUND_COLOUR, this.DROPDOWN_BORDER_COLOUR); Blockly.DropDownDiv.showPositionedByField(this);