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:
Rodrigo Queiro 2016-08-19 12:55:45 +02:00 committed by Neil Fraser
parent e03b191f73
commit 88eac2480b
4 changed files with 12 additions and 4 deletions

View file

@ -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';

View file

@ -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);

View file

@ -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);
};

View file

@ -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);
};