Bug 584699: quick fix to -moz-transform rendering bug

--HG--
extra : rebase_source : 89019c5a0acff884ab47f18b96503435c6a56e7e
This commit is contained in:
Michael Yoshitaka Erlewine 2010-08-09 00:06:54 -04:00
parent e08b14a0b9
commit fe7e48b482
2 changed files with 5 additions and 3 deletions

View File

@ -465,7 +465,7 @@ iQClass.prototype = {
// ----------
// Function: css
// Sets or gets CSS properties on the receiver. When setting certain numerical properties,
// will automatically add "px".
// will automatically add "px". A property can be removed by setting it to null.
//
// Possible call patterns:
// a: object, b: undefined - sets with properties from a
@ -508,7 +508,9 @@ iQClass.prototype = {
if (pixels[key] && typeof(value) != 'string')
value += 'px';
if (key.indexOf('-') != -1)
if (value == null) {
elem.style.removeProperty(key);
} else if (key.indexOf('-') != -1)
elem.style.setProperty(key, value, '');
else
elem.style[key] = value;

View File

@ -306,7 +306,7 @@ window.Item.prototype = {
// Function: setRotation
// Rotates the object to the given number of degrees.
setRotation: function(degrees) {
var value = "rotate(%deg)".replace(/%/, degrees);
var value = degrees ? "rotate(%deg)".replace(/%/, degrees) : null;
iQ(this.container).css({"-moz-transform": value});
},