Change CSS transforms to work with older browsers (#879)

* Change the setting of the CSS transform properties on SVG nodes to set both the unprefixed version and the `-webkit-` prefixed version so that Blockly correctly renders in order browsers, such as Safari < 9 and iOS Safari < 9.2. For discussion of this issue, see https://groups.google.com/forum/#!topic/blockly/o3pERaRQhSg

* Correct the separation between the CSS transform property and the rest of the CSS that was in the variable misleadingly called "transform".
This commit is contained in:
Tim Dawborn
2017-01-28 04:19:58 +11:00
committed by picklesrus
parent 20d0730558
commit 39731c6ddc
5 changed files with 19 additions and 8 deletions

View File

@@ -856,3 +856,15 @@ Blockly.utils.runAfterPageLoad = function(fn) {
}, 10);
}
};
/**
* Sets the CSS transform property on an element. This function sets the
* non-vendor-prefixed and vendor-prefixed versions for backwards compatibility
* with older browsers. See http://caniuse.com/#feat=transforms2d
* @param {!Element} node The node which the CSS transform should be applied.
* @param {string} transform The value of the CSS `transform` property.
*/
Blockly.utils.setCssTransform = function(node, transform) {
node.style['transform'] = transform;
node.style['-webkit-transform'] = transform;
};