rstacruz/jquery.transit — pull request #85 by zhenglong (2012-10-14 01:02:00+00:00)
Title: fixes issue #82

index 3ebae61..830aeb2 100644
--- a/jquery.transit.js
+++ b/jquery.transit.js
@@ -106,7 +106,7 @@
$.cssHooks.transform = {
// The getter returns a `Transform` object.
get: function(elem) {
- return $(elem).data('transform');
+ return $(elem).data('transform') || new Transform();
},

// The setter accepts a `Transform` object or a string.
@@ -603,12 +603,12 @@

$.cssHooks[prop] = {
get: function(elem) {
- var t = $(elem).css('transform') || new Transform();
+ var t = $(elem).css('transform');
return t.get(prop);
},

set: function(elem, value) {
- var t = $(elem).css('transform') || new Transform();
+ var t = $(elem).css('transform');
t.setFromString(prop, value);

$(elem).css({ transform: t });