mirror of
https://github.com/google/blockly.git
synced 2026-01-16 13:27:09 +01:00
Replace goog.dom.createDom for creating HTML
This commit is contained in:
@@ -30,7 +30,6 @@ goog.require('Blockly.Field');
|
||||
goog.require('Blockly.Msg');
|
||||
goog.require('Blockly.utils');
|
||||
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.math.Coordinate');
|
||||
goog.require('goog.userAgent');
|
||||
|
||||
@@ -193,7 +192,8 @@ Blockly.FieldTextInput.prototype.showInlineEditor_ = function(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 = document.createElement('input');
|
||||
htmlInput.className = 'blocklyHtmlInput';
|
||||
htmlInput.setAttribute('spellcheck', this.spellcheck_);
|
||||
var fontSize =
|
||||
(Blockly.FieldTextInput.FONTSIZE * this.workspace_.scale) + 'pt';
|
||||
@@ -301,7 +301,7 @@ Blockly.FieldTextInput.prototype.onHtmlInputChange_ = function(_e) {
|
||||
Blockly.FieldTextInput.prototype.validate_ = function() {
|
||||
var valid = true;
|
||||
if (!Blockly.FieldTextInput.htmlInput_) {
|
||||
throw TypeError('htmlInput not defined');
|
||||
throw Error('htmlInput not defined');
|
||||
}
|
||||
var htmlInput = Blockly.FieldTextInput.htmlInput_;
|
||||
if (this.sourceBlock_) {
|
||||
|
||||
@@ -58,7 +58,8 @@ Blockly.inject = function(container, opt_options) {
|
||||
throw Error('Error: container is not in current document.');
|
||||
}
|
||||
var options = new Blockly.Options(opt_options || {});
|
||||
var subContainer = goog.dom.createDom('div', 'injectionDiv');
|
||||
var subContainer = document.createElement('div');
|
||||
subContainer.className = 'injectionDiv';
|
||||
container.appendChild(subContainer);
|
||||
var svg = Blockly.createDom_(subContainer, options);
|
||||
|
||||
|
||||
@@ -156,7 +156,8 @@ Blockly.Toolbox.prototype.init = function() {
|
||||
* HTML container for the Toolbox menu.
|
||||
* @type {Element}
|
||||
*/
|
||||
this.HtmlDiv = goog.dom.createDom('div', 'blocklyToolboxDiv');
|
||||
this.HtmlDiv = document.createElement('div');
|
||||
this.HtmlDiv.className = 'blocklyToolboxDiv';
|
||||
this.HtmlDiv.setAttribute('dir', workspace.RTL ? 'RTL' : 'LTR');
|
||||
svg.parentNode.insertBefore(this.HtmlDiv, svg);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user