Fix RTL mutators in Edge and IE

This commit is contained in:
Sam El-Husseini
2018-05-10 20:30:37 -07:00
committed by GitHub
parent 6319cab317
commit 87ab88954d

View File

@@ -371,8 +371,15 @@ Blockly.Flyout.prototype.updateDisplay_ = function() {
Blockly.Flyout.prototype.positionAt_ = function(width, height, x, y) {
this.svgGroup_.setAttribute("width", width);
this.svgGroup_.setAttribute("height", height);
var transform = 'translate(' + x + 'px,' + y + 'px)';
Blockly.utils.setCssTransform(this.svgGroup_, transform);
if (this.svgGroup_.tagName == 'svg') {
var transform = 'translate(' + x + 'px,' + y + 'px)';
Blockly.utils.setCssTransform(this.svgGroup_, transform);
} else {
// IE and Edge don't support CSS transforms on SVG elements so
// it's important to set the transform on the SVG element itself
var transform = 'translate(' + x + ',' + y + ')';
this.svgGroup_.setAttribute("transform", transform);
}
// Update the scrollbar (if one exists).
if (this.scrollbar_) {