Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

minified version with google closure using simple optimization

  • Loading branch information...
commit 051b641c1f32cafefdae62a99ebed3e072d47f8e 1 parent f9524e6
@andreu86 authored
Showing with 1 addition and 4 deletions.
  1. +1 −4 touch-sortable.min.js
View
5 touch-sortable.min.js
@@ -1,7 +1,4 @@
/* Touch-Sortable.js */
/* https://github.com/docubuzz/touch-sortable.js */
-(function(d){d.fn.sortable=function(m){m=m||{};var s="ontouchstart"in document.documentElement?"touchstart":"mousedown";return this.each(function(){function n(a){var c;a?(a=a.originalEvent,c=a.touches?a.touches[0].pageY:a.pageY,c=Math.min(Math.max(p,c),r),50>=c-d(window).scrollTop()?window.scrollBy(0,-5):50>=d(window).height()+d(window).scrollTop()&&window.scrollBy(0,5),c-=h,b.css("top",c)):c=b.css("top").split("px")[0];var j=Math.floor(Math.abs(c/e)),f;c<-e&&b.prev().length?g.filter(":animated").length||
-(k=!0,f=b.prevAll().slice(0,j),f.animate({top:e},150).promise().done(function(){h-=e*j;b.insertBefore(f.last()).css("top","+="+e*j);f.css("top","");n()})):c>e&&b.next().length?g.filter(":animated").length||(k=!0,f=b.nextAll().slice(0,j),f.animate({top:-e},150).promise().done(function(){h+=e*j;b.insertAfter(f.last()).css("top","-="+e*j);f.css("top","");n()})):k=!1;a&&a.preventDefault()}function l(){d("body").off(".sortable");var a=g.filter(":animated");a.length||k?setTimeout(function(){a.promise().done(l)},
-1):b.animate({top:"-="+b.css("top")},150,function(){b.css({top:"","z-index":""}).removeClass("inMotion");g.css("position","");if(m.onComplete)m.onComplete(b.parent())})}var q=d(this),g=q.children().on(s,function(a){a=a.originalEvent;b=d(a.touches?a.touches[0].target:a.target);b.is("li")||(b=b.closest("li"));p=q.position().top;r=p+q.innerHeight()+b.height();g.css("position","relative");b.addClass("inMotion").css("z-index",1);k=!1;a.touches?(h=a.touches[0].pageY,d("body").on("touchmove.sortable",n).on("touchend.sortable",
-l).on("touchcancel.sortable",l)):(h=a.pageY,d("body").on("mousemove.sortable",n).on("mouseup.sortable",l).on("mouseleave.sortable",l))}).css({cursor:"move","user-select":"none"}).attr("unselectable","on").on("selectstart",!1);if(!(2>g.length))var e=g.filter(":nth-child(2)").offset().top-g.filter(":first").offset().top,b,p,r,h,k})}})(jQuery);
+(function(d){d.fn.sortable=function(m){m=m||{};var s="ontouchstart"in document.documentElement?"touchstart":"mousedown";return this.each(function(){function n(a){var c;a?(a=a.originalEvent,c=a.touches?a.touches[0].pageY:a.pageY,c=Math.min(Math.max(p,c),r),50>=c-d(window).scrollTop()?window.scrollBy(0,-5):50>=d(window).height()+d(window).scrollTop()&&window.scrollBy(0,5),c-=h,b.css("top",c)):c=b.css("top").split("px")[0];var j=Math.floor(Math.abs(c/e)),f;c<-e&&b.prev().length?g.filter(":animated").length|| (k=!0,f=b.prevAll().slice(0,j),f.animate({top:e},150).promise().done(function(){h-=e*j;b.insertBefore(f.last()).css("top","+="+e*j);f.css("top","");n()})):c>e&&b.next().length?g.filter(":animated").length||(k=!0,f=b.nextAll().slice(0,j),f.animate({top:-e},150).promise().done(function(){h+=e*j;b.insertAfter(f.last()).css("top","-="+e*j);f.css("top","");n()})):k=!1;a&&a.preventDefault()}function l(){d("body").off(".sortable");var a=g.filter(":animated");a.length||k?setTimeout(function(){a.promise().done(l)}, 1):b.animate({top:"-="+b.css("top")},150,function(){b.css({top:"","z-index":""}).removeClass("inMotion");g.css("position","");if(m.onComplete)m.onComplete(b)})}var q=d(this),g=q.children().on(s,function(a){a=a.originalEvent;b=d(a.touches?a.touches[0].target:a.target);b.is("li")||(b=b.closest("li"));p=q.position().top;r=p+q.innerHeight()+b.height();g.css("position","relative");b.addClass("inMotion").css("z-index",1);k=!1;a.touches?(h=a.touches[0].pageY,d("body").on("touchmove.sortable",n).on("touchend.sortable", l).on("touchcancel.sortable",l)):(h=a.pageY,d("body").on("mousemove.sortable",n).on("mouseup.sortable",l).on("mouseleave.sortable",l))}).css({cursor:"move","user-select":"none"}).attr("unselectable","on").on("selectstart",!1);if(!(2>g.length))var e=g.filter(":nth-child(2)").offset().top-g.filter(":first").offset().top,b,p,r,h,k})}})(jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.