Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions jquery.transit.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
*
* http://ricostacruz.com/jquery.transit
* http://github.com/rstacruz/jquery.transit
*
* Reviewed by Simon SER to work with jQuery 1.8.2.
*
*/

(function($) {
Expand Down Expand Up @@ -603,12 +606,12 @@

$.cssHooks[prop] = {
get: function(elem) {
var t = $(elem).css('transform') || new Transform();
var t = ($(elem).css('transform') && $(elem).css('transform') != 'none') ? $(elem).css('transform') : new Transform();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a good idea to "cache" a reference to $(elem).css('transform') so you don't have to call $.fn.css 2 or 3 times.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right, here's a good fix : #77

return t.get(prop);
},

set: function(elem, value) {
var t = $(elem).css('transform') || new Transform();
var t = ($(elem).css('transform') && $(elem).css('transform') != 'none') ? $(elem).css('transform') : new Transform();
t.setFromString(prop, value);

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