Shower::_applyTransform: refactoring for transform, forEach instead of copy/paste
This commit is contained in:
parent
b8a1ccdf5d
commit
c78cb0a8ad
14
shower.js
14
shower.js
|
@ -237,11 +237,15 @@ window.shower = window.shower || (function(window, document, undefined) {
|
||||||
* @returns {Boolean}
|
* @returns {Boolean}
|
||||||
*/
|
*/
|
||||||
shower._applyTransform = function(transform) {
|
shower._applyTransform = function(transform) {
|
||||||
body.style.WebkitTransform = transform;
|
[
|
||||||
body.style.MozTransform = transform;
|
'WebkitTransform',
|
||||||
body.style.msTransform = transform;
|
'MozTransform',
|
||||||
body.style.OTransform = transform;
|
'msTransform',
|
||||||
body.style.transform = transform;
|
'OTransform',
|
||||||
|
'transform',
|
||||||
|
].forEach(function(prop) {
|
||||||
|
body.style[prop] = transform;
|
||||||
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue