Support %{..} in flyout_button (#1927) (#1929)

Expand %{..} references in toolbox <button> and <label>
This commit is contained in:
Andrew n marshall
2018-06-18 11:45:36 -07:00
committed by GitHub
parent f7e62262cc
commit 100d9f1a1c
2 changed files with 2 additions and 2 deletions

View File

@@ -161,7 +161,7 @@ Blockly.FlyoutButton.prototype.createDom = function() {
'text-anchor': 'middle'
},
this.svgGroup_);
svgText.textContent = this.text_;
svgText.textContent = Blockly.utils.replaceMessageReferences(this.text_);
this.width = Blockly.Field.getCachedWidth(svgText);
this.height = 20; // Can't compute it :(

View File

@@ -129,7 +129,7 @@ Blockly.Variables.allDeveloperVariables = function(workspace) {
Blockly.Variables.flyoutCategory = function(workspace) {
var xmlList = [];
var button = goog.dom.createDom('button');
button.setAttribute('text', Blockly.Msg['NEW_VARIABLE']);
button.setAttribute('text', '%{BKY_NEW_VARIABLE}');
button.setAttribute('callbackKey', 'CREATE_VARIABLE');
workspace.registerButtonCallback('CREATE_VARIABLE', function(button) {