mirror of
https://github.com/google/blockly.git
synced 2026-01-09 18:10:08 +01:00
Remove empty span from toolbox.
Every row started with this useless tag: <span role=“presentation”></span>
This commit is contained in:
@@ -178,13 +178,7 @@ Blockly.tree.BaseNode.prototype.initAccessibility = function() {
|
||||
|
||||
var img = this.getIconElement();
|
||||
if (img) {
|
||||
Blockly.utils.aria.setRole(img,
|
||||
Blockly.utils.aria.Role.PRESENTATION + '1');
|
||||
}
|
||||
var ei = this.getExpandIconElement();
|
||||
if (ei) {
|
||||
Blockly.utils.aria.setRole(ei,
|
||||
Blockly.utils.aria.Role.PRESENTATION + '2');
|
||||
Blockly.utils.aria.setRole(img, Blockly.utils.aria.Role.PRESENTATION);
|
||||
}
|
||||
|
||||
var ce = this.getChildrenElement();
|
||||
@@ -655,7 +649,6 @@ Blockly.tree.BaseNode.prototype.getRowDom = function() {
|
||||
row.setAttribute('class', this.getRowClassName());
|
||||
row.setAttribute('style', style);
|
||||
|
||||
row.appendChild(this.getExpandIconDom());
|
||||
row.appendChild(this.getIconDom());
|
||||
row.appendChild(this.getLabelDom());
|
||||
|
||||
@@ -704,14 +697,6 @@ Blockly.tree.BaseNode.prototype.getCalculatedIconClass = function() {
|
||||
throw Error('unimplemented abstract method');
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {!Element} The source for the icon.
|
||||
* @protected
|
||||
*/
|
||||
Blockly.tree.BaseNode.prototype.getExpandIconDom = function() {
|
||||
return document.createElement('span');
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {string} The line style.
|
||||
* @protected
|
||||
@@ -754,22 +739,13 @@ Blockly.tree.BaseNode.prototype.getRowElement = function() {
|
||||
return el ? /** @type {Element} */ (el.firstChild) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {Element} The expanded icon element.
|
||||
* @protected
|
||||
*/
|
||||
Blockly.tree.BaseNode.prototype.getExpandIconElement = function() {
|
||||
var el = this.getRowElement();
|
||||
return el ? /** @type {Element} */ (el.firstChild) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {Element} The icon element.
|
||||
* @protected
|
||||
*/
|
||||
Blockly.tree.BaseNode.prototype.getIconElement = function() {
|
||||
var el = this.getRowElement();
|
||||
return el ? /** @type {Element} */ (el.childNodes[1]) : null;
|
||||
return el ? /** @type {Element} */ (el.firstChild) : null;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -845,10 +821,6 @@ Blockly.tree.BaseNode.prototype.updateRow = function() {
|
||||
* @protected
|
||||
*/
|
||||
Blockly.tree.BaseNode.prototype.updateExpandIcon = function() {
|
||||
var img = this.getExpandIconElement();
|
||||
if (img) {
|
||||
img.className = this.config_.cssTreeIcon;
|
||||
}
|
||||
var cel = this.getChildrenElement();
|
||||
if (cel) {
|
||||
cel.style.backgroundPosition = this.getBackgroundPosition();
|
||||
|
||||
@@ -137,12 +137,6 @@ Blockly.tree.TreeControl.prototype.getIconElement = function() {
|
||||
return el ? /** @type {Element} */ (el.firstChild) : null;
|
||||
};
|
||||
|
||||
/** @override */
|
||||
Blockly.tree.TreeControl.prototype.getExpandIconElement = function() {
|
||||
// no expand icon for root element
|
||||
return null;
|
||||
};
|
||||
|
||||
/** @override */
|
||||
Blockly.tree.TreeControl.prototype.updateExpandIcon = function() {
|
||||
// no expand icon
|
||||
|
||||
Reference in New Issue
Block a user