mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Undo workaround for IE10.
Due to no longer supporting IE10, we don’t need the code added here: 92f3880008
This commit is contained in:
@@ -429,7 +429,7 @@ Blockly.BlockSvg.prototype.moveDuringDrag = function(newLoc) {
|
||||
* @private
|
||||
*/
|
||||
Blockly.BlockSvg.prototype.clearTransformAttributes_ = function() {
|
||||
Blockly.utils.removeAttribute(this.getSvgRoot(), 'transform');
|
||||
this.getSvgRoot().removeAttribute('transform');
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1194,7 +1194,7 @@ Blockly.BlockSvg.prototype.setHighlighted = function(highlighted) {
|
||||
'url(#' + this.workspace.options.embossFilterId + ')');
|
||||
this.svgPathLight_.style.display = 'none';
|
||||
} else {
|
||||
Blockly.utils.removeAttribute(this.svgPath_, 'filter');
|
||||
this.svgPath_.removeAttribute('filter');
|
||||
delete this.svgPathLight_.style.display;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -36,22 +36,6 @@ goog.require('goog.dom');
|
||||
goog.require('goog.math.Coordinate');
|
||||
|
||||
|
||||
/**
|
||||
* Remove an attribute from a element even if it's in IE 10.
|
||||
* Similar to Element.removeAttribute() but it works on SVG elements in IE 10.
|
||||
* Sets the attribute to null in IE 10, which treats removeAttribute as a no-op
|
||||
* if it's called on an SVG element.
|
||||
* @param {!Element} element DOM element to remove attribute from.
|
||||
* @param {string} attributeName Name of attribute to remove.
|
||||
*/
|
||||
Blockly.utils.removeAttribute = function(element, attributeName) {
|
||||
if (Blockly.utils.userAgent.IE10) {
|
||||
element.setAttribute(attributeName, null);
|
||||
} else {
|
||||
element.removeAttribute(attributeName);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a CSS class to a element.
|
||||
* Similar to Closure's goog.dom.classes.add, except it handles SVG elements.
|
||||
@@ -93,7 +77,7 @@ Blockly.utils.removeClass = function(element, className) {
|
||||
if (classList.length) {
|
||||
element.setAttribute('class', classList.join(' '));
|
||||
} else {
|
||||
Blockly.utils.removeAttribute(element, 'class');
|
||||
element.removeAttribute('class');
|
||||
}
|
||||
return true;
|
||||
};
|
||||
@@ -1060,7 +1044,6 @@ Blockly.utils.userAgent = {};
|
||||
// Browsers. Logic from:
|
||||
// https://github.com/google/closure-library/blob/master/closure/goog/labs/useragent/browser.js
|
||||
Blockly.utils.userAgent.IE = has('Trident') || has('MSIE');
|
||||
Blockly.utils.userAgent.IE10 = has('MSIE 10.0'); // 10.1 does not exist.
|
||||
Blockly.utils.userAgent.EDGE = has('Edge');
|
||||
// Useragent for JavaFX:
|
||||
// Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.44
|
||||
|
||||
@@ -410,7 +410,7 @@ Blockly.WorkspaceCommentSvg.prototype.moveTo = function(x, y) {
|
||||
* @private
|
||||
*/
|
||||
Blockly.WorkspaceCommentSvg.prototype.clearTransformAttributes_ = function() {
|
||||
Blockly.utils.removeAttribute(this.getSvgRoot(), 'transform');
|
||||
this.getSvgRoot().removeAttribute('transform');
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user