jquery-sortable-lists
Advanced tools
Comparing version 1.0.12 to 1.0.13
@@ -155,3 +155,3 @@ /** | ||
if ( state.isDragged !== false || target.hasClass( setting.ignoreClass ) ) return; | ||
if ( state.isDragged !== false || ( setting.ignoreClass && target.hasClass( setting.ignoreClass ) ) ) return; // setting.ignoreClass is checked cause hasClass('') returns true | ||
@@ -158,0 +158,0 @@ // Solves selection/range highlighting |
@@ -16,6 +16,6 @@ /* | ||
w=e("<span />").addClass("sortableListsOpener "+f.opener.openerClass).css("background-image","url("+f.opener.close+")").css(f.opener.openerCss).on("mousedown",function(a){a=e(this).closest("li");a.hasClass("sortableListsClosed")?u(a):z(a);return!1}),b={isDragged:!1,isRelEFP:null,oEl:null,rootEl:null,cEl:null,upScroll:!1,downScroll:!1,pX:0,pY:0,cX:0,cY:0,isAllowed:!0,e:{pageX:0,pageY:0,clientX:0,clientY:0},doc:e(document),win:e(window)};if(f.opener.active){if(!f.opener.open)throw"Url for opener.open image is not defined"; | ||
if(!f.opener.close)throw"Url for opener.close image is not defined";e(this).find("li").each(function(){var a=e(this);a.children("ul,ol").length&&(w.clone(!0).prependTo(a.children("div").first()),a.hasClass("sortableListsOpen")||(a.addClass("sortableListsClosed"),z(a)))})}return this.on("mousedown",function(a){var c=e(a.target);if(!1===b.isDragged&&!c.hasClass(f.ignoreClass)){a.preventDefault();var c=c.is("li")?c:c.closest("li"),d=e(this);if(c[0]){f.onDragStart(a,c);b.isDragged=!0;var g=parseInt(c.css("margin-top")), | ||
k=parseInt(c.css("margin-bottom")),p=parseInt(c.css("margin-left")),u=parseInt(c.css("margin-right")),q=c.offset(),t=c.innerHeight();b.rootEl={el:d,offset:d.offset(),rootElClass:d.attr("class")};b.cEl={el:c,mT:g,mL:p,mB:k,mR:u,offset:q};b.cEl.xyOffsetDiff={X:a.pageX-b.cEl.offset.left,Y:a.pageY-b.cEl.offset.top};b.cEl.el.addClass("sortableListsCurrent "+f.currElClass);c.before(H);a=b.placeholderNode=e("#sortableListsPlaceholder");c.css({width:c.width(),position:"absolute",top:q.top-g,left:q.left-p}).prependTo(G); | ||
a.css({display:"block",height:t});h.css("height",t);b.doc.on("mousemove",n).on("mouseup",m)}}})};e.fn.sortableListsToArray=function(g,n){g=g||[];var m=0;this.children("li").each(function(){var c=e(this),k={},p=c.attr("id");if(!p)throw console.log(c),"Previous item in console.log has no id. It is necessary to create the array.";k.id=p;k.parentId=n;k.value=c.data("value");k.order=m;g.push(k);c.children("ul,ol").sortableListsToArray(g,p);m++});return g};e.fn.sortableListsToHierarchy=function(){var g= | ||
[],n=0;e(this).children("li").each(function(){var m=e(this),c={},k=m.attr("id");if(!k)throw console.log(m),"Previous item in console.log has no id. It is necessary to create the array.";c.id=k;c.value=m.data("value");c.order=n;g.push(c);c.children=m.children("ul,ol").sortableListsToHierarchy();n++});return g};e.fn.sortableListsToString=function(g,n){g=g||[];n=n||"no-parent";e(this).children("li").each(function(){var m=e(this),c=m.attr("id"),c=c?c.match(/(.+)[-=_](.+)/):null;if(!c)throw console.log(m), | ||
if(!f.opener.close)throw"Url for opener.close image is not defined";e(this).find("li").each(function(){var a=e(this);a.children("ul,ol").length&&(w.clone(!0).prependTo(a.children("div").first()),a.hasClass("sortableListsOpen")||(a.addClass("sortableListsClosed"),z(a)))})}return this.on("mousedown",function(a){var c=e(a.target);if(!(!1!==b.isDragged||f.ignoreClass&&c.hasClass(f.ignoreClass))){a.preventDefault();var c=c.is("li")?c:c.closest("li"),d=e(this);if(c[0]){f.onDragStart(a,c);b.isDragged=!0; | ||
var g=parseInt(c.css("margin-top")),k=parseInt(c.css("margin-bottom")),p=parseInt(c.css("margin-left")),u=parseInt(c.css("margin-right")),q=c.offset(),t=c.innerHeight();b.rootEl={el:d,offset:d.offset(),rootElClass:d.attr("class")};b.cEl={el:c,mT:g,mL:p,mB:k,mR:u,offset:q};b.cEl.xyOffsetDiff={X:a.pageX-b.cEl.offset.left,Y:a.pageY-b.cEl.offset.top};b.cEl.el.addClass("sortableListsCurrent "+f.currElClass);c.before(H);a=b.placeholderNode=e("#sortableListsPlaceholder");c.css({width:c.width(),position:"absolute", | ||
top:q.top-g,left:q.left-p}).prependTo(G);a.css({display:"block",height:t});h.css("height",t);b.doc.on("mousemove",n).on("mouseup",m)}}})};e.fn.sortableListsToArray=function(g,n){g=g||[];var m=0;this.children("li").each(function(){var c=e(this),k={},p=c.attr("id");if(!p)throw console.log(c),"Previous item in console.log has no id. It is necessary to create the array.";k.id=p;k.parentId=n;k.value=c.data("value");k.order=m;g.push(k);c.children("ul,ol").sortableListsToArray(g,p);m++});return g};e.fn.sortableListsToHierarchy= | ||
function(){var g=[],n=0;e(this).children("li").each(function(){var m=e(this),c={},k=m.attr("id");if(!k)throw console.log(m),"Previous item in console.log has no id. It is necessary to create the array.";c.id=k;c.value=m.data("value");c.order=n;g.push(c);c.children=m.children("ul,ol").sortableListsToHierarchy();n++});return g};e.fn.sortableListsToString=function(g,n){g=g||[];n=n||"no-parent";e(this).children("li").each(function(){var m=e(this),c=m.attr("id"),c=c?c.match(/(.+)[-=_](.+)/):null;if(!c)throw console.log(m), | ||
"Previous item in console.log has no id or id is not in required format xx_yy, xx-yy or xx=yy. It is necessary to create valid string.";g.push(c[1]+"["+c[2]+"]="+n);e(this).children("ul,ol").sortableListsToString(g,c[2])});return g.join("&")}})(jQuery); |
{ | ||
"name": "jquery-sortable-lists", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"description": "jQuery plugin to sorting lists also the tree structures", | ||
@@ -5,0 +5,0 @@ "main": "jquery-sortable-lists.min.js", |
52843
745