Merge pull request #1846 from samelhusseini/patch-2

Fix RTL mutators in Edge and IE
This commit is contained in:
Rachel Fenichel
2018-05-11 11:26:59 -07:00
committed by GitHub

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_) {