mirror of
https://github.com/google/blockly.git
synced 2026-03-12 16:20:12 +01:00
Remove goog.dom.removeChildren
HTML can be nullified with innerHTML, SVG needs a loop.
This commit is contained in:
@@ -437,7 +437,10 @@ Blockly.FieldDropdown.prototype.render_ = function() {
|
||||
// Update arrow's colour.
|
||||
this.arrow_.style.fill = this.sourceBlock_.getColour();
|
||||
}
|
||||
goog.dom.removeChildren(/** @type {!Element} */ (this.textElement_));
|
||||
var child;
|
||||
while ((child = this.textElement_.firstChild)) {
|
||||
this.textElement_.removeChild(child);
|
||||
}
|
||||
goog.dom.removeNode(this.imageElement_);
|
||||
this.imageElement_ = null;
|
||||
|
||||
|
||||
@@ -133,7 +133,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 = document.createElement('div');
|
||||
Blockly.Tooltip.DIV.className = 'blocklyTooltipDiv';
|
||||
document.body.appendChild(Blockly.Tooltip.DIV);
|
||||
};
|
||||
|
||||
@@ -287,7 +288,7 @@ Blockly.Tooltip.show_ = function() {
|
||||
return;
|
||||
}
|
||||
// Erase all existing text.
|
||||
goog.dom.removeChildren(/** @type {!Element} */ (Blockly.Tooltip.DIV));
|
||||
Blockly.Tooltip.DIV.innerHTML = '';
|
||||
// Get the new text.
|
||||
var tip = Blockly.Tooltip.element_.tooltip;
|
||||
while (typeof tip == 'function') {
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
goog.provide('Blockly.WidgetDiv');
|
||||
|
||||
goog.require('Blockly.Css');
|
||||
goog.require('goog.dom');
|
||||
goog.require('goog.style');
|
||||
|
||||
|
||||
@@ -65,7 +64,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 = document.createElement('div');
|
||||
Blockly.WidgetDiv.DIV.className = 'blocklyWidgetDiv';
|
||||
document.body.appendChild(Blockly.WidgetDiv.DIV);
|
||||
};
|
||||
|
||||
@@ -99,7 +99,7 @@ Blockly.WidgetDiv.hide = function() {
|
||||
Blockly.WidgetDiv.DIV.style.top = '';
|
||||
Blockly.WidgetDiv.dispose_ && Blockly.WidgetDiv.dispose_();
|
||||
Blockly.WidgetDiv.dispose_ = null;
|
||||
goog.dom.removeChildren(Blockly.WidgetDiv.DIV);
|
||||
Blockly.WidgetDiv.DIV.innerHTML = '';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user