From ff173d9d54866dc28425ace66ecb6502d1a6f485 Mon Sep 17 00:00:00 2001 From: Piotr Nalepa Date: Wed, 23 Nov 2016 17:20:20 +0100 Subject: [PATCH] Bumped to version 1.3.3 --- dragster.js | 4 ++-- dragster.min.js | 4 ++-- dragster.min.js.gz | Bin 2484 -> 2484 bytes dragster.style.css | 4 ++-- package.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dragster.js b/dragster.js index 6191798..1fe4c93 100644 --- a/dragster.js +++ b/dragster.js @@ -1,5 +1,5 @@ /*@preserve - * Dragster - drag'n'drop library v1.3.2 + * Dragster - drag'n'drop library v1.3.3 * https://github.com/sunpietro/dragster * * Copyright 2015-2016 Piotr Nalepa @@ -8,7 +8,7 @@ * Released under the MIT license * https://github.com/sunpietro/dragster/blob/master/LICENSE * - * Date: 2016-10-17T20:30Z + * Date: 2016-11-23T17:20Z */ (function (window, document) { 'use strict'; diff --git a/dragster.min.js b/dragster.min.js index bce53e1..4c1e943 100644 --- a/dragster.min.js +++ b/dragster.min.js @@ -1,5 +1,5 @@ /*@preserve - * Dragster - drag'n'drop library v1.3.2 + * Dragster - drag'n'drop library v1.3.3 * https://github.com/sunpietro/dragster * * Copyright 2015-2016 Piotr Nalepa @@ -8,6 +8,6 @@ * Released under the MIT license * https://github.com/sunpietro/dragster/blob/master/LICENSE * - * Date: 2016-10-17T20:30Z + * Date: 2016-11-23T17:20Z */ !function(e,t){"use strict";e.Dragster=function(n){var o,r,a,s,i,l,d,c,u,g,m,p,f,h,v,E,L,y,C,B,w,D,b,T,N,A,H,S,R,M="dragster-",O="is-dragging",P="is-drag-over",I=M+"draggable",Y=M+"drag-region",q=M+"drop-placeholder",x=M+"temp",F=x+"-container",X=M+"is-hidden",J=M+"replacable",W=M+"region--drag-only",k="touchstart",z="touchmove",j="touchend",G="mousedown",K="mousemove",Q="mouseup",U="top",V="bottom",Z="px",$="div",_=!1,ee=!0,te=function(){},ne={elementSelector:".dragster-block",regionSelector:".dragster-region",dragOnlyRegionCssClass:W,replaceElements:_,updateRegionsHeight:ee,minimumRegionHeight:60,onBeforeDragStart:te,onAfterDragStart:te,onBeforeDragMove:te,onAfterDragMove:te,onBeforeDragEnd:te,onAfterDragEnd:te,onAfterDragDrop:te,scrollWindowOnDrag:_,dragOnlyRegionsEnabled:_,cloneElements:_},oe="draggable",re="data-placeholder-position",ae={top:_,bottom:_},se={drag:{node:{}},drop:{node:{}},shadow:{node:{},top:0,left:0},placeholder:{node:{},position:""},dropped:null,clonedFrom:null,clonedTo:null},ie=e.innerHeight;for(r in n)n.hasOwnProperty(r)&&(ne[r]=n[r]);return b=function(){return[].slice.call(t.querySelectorAll(ne.elementSelector))},T=function(e){e.forEach(function(e){var t=E(),n=e.parentNode;return n.classList.contains(I)?_:(n.insertBefore(t,e),n.removeChild(e),void t.appendChild(e))})},u=b(),a=[].slice.call(t.querySelectorAll(ne.regionSelector)),ne.replaceElements&&(d=t.createElement($),d.classList.add(X),d.classList.add(F),t.body.appendChild(d)),s=function(e,t){var n=e.parentNode;if(n&&(!e.classList||!e.classList.contains(Y)||e.classList.contains(W)))return t(e)?e:t(n)?n:s(n,t)},B=function(e){var n=[].slice.call(t.getElementsByClassName(e));n.forEach(function(e){e.parentNode.removeChild(e)})},w=function(e,n){n&&(a.forEach(function(e){e.removeEventListener(n,g.mousemove)}),t.body.removeEventListener(n,g.mousemove)),e&&e.classList.remove(O),[].slice.call(t.getElementsByClassName(I)).forEach(function(e){e.firstChild||e.parentNode.removeChild(e)}),B(q),B(x),N()},D=function(){[].slice.call(t.getElementsByClassName(J)).forEach(function(e){e.classList.remove(J)})},E=function(){var e=t.createElement($);return e.setAttribute(oe,ee),e.classList.add(I),e},y=function(){var e=t.createElement($);return e.classList.add(q),e},L=function(){var e=t.createElement($);return e.classList.add(x),e.classList.add(X),e.style.position="fixed",t.body.appendChild(e),e},h=function(e,t){e&&e.parentNode&&e.parentNode.insertBefore(t,e.nextSibling)},v=function(e,t){e&&e.parentNode&&e.parentNode.insertBefore(t,e)},p=function(e){return e.classList&&e.classList.contains(I)},m=function(e){return e.classList&&e.classList.contains(q)},f=function(e){return e.classList&&e.classList.contains(ne.dragOnlyRegionCssClass)},N=function(){if(ne.updateRegionsHeight){var n=[].slice.call(t.getElementsByClassName(Y));n.forEach(function(t){var n=[].slice.call(t.querySelectorAll(ne.elementSelector)),o=ne.minimumRegionHeight;n.length&&(n.forEach(function(t){var n=e.getComputedStyle(t);o+=t.offsetHeight+parseInt(n.marginTop,10)+parseInt(n.marginBottom,10)}),t.style.height=o+Z)})}},g={mousedown:function(e){var n,r;return e.dragster=o,ne.onBeforeDragStart(e)===_||3===e.which?_:(e.preventDefault(),r=e.type===k?z:K,a.forEach(function(e){e.addEventListener(r,g.mousemove)}),t.body.addEventListener(r,g.mousemove),(c=s(e.target,p))?(n=c.getBoundingClientRect(),i=L(),i.innerHTML=c.innerHTML,i.style.width=n.width+Z,i.style.height=n.height+Z,l=i.getBoundingClientRect(),c.classList.add(O),o=JSON.parse(JSON.stringify(se)),o.drag.node=c,o.shadow.node=i,e.dragster=o,void ne.onAfterDragStart(e)):_)},mousemove:function(e){if(e.dragster=o,ne.onBeforeDragMove(e)===_)return _;e.preventDefault();var n=e.changedTouches?e.changedTouches[0]:e,r=n.view?n.view.pageXOffset:0,a=n.view?n.view.pageYOffset:0,d=n.clientY+a,u=n.clientX+r,g=t.elementFromPoint(n.clientX,n.clientY),m=s(g,p),h=n.clientY,v=u-l.width/2,E=!(!m||!s(m,f)),L=g.classList.contains(Y),y=g.classList.contains(W),B=g.classList.contains(q),w=g.getElementsByClassName(I).length>0,D=g.getElementsByClassName(q).length>0;clearTimeout(C),i.style.top=h+Z,i.style.left=v+Z,i.classList.remove(X),o.shadow.top=h,o.shadow.left=v,m&&m!==c&&!E?R.addPlaceholderOnTarget(m,d,a):!L||y||w||D?L&&!y&&w&&!D?R.addPlaceholderInRegionBelowTargets(g):L||B||R.removePlaceholders():R.addPlaceholderInRegion(g),ne.scrollWindowOnDrag&&A(e),N(),ne.onAfterDragMove(e)},mouseup:function(e){if(e.dragster=o,ne.onBeforeDragEnd(e)===_)return _;var n,r=ne.replaceElements?J:q,a=t.getElementsByClassName(r)[0],i=!(!c||!s(c,f)),l=e.type===k?z:K,d=ne.cloneElements&&i;return C=setTimeout(function(){w(c,l)},200),D(),c&&a?(n=s(a,p),n=n||a,c!==n&&(ne.replaceElements||d?ne.replaceElements&&!d?(e.dragster=S.replaceElements(e.dragster,n),ne.onAfterDragDrop(e)):!ne.replaceElements&&d&&(e.dragster=S.cloneElements(e.dragster,a,n),ne.onAfterDragDrop(e)):(e.dragster=S.moveElement(e.dragster,a,n),ne.onAfterDragDrop(e)),n.classList.remove(P)),w(c,l),void ne.onAfterDragEnd(e)):(w(c,l),_)}},R={addPlaceholderOnTarget:function(e,t,n){var r=e.getBoundingClientRect(),a=y(),s=r.height/2;D(),ne.replaceElements?e.classList.add(J):t-n-r.top&u4?7=m zYyXGlDCVy61veQe@@&KrYeY)=t}?pJ%C$zsh75R2A%7xlhk@g=i3mJ>@kxUfn}!Cwp-+28+Z9|nKG%D9dJpML ze9vQu;#{vK)Av&{roFcCV{FSX3_YC-r8dHJF z^u!zq{GP4SgMVbJ7^&j5$+cQQaS1ltb87%-3>^sANZFkg z6ew+uqMD5NB4! zUkO>kV1tQ~XJ#QceaD@cMW{|XiuO$c9C;5Ni8wA%4>>p7a<$K1_>r=*NRP}j(tEH? zj-p~6P^s&f3V#?Pv1AgAClf#L5I@X>?=_U=pboj0L&*xci|G)lI`k#Nl|zjn9StkR z5GvE7$fIN!M;Xxkk$_ha!0|luZX5K5fU<_dTa?)JkW56&XGu+ zakWv~Jy|YmH$D(TGJPvlPY+`f3qp_Ek;#$l3XW;jW`BH3Z)2u%T^uixM04p(nbvlf z*P6a4M#XH}KJ%jNSe~?$&JINB?fwk0X~`Hy0CGOI*2x($<~siSvjkYHRa8`Z#k?Z$ zLZQzH*}>_^myt@u)VBDB0^rzu)Q=|umnN#?v>28zW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H diff --git a/dragster.style.css b/dragster.style.css index 1cca194..9d1688e 100644 --- a/dragster.style.css +++ b/dragster.style.css @@ -1,5 +1,5 @@ /* - * Dragster - drag'n'drop library v1.3.2 + * Dragster - drag'n'drop library v1.3.3 * https://github.com/sunpietro/dragster * * Copyright 2015-2016 Piotr Nalepa @@ -8,7 +8,7 @@ * Released under the MIT license * https://github.com/sunpietro/dragster/blob/master/LICENSE * - * Date: 2016-10-29T11:30Z + * Date: 2016-11-23T17:20Z */ * { box-sizing: border-box; diff --git a/package.json b/package.json index f76e67e..86d4620 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dragsterjs", - "version": "1.3.2", + "version": "1.3.3", "description": "Tiny vanilla JS plugin that enables drag'n'drop interactions to a user of your website", "main": "dragster.js", "scripts": {