Shower::_applyTransform: refactoring for transform, forEach instead of copy/paste

This commit is contained in:
miripiruni 2013-05-03 20:51:00 +04:00
parent b8a1ccdf5d
commit c78cb0a8ad
1 changed files with 9 additions and 5 deletions

View File

@ -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;
}; };