mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Convert string tag name to goog.dom.TagName (#515)
in createDom calls only. This improves the type information of the created objects.
This commit is contained in:
parent
e03b191f73
commit
88eac2480b
4 changed files with 12 additions and 4 deletions
|
@ -30,6 +30,7 @@ goog.require('Blockly.Field');
|
|||
goog.require('Blockly.Msg');
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.dom.TagName');
|
||||
goog.require('goog.userAgent');
|
||||
|
||||
|
||||
|
@ -124,7 +125,8 @@ Blockly.FieldTextInput.prototype.showEditor_ = function(opt_quietInput) {
|
|||
Blockly.WidgetDiv.show(this, this.sourceBlock_.RTL, this.widgetDispose_());
|
||||
var div = Blockly.WidgetDiv.DIV;
|
||||
// Create the input.
|
||||
var htmlInput = goog.dom.createDom('input', 'blocklyHtmlInput');
|
||||
var htmlInput =
|
||||
goog.dom.createDom(goog.dom.TagName.INPUT, 'blocklyHtmlInput');
|
||||
htmlInput.setAttribute('spellcheck', this.spellcheck_);
|
||||
var fontSize =
|
||||
(Blockly.FieldTextInput.FONTSIZE * this.workspace_.scale) + 'pt';
|
||||
|
|
|
@ -28,6 +28,7 @@ goog.provide('Blockly.Toolbox');
|
|||
|
||||
goog.require('Blockly.Flyout');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.dom.TagName');
|
||||
goog.require('goog.events');
|
||||
goog.require('goog.events.BrowserFeature');
|
||||
goog.require('goog.html.SafeHtml');
|
||||
|
@ -147,7 +148,8 @@ Blockly.Toolbox.prototype.init = function() {
|
|||
var svg = this.workspace_.getParentSvg();
|
||||
|
||||
// Create an HTML container for the Toolbox menu.
|
||||
this.HtmlDiv = goog.dom.createDom('div', 'blocklyToolboxDiv');
|
||||
this.HtmlDiv =
|
||||
goog.dom.createDom(goog.dom.TagName.DIV, 'blocklyToolboxDiv');
|
||||
this.HtmlDiv.setAttribute('dir', workspace.RTL ? 'RTL' : 'LTR');
|
||||
svg.parentNode.insertBefore(this.HtmlDiv, svg);
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
goog.provide('Blockly.Tooltip');
|
||||
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.dom.TagName');
|
||||
|
||||
|
||||
/**
|
||||
|
@ -120,7 +121,8 @@ Blockly.Tooltip.createDom = function() {
|
|||
return; // Already created.
|
||||
}
|
||||
// Create an HTML container for popup overlays (e.g. editor widgets).
|
||||
Blockly.Tooltip.DIV = goog.dom.createDom('div', 'blocklyTooltipDiv');
|
||||
Blockly.Tooltip.DIV =
|
||||
goog.dom.createDom(goog.dom.TagName.DIV, 'blocklyTooltipDiv');
|
||||
document.body.appendChild(Blockly.Tooltip.DIV);
|
||||
};
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ goog.provide('Blockly.WidgetDiv');
|
|||
|
||||
goog.require('Blockly.Css');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.dom.TagName');
|
||||
goog.require('goog.style');
|
||||
|
||||
|
||||
|
@ -61,7 +62,8 @@ Blockly.WidgetDiv.createDom = function() {
|
|||
return; // Already created.
|
||||
}
|
||||
// Create an HTML container for popup overlays (e.g. editor widgets).
|
||||
Blockly.WidgetDiv.DIV = goog.dom.createDom('div', 'blocklyWidgetDiv');
|
||||
Blockly.WidgetDiv.DIV =
|
||||
goog.dom.createDom(goog.dom.TagName.DIV, 'blocklyWidgetDiv');
|
||||
document.body.appendChild(Blockly.WidgetDiv.DIV);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue