Browse Source

src : isoTransform.set : cache $(elem); better namespace for data 'isoTransform'

pull/27/head
David DeSandro 14 years ago
parent
commit
03144305cd
  1. 11
      jquery.isotope.js

11
jquery.isotope.js

@ -184,15 +184,16 @@
, ,
set : function( elem, name, value ) { set : function( elem, name, value ) {
var $elem = $(elem),
// unpack current transform data // unpack current transform data
var data = $( elem ).data('transform') || {}, data = $elem.data('isoTransform') || {},
// extend new value over current data
newData = {}, newData = {},
fnName, fnName,
transformObj = {}; transformObj = {};
// overwrite new data
// i.e. newData.scale = 0.5
newData[ name ] = value; newData[ name ] = value;
// extend new value over current data
$.extend( data, newData ); $.extend( data, newData );
for ( fnName in data ) { for ( fnName in data ) {
@ -210,7 +211,7 @@
valueFns = translateFn + scaleFn; valueFns = translateFn + scaleFn;
// set data back in elem // set data back in elem
$( elem ).data( 'transform', data ); $elem.data( 'isoTransform', data );
// set name to vendor specific property // set name to vendor specific property
elem.style[ isoTransform.transformProp ] = valueFns; elem.style[ isoTransform.transformProp ] = valueFns;

Loading…
Cancel
Save