Skip to content
This repository
Browse code

Additional minor fixes with height. Releasing 1.1.

  • Loading branch information...
commit df3876293660fad5ef4e4c094cb45918e98b08e7 1 parent 3312600
Jacek Galanciak authored
13 RELEASE_NOTES.textile
Source Rendered
... ... @@ -0,0 +1,13 @@
  1 +h1. jQuery Quicksand plugin release notes
  2 +
  3 +h2. v1.1
  4 +
  5 +# Fixed issues with position: relative
  6 +# Fixed occasional flickering
  7 +# Moderate performance improvements
  8 +# Disabled any animation in IE6 for more safety
  9 +# Added support for jQuery 1.3
  10 +
  11 +h2. v1.0
  12 +
  13 +First, feature-complete release of jQuery Quicksand plugin.
22 jquery.quicksand.js
... ... @@ -1,6 +1,6 @@
1 1 /*
2 2
3   -Quicksand 1.0
  3 +Quicksand 1.1
4 4
5 5 Reorder and filter items with a nice shuffling animation.
6 6
@@ -73,7 +73,13 @@ Github site: http://github.com/razorjack/quicksand
73 73 var offsets = []; // coordinates of every source collection item
74 74
75 75 var $source = $(this).find(options.selector); // source collection items
76   -
  76 +
  77 + // Replace the collection and quit if IE6
  78 + if ($.browser.msie && $.browser.version.substr(0,1)<7) {
  79 + $sourceParent.html('').append($collection);
  80 + return;
  81 + }
  82 +
77 83 // Gets called when any animation is finished
78 84 var postCallbackPerformed = 0; // prevents the function from being called more than one time
79 85 var postCallback = function () {
@@ -87,6 +93,7 @@ Github site: http://github.com/razorjack/quicksand
87 93 }
88 94 };
89 95
  96 + // Position: relative situations
90 97 var $correctionParent = $sourceParent.offsetParent();
91 98 var correctionOffset = $correctionParent.offset();
92 99 if ($correctionParent.css('position') == 'relative') {
@@ -151,16 +158,11 @@ Github site: http://github.com/razorjack/quicksand
151 158 // If destination container has different height than source container
152 159 // the height can be animated, adjusting it to destination height
153 160 if (options.adjustHeight) {
154   - $sourceParent.animate({height: $dest.height()}, options.duration, options.easing, function (e) {
155   - $sourceParent.css('height', 'auto');
156   - });
  161 + $sourceParent.animate({height: $dest.height()}, options.duration, options.easing);
157 162 }
158   -
159   -
160   -
  163 +
161 164 // Now it's time to do shuffling animation
162   - // First of all, we need to identify same elements within
163   -
  165 + // First of all, we need to identify same elements within source and destination collections
164 166 $source.each(function (i) {
165 167 var destElement = $collection.filter('[' + options.attribute + '=' + $(this).attr(options.attribute) + ']');
166 168 if (destElement.length) {
12 jquery.quicksand.min.js
... ... @@ -1,6 +1,6 @@
1   -(function(a){a.fn.quicksand=function(v,n,s){function t(e){var c=[],f=a(e).get(0).nodeName.toLowerCase();if(a(e).attr("id"))f+="#"+a(e).attr("id");c.push(f);a(e).parentsUntil("html").each(function(){f=a(this).get(0).nodeName.toLowerCase();if(a(this).attr("id"))f+="#"+a(this).attr("id");c.push(f)});return c.reverse().join(" > ")}var b={duration:750,easing:"swing",attribute:"data-id",adjustHeight:true};a.extend(b,n);b.selector=null;a.extend(b,{selector:"> *"});var m;if(typeof n=="function")m=n;else if(typeof(s==
2   -"function"))m=s;return this.each(function(){var e=a(v).clone(),c=a(this);a(this).css("height");var f=a(c).offset(),p=[],i=parseFloat(a("body").css("border-left-width")),j=parseFloat(a("body").css("border-top-width")),k=a(this).find(b.selector),g=0,h=0,u=0,l=function(){if(!u){c.html(q.html());a("[data-quicksand-owner="+t(c)+"]").remove();typeof m=="function"&&m.call(this);u=1}};c.css("height",a(this).height());a(k.parentsUntil("html").toArray().reverse()).each(function(){if(a(this).css("position")==
3   -"relative"){o=a(this).offset();g=o.top;h=o.left}});k.each(function(d){p[d]=a(this).offset()});a(this).stop();k.each(function(d){a(this).stop();a(this).css("position","absolute").css("margin",0).css("top",p[d].top-parseFloat(a(this).css("margin-top"))+j-g).css("left",p[d].left-parseFloat(a(this).css("margin-left"))+i-h)});var q=a(c).clone().html("").attr("id","").attr("data-quicksand-owner",c.selector).css("height","auto").css("width",c.width()+"px").append(e);q.insertBefore(c).css("z-index",-1).css("opacity",
4   -0).css("margin",0).css("position","absolute").css("top",f.top+j-g).css("left",f.left+i-h).attr("data-quicksand-owner",t(c));b.adjustHeight&&c.animate({height:q.height()},b.duration,b.easing,function(){c.css("height","auto")});k.each(function(){var d=e.filter("["+b.attribute+"="+a(this).attr(b.attribute)+"]");if(d.length)a.browser.msie?a(this).animate({top:d.offset().top+j-g,left:d.offset().left+i-h,opacity:1},b.duration,b.easing,l):a(this).animate({top:d.offset().top+j-g,left:d.offset().left+i-h,
5   -opacity:1,scale:"1.0"},b.duration,b.easing,l);else a.browser.msie?a(this).animate({opacity:"0.0"},b.duration,b.easing,l):a(this).animate({opacity:"0.0",scale:"0.0"},b.duration,b.easing,l)});e.each(function(){var d=k.filter("["+b.attribute+"="+a(this).attr(b.attribute)+"]"),r=e.filter("["+b.attribute+"="+a(this).attr(b.attribute)+"]");if(d.length===0){d=a.browser.msie?{opacity:"1.0"}:{opacity:"1.0",scale:"1.0"};r.clone().css("position","absolute").css("margin",0).css("top",r.offset().top+j-g).css("left",
6   -r.offset().left+i-h).css("opacity",0).css("transform","scale(0.0)").appendTo(c).animate(d,b.duration,b.easing,l)}})})}})(jQuery);
  1 +(function(a){a.fn.quicksand=function(s,m,p){function q(e){var c=[];if(a(e).get(0)==undefined)return"";var h=a(e).get(0).nodeName.toLowerCase();if(a(e).attr("id"))h+="#"+a(e).attr("id");c.push(h);for(var i=[];a(e).get(0).nodeName.toLowerCase()!="html";){i.push(e);e=e.parent()}a(i).each(function(){h=a(this).get(0).nodeName.toLowerCase();if(a(this).attr("id"))h+="#"+a(this).attr("id");c.push(h)});return c.reverse().join(" > ")}var b={duration:750,easing:"swing",attribute:"data-id",adjustHeight:true};
  2 +a.extend(b,m);b.selector=null;a.extend(b,{selector:"> *"});var k;if(typeof m=="function")k=m;else if(typeof(p=="function"))k=p;return this.each(function(){var e=a(s).clone(),c=a(this);a(this).css("height");var h=a(c).offset(),i=[],l=a(this).find(b.selector);if(a.browser.msie&&a.browser.version.substr(0,1)<7)c.html("").append(e);else{var r=0,j=function(){if(!r){c.html(n.html());a("[data-quicksand-owner="+q(c)+"]").remove();typeof k=="function"&&k.call(this);r=1}},g=c.offsetParent(),d=g.offset();if(g.css("position")==
  3 +"relative"){if(g.get(0).nodeName.toLowerCase()!="body"){d.top+=parseFloat(g.css("border-top-width"));d.left+=parseFloat(g.css("border-left-width"))}}else{d.top-=parseFloat(g.css("border-top-width"));d.left-=parseFloat(g.css("border-left-width"));d.top-=parseFloat(g.css("margin-top"));d.left-=parseFloat(g.css("margin-left"))}c.css("height",a(this).height());l.each(function(f){i[f]=a(this).offset()});a(this).stop();l.each(function(f){a(this).stop();a(this).css("position","absolute").css("margin",0).css("top",
  4 +i[f].top-parseFloat(a(this).css("margin-top"))-d.top).css("left",i[f].left-parseFloat(a(this).css("margin-left"))-d.left)});var n=a(c).clone().html("").attr("id","").attr("data-quicksand-owner",c.selector).css("height","auto").css("width",c.width()+"px").append(e);n.insertBefore(c).css("z-index",1).css("opacity",0).css("margin",0).css("position","absolute").css("top",h.top-d.top).css("left",h.left-d.left).attr("data-quicksand-owner",q(c));b.adjustHeight&&c.animate({height:n.height()},b.duration,b.easing);
  5 +l.each(function(){var f=e.filter("["+b.attribute+"="+a(this).attr(b.attribute)+"]");if(f.length)a.browser.msie?a(this).animate({top:f.offset().top-d.top,left:f.offset().left-d.left,opacity:1},b.duration,b.easing,j):a(this).animate({top:f.offset().top-d.top,left:f.offset().left-d.left,opacity:1,scale:"1.0"},b.duration,b.easing,j);else a.browser.msie?a(this).animate({opacity:"0.0"},b.duration,b.easing,j):a(this).animate({opacity:"0.0",scale:"0.0"},b.duration,b.easing,j)});e.each(function(){var f=l.filter("["+
  6 +b.attribute+"="+a(this).attr(b.attribute)+"]"),o=e.filter("["+b.attribute+"="+a(this).attr(b.attribute)+"]");if(f.length===0){f=a.browser.msie?{opacity:"1.0"}:{opacity:"1.0",scale:"1.0"};o.clone().css("position","absolute").css("margin",0).css("top",o.offset().top-d.top).css("left",o.offset().left-d.left).css("opacity",0).css("transform","scale(0.0)").appendTo(c).animate(f,b.duration,b.easing,j)}})}})}})(jQuery);

0 comments on commit df38762

Please sign in to comment.
Something went wrong with that request. Please try again.