mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
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:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user