diff --git a/README.md b/README.md index b71794de..baf72c6d 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Browser support includes every sane browser and **IE7+**. _(Granted you pol I was working on huge angular project and I was using several drag&drop libraries in it, one for UI, one for lists, etc.. I wanted to use one full-featured drag&drop library for whole project. As I could not find any suitable, I decided to create one. I have choosen great library [dragula](http://github.com/bevacqua/dragula) by [Nicolas Bevacqua](http://github.com/bevacqua) as my starting point, make it more angular and started to put features in it! If you wish light-weight angular version of dragula, there is [official angular version of dragula](http://github.com/bevacqua/angular-dragula). -Actual version 4.4.6 is based on dragula 3.6.3 and tested with angular 1.6.5. +Actual version 4.5.0 is based on dragula 3.6.3 and tested with angular 1.6.5. # Differences of dragular (against dragula) diff --git a/bower.json b/bower.json index 5774776f..76425976 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "dragular", - "version": "4.4.6", + "version": "4.5.0", "description": "Angular drag and drop library based on dragula, but full featured. For light-weight angular wrap of dragula look for angular-dragula", "main": [ "dist/dragular.js", diff --git a/dist/dragular.js b/dist/dragular.js index d3ed5eb3..07b06742 100644 --- a/dist/dragular.js +++ b/dist/dragular.js @@ -60,7 +60,7 @@ return /******/ (function(modules) { // webpackBootstrap var dragularService = __webpack_require__( 2 ); /** - * Dragular 4.4.6 by Luckylooke https://github.com/luckylooke/dragular + * Dragular 4.5.0 by Luckylooke https://github.com/luckylooke/dragular * Angular version of dragula https://github.com/bevacqua/dragula */ module.exports = 'dragularModule'; @@ -255,6 +255,8 @@ return /******/ (function(modules) { // webpackBootstrap containersCtx: shared.containersCtx, // all contexts to containers sanitizeContainersModel: depSanitize, sanitizeContainers: sanitizeContainers, + addContainers: addContainers, + removeContainers: removeContainers, isContainer: isContainer, start: manualStart, end: end, @@ -738,7 +740,7 @@ return /******/ (function(modules) { // webpackBootstrap return; } - if ( reference === null || + if ( (reference === null && changed) || reference !== shared.item && reference !== nextEl( shared.item ) && reference !== shared.currentSibling ) { @@ -1196,12 +1198,12 @@ return /******/ (function(modules) { // webpackBootstrap release( {} ); } - function removeContainers( all ) { + function removeContainers( containers ) { $rootScope.$applyAsync( function applyDestroyed() { - var changes = _isArray( all ) ? all : makeArray( all ); - changes.forEach( function forEachContainer( container ) { + containers = _isArray( containers ) ? containers : makeArray( containers ); + containers.forEach( function forEachContainer( container ) { angular.forEach( o.nameSpace, function forEachNs( nameSpace ) { @@ -1209,11 +1211,33 @@ return /******/ (function(modules) { // webpackBootstrap index = shared.containers[ nameSpace ].indexOf( container ); shared.containers[ nameSpace ].splice( index, 1 ); shared.containersCtx[ nameSpace ].splice( index, 1 ); + + if ( -1 < (index = initialContainers.indexOf( container ))) { + initialContainers.splice( index, 1 ); + } } ); } ); } ); } + function addContainers( containers ) { + + containers = _isArray( containers ) ? containers : makeArray( containers ); + containers.forEach( function forEachContainer( container, i ) { + + angular.forEach( o.nameSpace, function forEachNs( nameSpace ) { + + shared.containers[ nameSpace ].push( container ); + shared.containersCtx[ nameSpace ].push({ + o: o, + m: getContainersModel( o )[ i ], // can be undefined + fm: o.containersFilteredModel[ i ] // can be undefined + }); + initialContainers.push( container ); + } ); + } ); + } + function scrollContainer( e ) { if ( shared.target ) { if ( e.originalEvent ) { diff --git a/dist/dragular.min.js b/dist/dragular.min.js index ae980265..17f726ad 100644 --- a/dist/dragular.min.js +++ b/dist/dragular.min.js @@ -1,2 +1,2 @@ -!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var r=n(1),o=n(2);e.exports="dragularModule",angular.module("dragularModule",[]).factory("dragularService",o).directive("dragular",r)},function(e,t){"use strict";var n=function(e){return{restrict:"A",link:function(t,n,r){function o(e){try{return JSON.parse(e)}catch(t){return}}var i=t.$eval(r.dragular)||o(r.dragular)||{};r.dragularModel&&(i.containersModel=r.dragularModel,i.scope||(i.scope=t)),r.dragularNameSpace&&(i.nameSpace=r.dragularNameSpace.split(" ")),r.dragularOnInit&&(i.onInit=t.$eval(r.dragularOnInit)),e(n[0],i)}}};n.$inject=["dragularService"],e.exports=n},function(e,t){"use strict";var n={classesCache:{},containersCtx:{},containers:{},mirror:null,source:null,item:null,copy:null,sourceItem:null,sourceModel:null,sourceFilteredModel:null,target:null,targetCtx:null,targetModel:null,lastDropTarget:null,offsetX:null,offsetY:null,moveX:null,moveY:null,offsetXr:null,offsetYb:null,clientX:null,clientY:null,mirrorWidth:null,mirrorHeight:null,initialSibling:null,currentSibling:null,initialIndex:null,currentIndex:null,tempModel:null,dragOverEvents:{},lastElementBehindCursor:null,grabbed:null},r=function(e,t){function r(r,d){function x(){1!==arguments.length||w(r)||angular.isElement(r)||r[0]||"string"==typeof r?"string"==typeof r&&(ge=document.querySelectorAll(r)):(fe=r||{},ge=[]),me=fe.copyOptions?angular.copy(fe):fe}function b(){var e=angular.extend({},xe,me);angular.extend(me,e),me.classes&&(e=angular.extend({},ve,me.classes),angular.extend(me.classes,e)),me.eventNames&&(e=angular.extend({},he,me.eventNames),angular.extend(me.eventNames,e))}function I(){h(me.boundingBox)||(me.boundingBox=!1),me.containers&&(ge=me.containers),me.containers=o(ge,!1,me.scope),me.containersModel=o(me.containersModel,!0,me.scope),w(me.containersFilteredModel)?me.containersFilteredModel=w(me.containersFilteredModel[0])?me.containersFilteredModel:[me.containersFilteredModel]:me.containersFilteredModel=[],me.nameSpace||(me.nameSpace=["dragularCommon"]),w(me.nameSpace)||(me.nameSpace=[me.nameSpace]),me.nameSpace.forEach(function(e){n.containers[e]||(n.containers[e]=[],n.containersCtx[e]=[]);for(var t,r=_(me).length,o=0;oi.left+n.offsetX&&ri.top+n.offsetY&&on)return o;if(!l&&i.top>r)return o}return null}function i(){var e=t.getBoundingClientRect();return a(l?n>e.left+g(e)/2:r>e.top+f(e)/2)}function a(e){return e?v(t):t}var l="horizontal"===me.direction;return t!==e?i():o()}function V(e,t,n){var r,o=e||{},i=o.className;return o.className+=" "+me.classes.hide,r=O.elementFromPoint(t,n),o.className=i,r}function Z(e){if(!e)return!1;for(var t=me.nameSpace.length;t--;)if(n.containers[me.nameSpace[t]].indexOf(e)!==-1)return!0;return me.isContainer(e)?(n.tempModel=me.isContainerModel(e),!0):(n.tempModel=null,!1)}function _(e){return te("containers",e)}function ee(e){return te("containersModel",e,!0)}function te(e,t,r){return B(t[e])?o(t[e](t===me?ye:null,n),r,t.scope):t[e]}function ne(e){if(ye.dragging){var t=arguments.length>0?e:pe(me.revertOnSpill),r=E(n.item),o=J(r);o||n.copy||!t||n.source.insertBefore(n.item,n.initialSibling),!n.sourceModel||n.copy||t?me.scope&&(o||t)&&me.scope.$emit(me.eventNames.dragularcancel,n.item,n.source,n.sourceModel,n.initialIndex):oe(n.item,r),(!n.sourceModel||n.copy||t||o)&&ae()}}function re(e){if(W(),ye.dragging){e.originalEvent&&(e=e.originalEvent),n.clientX=C("clientX",e),n.clientY=C("clientY",e);var t=V(n.mirror,n.clientX,n.clientY),r=K(t,n.clientX,n.clientY);r&&(n.copy&&pe(me.copySortSource)||!n.copy||r!==n.source)?oe(n.item,r):pe(me.removeOnSpill)?ie():ne(),n.target=null,n.lastElementBehindCursor&&X(n.lastElementBehindCursor,n.dragOverEvents.dragularrelease,t),me.scope&&me.scope.$emit(me.eventNames.dragularrelease,n.item,n.source,e)}}function oe(r,o){function a(){function e(e){J(o)?e.$emit(me.eventNames.dragularcancel,r,n.source,n.sourceModel,n.initialIndex):e.$emit(me.eventNames.dragulardrop,r,o,n.source,n.sourceModel,n.initialIndex,n.targetModel,u)}if(_(me).forEach(function(e){i(e,"off","mousedown",A),i(e,"on","mousedown",A)}),me.compileItemOnDrop){var a=angular.element(o).scope?angular.element(o).scope():me.scope;a&&a.$applyAsync(function(){var e=t(n.copy?l.cloneNode(!0):l)(a);r.parentNode===o&&o.removeChild(r),o.insertBefore(e[0],c),ae()})}me.scope&&e(me.scope),n.targetCtx&&n.targetCtx.o.scope&&n.targetCtx.o.scope!==me.scope&&e(n.targetCtx.o.scope),me.compileItemOnDrop||ae()}if(!r)return void ae();var l=n.sourceItem,c=n.currentSibling,u=N(r,o);n.copy&&o===n.source&&E(r)&&pe(me.copySortSource)&&r.parentNode.removeChild(n.sourceItem),n.sourceModel&&!J(o)?(n.targetCtx&&n.targetCtx.fm&&(u=n.targetCtx.m.indexOf(n.targetCtx.fm[u])),n.sourceFilteredModel&&(n.initialIndex=n.sourceModel.indexOf(n.sourceFilteredModel[n.initialIndex])),e.$applyAsync(function(){n.sourceModel&&(o===n.source?n.sourceModel.splice(u,0,n.sourceModel.splice(n.initialIndex,1)[0]):(n.dropElmModel=n.copy&&!me.dontCopyModel?angular.copy(n.sourceModel[n.initialIndex]):n.sourceModel[n.initialIndex],n.tempModel?n.targetModel=n.tempModel:n.targetModel=n.targetCtx&&n.targetCtx.m||n.sourceModel,r.parentNode.removeChild(r),n.copy||n.sourceModel.splice(n.initialIndex,1),n.targetModel&&n.targetModel.splice(u,0,n.dropElmModel)),E(r)&&r.parentNode.removeChild(r),a())})):a()}function ie(){if(ye.dragging){var t=E(n.item);t&&t.removeChild(n.item),n.sourceModel&&e.$applyAsync(function(){n.sourceModel.splice(n.initialIndex,1),ae()}),me.scope&&me.scope.$emit(n.copy?me.eventNames.dragularcancel:me.eventNames.dragularremove,n.item,t,n.sourceModel,n.initialIndex),n.sourceModel||ae()}}function ae(){W(),se(),n.item&&M(n.item,me.classes.transit),ye.dragging=!1,pe(me.removeOnSpill)===!0&&q(),me.scope&&(n.lastDropTarget&&me.scope.$emit(me.eventNames.dragularout,n.item,n.lastDropTarget,n.source),me.scope.$emit(me.eventNames.dragulardragend,n.item)),n.source=n.item=n.sourceItem=n.initialSibling=n.currentSibling=n.sourceModel=null,n.initialIndex=n.currentIndex=n.lastDropTarget=n.tempModel=n.targetModel=null,n.dropElmModel=n.targetCtx=n.copy=n.moveX=n.moveY=null}function le(){$(!0),ce(me.containers),re({})}function ce(t){e.$applyAsync(function(){var e=w(t)?t:c(t);e.forEach(function(e){angular.forEach(me.nameSpace,function(t){var r;r=n.containers[t].indexOf(e),n.containers[t].splice(r,1),n.containersCtx[t].splice(r,1)})})})}function ue(e){if(n.target){e.originalEvent&&(e=e.originalEvent);var t=n.target.scrollTop;n.target.scrollTop+=e.deltaY,t!==n.target.scrollTop&&(e.stopPropagation(),e.preventDefault())}}function se(){n.mirror&&(M(O.body,me.classes.unselectable),i(T,"off","mousemove",z),i(n.mirror,"off","wheel",ue),E(n.mirror)&&n.mirror.parentNode.removeChild(n.mirror),n.mirror=null)}function de(e){o(e,!0,me.scope)}var me,ge=r||[],fe=d||{},pe=Y,ve={mirror:"gu-mirror",hide:"gu-hide",unselectable:"gu-unselectable",transit:"gu-transit"},he={dragularenter:"dragularenter",dragularleave:"dragularleave",dragularrelease:"dragularrelease",dragularcloned:"dragularcloned",dragulardrag:"dragulardrag",dragularcancel:"dragularcancel",dragulardrop:"dragulardrop",dragularremove:"dragularremove",dragulardragend:"dragulardragend",dragularshadow:"dragularshadow",dragularover:"dragularover",dragularout:"dragularout"},xe={copyOptions:!1,classes:ve,eventNames:he,containers:!1,containersModel:!1,containersFilteredModel:!1,isContainer:a,isContainerModel:p,isContainerAccepts:l,moves:l,accepts:l,canBeAccepted:l,copy:!1,copySortSource:!1,dontCopyModel:!1,invalid:a,revertOnSpill:!1,removeOnSpill:!1,lockX:!1,lockY:!1,boundingBox:!1,mirrorContainer:O.body,ignoreInputTextSelection:!0,compileItemOnDrop:!1,onInit:!1},ye={containers:n.containers,containersCtx:n.containersCtx,sanitizeContainersModel:de,sanitizeContainers:o,isContainer:Z,start:P,end:R,cancel:ne,remove:ie,destroy:le,dragging:!1};return x(),b(),I(),$(),me.onInit&&me.onInit(ye,me),ye}function o(e,t,n){if(B(e))return e;if(w(e))return t?w(e[0])?e:[e]:e;if("string"==typeof e&&n){var r=n.$eval(e);return B(r)?r:function(){return n.$eval(e)}}return e?c(e):[]}function i(e,t,n,r){var o={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},i={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},a={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"},l=angular.element(e);if(e.addEventListener){var c={on:"addEventListener",off:"removeEventListener"};e[c[t]](n,r,{passive:!1}),e[c[t]](o[n],r,{passive:!1})}else"undefined"!=typeof navigator&&navigator.pointerEnabled&&i[n]?l[t](i[n],r):"undefined"!=typeof navigator&&navigator.msPointerEnabled&&a[n]?l[t](a[n],r):o[n]&&l[t](o[n],r),l[t](n,r)}function a(){return!1}function l(){return!0}function c(e,t){return w(e)?e:e.length?Array.prototype.slice.call(e,t):[e]}function u(e){if(e.touches)return e.touches.length;if(e.originalEvent&&e.originalEvent.touches)return e.originalEvent.touches.length;if(void 0!==e.which&&0!==e.which)return e.which;if(void 0!==e.buttons)return e.buttons;var t=e.button;return void 0!==t?1&t?1:2&t?3:4&t?2:0:void 0}function s(e){e.originalEvent&&(e=e.originalEvent),n.grabbed&&e.preventDefault()}function d(e,t){return"undefined"!=typeof window[t]?window[t]:T.clientHeight?T[e]:O.body[e]}function m(e){var t=e.getBoundingClientRect(),n=d("scrollTop","pageYOffset"),r=d("scrollLeft","pageXOffset");return{left:t.left+r,right:t.right+r,top:t.top+n,bottom:t.bottom+n}}function g(e){return e.width||e.right-e.left}function f(e){return e.height||e.bottom-e.top}function p(){return[]}function v(e){function t(){var t=e;do t=t.nextSibling;while(t&&1!==t.nodeType);return t}if(e)return e.nextElementSibling||t()}function h(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}function x(e){var t=n.classesCache[e];return t?t.lastIndex=0:n.classesCache[e]=t=new RegExp("(?:^|\\s)"+e+"(?:\\s|$)","g"),t}function y(e,t){var n=e.className;n.length?x(t).test(n)||(e.className+=" "+t):e.className=t}function M(e,t){e.className=e.className.replace(x(t)," ").trim()}function b(e){return e.targetTouches&&e.targetTouches.length?e.targetTouches[0]:e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e}function C(e,t){var n=b(t),r={pageX:"clientX",pageY:"clientY"};return e in r&&!(e in n)&&r[e]in n&&(e=r[e]),!n.type||n.type.indexOf("touch")<0?n[e]:n.type.indexOf("end")===-1&&n.originalEvent.touches[0][e.replace("client","page")]}function E(e){return e.parentNode===document?null:e.parentNode}function S(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName||"SELECT"===e.tagName||I(e)}function I(e){return!!e&&("false"!==e.contentEditable&&("true"===e.contentEditable||I(E(e))))}function N(e,t){return Array.prototype.indexOf.call(angular.element(t).children(),e)}function X(e,t,r){e&&(n.extra=r,e.dispatchEvent?e.dispatchEvent(t):e.fireEvent("on"+t.eventType,t))}function Y(e,t,r){return B(e)?!!e.apply(r||this,t||n):!!e}var O=document,T=O.documentElement,w=Array.isArray,B=angular.isFunction;return r.cleanEnviroment=function(){n.classesCache={},n.containersCtx={},n.containers={},n.mirror=void 0},r.shared=n,r};r.$inject=["$rootScope","$compile"],e.exports=r}])}); +!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";var r=n(1),o=n(2);e.exports="dragularModule",angular.module("dragularModule",[]).factory("dragularService",o).directive("dragular",r)},function(e,t){"use strict";var n=function(e){return{restrict:"A",link:function(t,n,r){function o(e){try{return JSON.parse(e)}catch(t){return}}var i=t.$eval(r.dragular)||o(r.dragular)||{};r.dragularModel&&(i.containersModel=r.dragularModel,i.scope||(i.scope=t)),r.dragularNameSpace&&(i.nameSpace=r.dragularNameSpace.split(" ")),r.dragularOnInit&&(i.onInit=t.$eval(r.dragularOnInit)),e(n[0],i)}}};n.$inject=["dragularService"],e.exports=n},function(e,t){"use strict";var n={classesCache:{},containersCtx:{},containers:{},mirror:null,source:null,item:null,copy:null,sourceItem:null,sourceModel:null,sourceFilteredModel:null,target:null,targetCtx:null,targetModel:null,lastDropTarget:null,offsetX:null,offsetY:null,moveX:null,moveY:null,offsetXr:null,offsetYb:null,clientX:null,clientY:null,mirrorWidth:null,mirrorHeight:null,initialSibling:null,currentSibling:null,initialIndex:null,currentIndex:null,tempModel:null,dragOverEvents:{},lastElementBehindCursor:null,grabbed:null},r=function(e,t){function r(r,d){function x(){1!==arguments.length||w(r)||angular.isElement(r)||r[0]||"string"==typeof r?"string"==typeof r&&(fe=document.querySelectorAll(r)):(pe=r||{},fe=[]),ge=pe.copyOptions?angular.copy(pe):pe}function C(){var e=angular.extend({},ye,ge);angular.extend(ge,e),ge.classes&&(e=angular.extend({},he,ge.classes),angular.extend(ge.classes,e)),ge.eventNames&&(e=angular.extend({},xe,ge.eventNames),angular.extend(ge.eventNames,e))}function I(){h(ge.boundingBox)||(ge.boundingBox=!1),ge.containers&&(fe=ge.containers),ge.containers=o(fe,!1,ge.scope),ge.containersModel=o(ge.containersModel,!0,ge.scope),w(ge.containersFilteredModel)?ge.containersFilteredModel=w(ge.containersFilteredModel[0])?ge.containersFilteredModel:[ge.containersFilteredModel]:ge.containersFilteredModel=[],ge.nameSpace||(ge.nameSpace=["dragularCommon"]),w(ge.nameSpace)||(ge.nameSpace=[ge.nameSpace]),ge.nameSpace.forEach(function(e){n.containers[e]||(n.containers[e]=[],n.containersCtx[e]=[]);for(var t,r=_(ge).length,o=0;oi.left+n.offsetX&&ri.top+n.offsetY&&on)return o;if(!l&&i.top>r)return o}return null}function i(){var e=t.getBoundingClientRect();return a(l?n>e.left+g(e)/2:r>e.top+f(e)/2)}function a(e){return e?v(t):t}var l="horizontal"===ge.direction;return t!==e?i():o()}function V(e,t,n){var r,o=e||{},i=o.className;return o.className+=" "+ge.classes.hide,r=O.elementFromPoint(t,n),o.className=i,r}function Z(e){if(!e)return!1;for(var t=ge.nameSpace.length;t--;)if(n.containers[ge.nameSpace[t]].indexOf(e)!==-1)return!0;return ge.isContainer(e)?(n.tempModel=ge.isContainerModel(e),!0):(n.tempModel=null,!1)}function _(e){return te("containers",e)}function ee(e){return te("containersModel",e,!0)}function te(e,t,r){return B(t[e])?o(t[e](t===ge?Me:null,n),r,t.scope):t[e]}function ne(e){if(Me.dragging){var t=arguments.length>0?e:ve(ge.revertOnSpill),r=E(n.item),o=J(r);o||n.copy||!t||n.source.insertBefore(n.item,n.initialSibling),!n.sourceModel||n.copy||t?ge.scope&&(o||t)&&ge.scope.$emit(ge.eventNames.dragularcancel,n.item,n.source,n.sourceModel,n.initialIndex):oe(n.item,r),(!n.sourceModel||n.copy||t||o)&&ae()}}function re(e){if(W(),Me.dragging){e.originalEvent&&(e=e.originalEvent),n.clientX=b("clientX",e),n.clientY=b("clientY",e);var t=V(n.mirror,n.clientX,n.clientY),r=K(t,n.clientX,n.clientY);r&&(n.copy&&ve(ge.copySortSource)||!n.copy||r!==n.source)?oe(n.item,r):ve(ge.removeOnSpill)?ie():ne(),n.target=null,n.lastElementBehindCursor&&X(n.lastElementBehindCursor,n.dragOverEvents.dragularrelease,t),ge.scope&&ge.scope.$emit(ge.eventNames.dragularrelease,n.item,n.source,e)}}function oe(r,o){function a(){function e(e){J(o)?e.$emit(ge.eventNames.dragularcancel,r,n.source,n.sourceModel,n.initialIndex):e.$emit(ge.eventNames.dragulardrop,r,o,n.source,n.sourceModel,n.initialIndex,n.targetModel,u)}if(_(ge).forEach(function(e){i(e,"off","mousedown",A),i(e,"on","mousedown",A)}),ge.compileItemOnDrop){var a=angular.element(o).scope?angular.element(o).scope():ge.scope;a&&a.$applyAsync(function(){var e=t(n.copy?l.cloneNode(!0):l)(a);r.parentNode===o&&o.removeChild(r),o.insertBefore(e[0],c),ae()})}ge.scope&&e(ge.scope),n.targetCtx&&n.targetCtx.o.scope&&n.targetCtx.o.scope!==ge.scope&&e(n.targetCtx.o.scope),ge.compileItemOnDrop||ae()}if(!r)return void ae();var l=n.sourceItem,c=n.currentSibling,u=N(r,o);n.copy&&o===n.source&&E(r)&&ve(ge.copySortSource)&&r.parentNode.removeChild(n.sourceItem),n.sourceModel&&!J(o)?(n.targetCtx&&n.targetCtx.fm&&(u=n.targetCtx.m.indexOf(n.targetCtx.fm[u])),n.sourceFilteredModel&&(n.initialIndex=n.sourceModel.indexOf(n.sourceFilteredModel[n.initialIndex])),e.$applyAsync(function(){n.sourceModel&&(o===n.source?n.sourceModel.splice(u,0,n.sourceModel.splice(n.initialIndex,1)[0]):(n.dropElmModel=n.copy&&!ge.dontCopyModel?angular.copy(n.sourceModel[n.initialIndex]):n.sourceModel[n.initialIndex],n.tempModel?n.targetModel=n.tempModel:n.targetModel=n.targetCtx&&n.targetCtx.m||n.sourceModel,r.parentNode.removeChild(r),n.copy||n.sourceModel.splice(n.initialIndex,1),n.targetModel&&n.targetModel.splice(u,0,n.dropElmModel)),E(r)&&r.parentNode.removeChild(r),a())})):a()}function ie(){if(Me.dragging){var t=E(n.item);t&&t.removeChild(n.item),n.sourceModel&&e.$applyAsync(function(){n.sourceModel.splice(n.initialIndex,1),ae()}),ge.scope&&ge.scope.$emit(n.copy?ge.eventNames.dragularcancel:ge.eventNames.dragularremove,n.item,t,n.sourceModel,n.initialIndex),n.sourceModel||ae()}}function ae(){W(),de(),n.item&&M(n.item,ge.classes.transit),Me.dragging=!1,ve(ge.removeOnSpill)===!0&&q(),ge.scope&&(n.lastDropTarget&&ge.scope.$emit(ge.eventNames.dragularout,n.item,n.lastDropTarget,n.source),ge.scope.$emit(ge.eventNames.dragulardragend,n.item)),n.source=n.item=n.sourceItem=n.initialSibling=n.currentSibling=n.sourceModel=null,n.initialIndex=n.currentIndex=n.lastDropTarget=n.tempModel=n.targetModel=null,n.dropElmModel=n.targetCtx=n.copy=n.moveX=n.moveY=null}function le(){$(!0),ce(ge.containers),re({})}function ce(t){e.$applyAsync(function(){t=w(t)?t:c(t),t.forEach(function(e){angular.forEach(ge.nameSpace,function(t){var r;r=n.containers[t].indexOf(e),n.containers[t].splice(r,1),n.containersCtx[t].splice(r,1),-1<(r=fe.indexOf(e))&&fe.splice(r,1)})})})}function ue(e){e=w(e)?e:c(e),e.forEach(function(e,t){angular.forEach(ge.nameSpace,function(r){n.containers[r].push(e),n.containersCtx[r].push({o:ge,m:ee(ge)[t],fm:ge.containersFilteredModel[t]}),fe.push(e)})})}function se(e){if(n.target){e.originalEvent&&(e=e.originalEvent);var t=n.target.scrollTop;n.target.scrollTop+=e.deltaY,t!==n.target.scrollTop&&(e.stopPropagation(),e.preventDefault())}}function de(){n.mirror&&(M(O.body,ge.classes.unselectable),i(T,"off","mousemove",z),i(n.mirror,"off","wheel",se),E(n.mirror)&&n.mirror.parentNode.removeChild(n.mirror),n.mirror=null)}function me(e){o(e,!0,ge.scope)}var ge,fe=r||[],pe=d||{},ve=Y,he={mirror:"gu-mirror",hide:"gu-hide",unselectable:"gu-unselectable",transit:"gu-transit"},xe={dragularenter:"dragularenter",dragularleave:"dragularleave",dragularrelease:"dragularrelease",dragularcloned:"dragularcloned",dragulardrag:"dragulardrag",dragularcancel:"dragularcancel",dragulardrop:"dragulardrop",dragularremove:"dragularremove",dragulardragend:"dragulardragend",dragularshadow:"dragularshadow",dragularover:"dragularover",dragularout:"dragularout"},ye={copyOptions:!1,classes:he,eventNames:xe,containers:!1,containersModel:!1,containersFilteredModel:!1,isContainer:a,isContainerModel:p,isContainerAccepts:l,moves:l,accepts:l,canBeAccepted:l,copy:!1,copySortSource:!1,dontCopyModel:!1,invalid:a,revertOnSpill:!1,removeOnSpill:!1,lockX:!1,lockY:!1,boundingBox:!1,mirrorContainer:O.body,ignoreInputTextSelection:!0,compileItemOnDrop:!1,onInit:!1},Me={containers:n.containers,containersCtx:n.containersCtx,sanitizeContainersModel:me,sanitizeContainers:o,addContainers:ue,removeContainers:ce,isContainer:Z,start:P,end:R,cancel:ne,remove:ie,destroy:le,dragging:!1};return x(),C(),I(),$(),ge.onInit&&ge.onInit(Me,ge),Me}function o(e,t,n){if(B(e))return e;if(w(e))return t?w(e[0])?e:[e]:e;if("string"==typeof e&&n){var r=n.$eval(e);return B(r)?r:function(){return n.$eval(e)}}return e?c(e):[]}function i(e,t,n,r){var o={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},i={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},a={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"},l=angular.element(e);if(e.addEventListener){var c={on:"addEventListener",off:"removeEventListener"};e[c[t]](n,r,{passive:!1}),e[c[t]](o[n],r,{passive:!1})}else"undefined"!=typeof navigator&&navigator.pointerEnabled&&i[n]?l[t](i[n],r):"undefined"!=typeof navigator&&navigator.msPointerEnabled&&a[n]?l[t](a[n],r):o[n]&&l[t](o[n],r),l[t](n,r)}function a(){return!1}function l(){return!0}function c(e,t){return w(e)?e:e.length?Array.prototype.slice.call(e,t):[e]}function u(e){if(e.touches)return e.touches.length;if(e.originalEvent&&e.originalEvent.touches)return e.originalEvent.touches.length;if(void 0!==e.which&&0!==e.which)return e.which;if(void 0!==e.buttons)return e.buttons;var t=e.button;return void 0!==t?1&t?1:2&t?3:4&t?2:0:void 0}function s(e){e.originalEvent&&(e=e.originalEvent),n.grabbed&&e.preventDefault()}function d(e,t){return"undefined"!=typeof window[t]?window[t]:T.clientHeight?T[e]:O.body[e]}function m(e){var t=e.getBoundingClientRect(),n=d("scrollTop","pageYOffset"),r=d("scrollLeft","pageXOffset");return{left:t.left+r,right:t.right+r,top:t.top+n,bottom:t.bottom+n}}function g(e){return e.width||e.right-e.left}function f(e){return e.height||e.bottom-e.top}function p(){return[]}function v(e){function t(){var t=e;do t=t.nextSibling;while(t&&1!==t.nodeType);return t}if(e)return e.nextElementSibling||t()}function h(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}function x(e){var t=n.classesCache[e];return t?t.lastIndex=0:n.classesCache[e]=t=new RegExp("(?:^|\\s)"+e+"(?:\\s|$)","g"),t}function y(e,t){var n=e.className;n.length?x(t).test(n)||(e.className+=" "+t):e.className=t}function M(e,t){e.className=e.className.replace(x(t)," ").trim()}function C(e){return e.targetTouches&&e.targetTouches.length?e.targetTouches[0]:e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e}function b(e,t){var n=C(t),r={pageX:"clientX",pageY:"clientY"};return e in r&&!(e in n)&&r[e]in n&&(e=r[e]),!n.type||n.type.indexOf("touch")<0?n[e]:n.type.indexOf("end")===-1&&n.originalEvent.touches[0][e.replace("client","page")]}function E(e){return e.parentNode===document?null:e.parentNode}function S(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName||"SELECT"===e.tagName||I(e)}function I(e){return!!e&&("false"!==e.contentEditable&&("true"===e.contentEditable||I(E(e))))}function N(e,t){return Array.prototype.indexOf.call(angular.element(t).children(),e)}function X(e,t,r){e&&(n.extra=r,e.dispatchEvent?e.dispatchEvent(t):e.fireEvent("on"+t.eventType,t))}function Y(e,t,r){return B(e)?!!e.apply(r||this,t||n):!!e}var O=document,T=O.documentElement,w=Array.isArray,B=angular.isFunction;return r.cleanEnviroment=function(){n.classesCache={},n.containersCtx={},n.containers={},n.mirror=void 0},r.shared=n,r};r.$inject=["$rootScope","$compile"],e.exports=r}])}); //# sourceMappingURL=dragular.min.js.map diff --git a/dist/dragular.min.js.map b/dist/dragular.min.js.map index ba301af3..2818547e 100644 --- a/dist/dragular.min.js.map +++ b/dist/dragular.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["dragular.js"],"names":["root","factory","exports","module","define","amd","a","i","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","dragularDirective","dragularService","angular","directive","dragular","restrict","link","$scope","iElm","iAttrs","tryJson","json","JSON","parse","e","options","$eval","dragularModel","containersModel","scope","dragularNameSpace","nameSpace","split","dragularOnInit","onInit","$inject","shared","classesCache","containersCtx","containers","mirror","source","item","copy","sourceItem","sourceModel","sourceFilteredModel","target","targetCtx","targetModel","lastDropTarget","offsetX","offsetY","moveX","moveY","offsetXr","offsetYb","clientX","clientY","mirrorWidth","mirrorHeight","initialSibling","currentSibling","initialIndex","currentIndex","tempModel","dragOverEvents","lastElementBehindCursor","grabbed","$rootScope","$compile","service","arg0","arg1","processServiceArguments","arguments","length","_isArray","isElement","initialContainers","document","querySelectorAll","o","copyOptions","extendOptions","tmp","extend","defaultOptions","classes","defaultClasses","eventNames","defaultEventNames","processOptionsObject","boundingBox","sanitizeContainers","containersFilteredModel","forEach","cont","len","getContainers","Error","indexOf","push","getContainersModel","fm","registerEvents","remove","op","regEvent","_docElm","release","container","grab","name","eventName","_doc","createEvent","initEvent","createEventObject","eventType","whichMouseButton","metaKey","ctrlKey","context","canStart","eventualMovements","type","isInput","focus","preventDefault","startBecauseMouseMoved","drake","dragging","originalEvent","g","ignoreInputTextSelection","getCoord","elementBehindCursor","elementFromPoint","movements","end","start","direction","getParent","parent","parentNode","parentHeight","offsetHeight","parentWidth","offsetWidth","childHeight","clientHeight","childWidth","clientWidth","offset","getOffset","left","top","right","bottom","renderMirrorImage","addClass","transit","style","drag","preventGrabbed","handle","isContainer","invalid","moves","nextEl","element","clone","$emit","dragularcloned","containerIndex","domIndexOf","dragulardrag","manualStart","rect","getBoundingClientRect","cloneNode","width","height","getRectWidth","getRectHeight","mirrorContainer","appendChild","body","unselectable","scrollContainer","drop","ungrab","moved","notify","removeOnSpill","spillOver","spillOut","pageX","pageY","offsetBox","x","y","lockY","lockX","getElementBehindPoint","dropTarget","findDropTarget","changed","fireEvent","dragularenter","dragularleave","copySortSource","removeChild","reference","immediate","getImmediateChild","getReference","revertOnSpill","insertBefore","dragularshadow","accepted","initial","isInitialPlacement","getTargetCtx","_isFunction","accepts","isContainerAccepts","canBeAccepted","rmClass","hide","s","sibling","undefined","outside","el","children","horizontal","inside","resolve","after","point","state","className","isContainerModel","opt","_getContainers","containersType","to2d","cancel","revert","reverts","dragularcancel","cleanup","dragularrelease","afterDrop","dragulardrop","dropIndex","compileItemOnDrop","$applyAsync","content","splice","dropElmModel","dontCopyModel","dragularremove","removeMirrorImage","dragularout","dragulardragend","destroy","removeContainers","all","changes","makeArray","index","before","scrollTop","deltaY","stopPropagation","depSanitize","getBool","dragularover","never","getEmptyArray","always","sanitizeContainersModel","evaluated","fn","touch","mouseup","mousedown","mousemove","pointers","microsoft","$el","addEventListener","opConvert","on","off","passive","navigator","pointerEnabled","msPointerEnabled","startIndex","Array","prototype","slice","touches","which","buttons","button","getScroll","scrollProp","offsetProp","window","scrollLeft","manually","nextSibling","nodeType","nextElementSibling","obj","HTMLElement","nodeName","lookupClass","cached","lastIndex","RegExp","current","test","replace","trim","getEventHost","targetTouches","changedTouches","coord","host","missMap","tagName","isEditable","contentEditable","child","extra","dispatchEvent","prop","args","apply","documentElement","isArray","isFunction","cleanEnviroment"],"mappings":"CAAA,SAA2CA,EAAMC,GAChD,GAAsB,gBAAZC,UAA0C,gBAAXC,QACxCA,OAAOD,QAAUD,QACb,IAAqB,kBAAXG,SAAyBA,OAAOC,IAC9CD,UAAWH,OACP,CACJ,GAAIK,GAAIL,GACR,KAAI,GAAIM,KAAKD,IAAuB,gBAAZJ,SAAuBA,QAAUF,GAAMO,GAAKD,EAAEC,KAErEC,KAAM,WACT,MAAgB,UAAUC,GAKhB,QAASC,GAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,MAAOC,GAAiBD,GAAUT,OAGnC,IAAIC,GAASS,EAAiBD,IAC7BT,WACAW,GAAIF,EACJG,QAAQ,EAUT,OANAL,GAAQE,GAAUI,KAAKZ,EAAOD,QAASC,EAAQA,EAA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,GAAS4F,WAAYuG,GAG5E,QAASlI,GAAWlK,EAAQvB,EAAG4T,GACxBrS,IAGNX,EAAOgT,MAAQA,EACVrS,EAAOsS,cACXtS,EAAOsS,cAAe7T,GAEtBuB,EAAOkK,UAAW,KAAOzL,EAAE+F,UAAW/F,IAIxC,QAAS+P,GAAS+D,EAAMC,EAAM5N,GAC7B,MAAKsG,GAAaqH,KACRA,EAAKE,MAAO7N,GAAW5H,KAAMwV,GAAQnT,KAErCkT,EAx1CX,GAAInO,GAAOnC,SACV6B,EAAUM,EAAKsO,gBACf5Q,EAAWkO,MAAM2C,QACjBzH,EAAcrN,QAAQ+U,UAYvB,OATApR,GAAQqR,gBAAkB,WACzBxT,EAAOC,gBACPD,EAAOE,iBACPF,EAAOG,cACPH,EAAOI,OAASiM,QAGjBlK,EAAQnC,OAASA,EAEVmC,EA+0CR5D,GAAgBwB,SAAY,aAAc,YAE1CzC,EAAOD,QAAUkB","file":"dragular.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n\n\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* global angular */\n\t'use strict';\n\tvar dragularDirective = __webpack_require__( 1 );\n\tvar dragularService = __webpack_require__( 2 );\n\n\t/**\n\t * Dragular 4.4.6 by Luckylooke https://github.com/luckylooke/dragular\n\t * Angular version of dragula https://github.com/bevacqua/dragula\n\t */\n\tmodule.exports = 'dragularModule';\n\n\tangular\n\t\t.module( 'dragularModule', [] )\n\t\t.factory( 'dragularService', dragularService )\n\t\t.directive( 'dragular', dragularDirective );\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\t/**\n\t * dragular Directive by Luckylooke https://github.com/luckylooke/dragular\n\t * Angular version of dragula https://github.com/bevacqua/dragula\n\t */\n\n\tvar dragular = function ( dragularService ) {\n\t\treturn {\n\t\t\trestrict: 'A',\n\t\t\tlink: function ( $scope, iElm, iAttrs ) {\n\n\t\t\t\tvar options = $scope.$eval( iAttrs.dragular ) || tryJson( iAttrs.dragular ) || {};\n\n\t\t\t\tfunction tryJson( json ) {\n\t\t\t\t\ttry { // I dont like try catch solutions but I havent find sattisfying way of chcecking json validity.\n\t\t\t\t\t\treturn JSON.parse( json );\n\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( iAttrs.dragularModel ) {\n\t\t\t\t\toptions.containersModel = iAttrs.dragularModel;\n\t\t\t\t\tif ( !options.scope ){\n\t\t\t\t\t\toptions.scope = $scope;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( iAttrs.dragularNameSpace ) {\n\t\t\t\t\toptions.nameSpace = iAttrs.dragularNameSpace.split( ' ' );\n\t\t\t\t}\n\n\t\t\t\tif ( iAttrs.dragularOnInit ) {\n\t\t\t\t\toptions.onInit = $scope.$eval( iAttrs.dragularOnInit );\n\t\t\t\t}\n\n\t\t\t\tdragularService( iElm[ 0 ], options );\n\t\t\t}\n\t\t};\n\t};\n\n\tdragular.$inject = [ 'dragularService' ];\n\n\tmodule.exports = dragular;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n\t/* global angular */\n\t'use strict';\n\n\t/**\n\t * dragular Service by Luckylooke https://github.com/luckylooke/dragular\n\t * Angular version of dragula https://github.com/bevacqua/dragula\n\t */\n\n\tvar shared = { // sahred object between all service instances\n\t\tclassesCache: {}, // classes lookup cache\n\t\tcontainersCtx: {}, // containers model\n\t\tcontainers: {}, // containers\n\t\tmirror: null, // mirror image\n\t\tsource: null, // source container\n\t\titem: null, // item being dragged\n\t\tcopy: null, // copy flag\n\t\tsourceItem: null, // item originaly dragged if copy is enabled\n\t\tsourceModel: null, // source container model\n\t\tsourceFilteredModel: null, // source container filtered model if relevant\n\t\ttarget: null, // droppable container under drag item\n\t\ttargetCtx: null, // target container context\n\t\ttargetModel: null, // target container model\n\t\tlastDropTarget: null, // last container item was over\n\t\toffsetX: null, // reference x\n\t\toffsetY: null, // reference y\n\t\tmoveX: null, // reference move x\n\t\tmoveY: null, // reference move y\n\t\toffsetXr: null, // reference x right for boundingBox feature\n\t\toffsetYb: null, // reference y bottom for boundingBox feature\n\t\tclientX: null, // cache client x, init at grab, update at drag\n\t\tclientY: null, // cache client y, init at grab, update at drag\n\t\tmirrorWidth: null, // mirror width for boundingBox feature\n\t\tmirrorHeight: null, // mirror height for boundingBox feature\n\t\tinitialSibling: null, // reference sibling when grabbed\n\t\tcurrentSibling: null, // reference sibling now\n\t\tinitialIndex: null, // reference model index when grabbed\n\t\tcurrentIndex: null, // reference model index now\n\t\ttempModel: null, // if o.isContainer is used, model can be provided as well, it is temporary saved here during drags\n\t\tdragOverEvents: {}, // drag over events fired on element behind cursor\n\t\tlastElementBehindCursor: null, // last element behind cursor\n\t\tgrabbed: null // holds mousedown context until first mousemove\n\t};\n\n\tvar dragularService = function ( $rootScope, $compile ) {\n\n\t\t// abbreviations\n\t\tvar _doc = document,\n\t\t\t_docElm = _doc.documentElement,\n\t\t\t_isArray = Array.isArray,\n\t\t\t_isFunction = angular.isFunction;\n\n\t\t// clean common/shared objects\n\t\tservice.cleanEnviroment = function cleanEnviroment() {\n\t\t\tshared.classesCache = {};\n\t\t\tshared.containersCtx = {};\n\t\t\tshared.containers = {};\n\t\t\tshared.mirror = undefined;\n\t\t};\n\n\t\tservice.shared = shared;\n\n\t\treturn service;\n\n\t\t// service definition\n\t\tfunction service( arg0, arg1 ) {\n\n\t\t\t// console.log('dragularService arg0, arg1', arg0, arg1);\n\n\t\t\tvar initialContainers = arg0 || [],\n\t\t\t\toptions = arg1 || {},\n\t\t\t\to, // shorthand for options\n\t\t\t\tg = getBool, // shorthand for getBool\n\n\t\t\t\t// defaults\n\t\t\t\tdefaultClasses = {\n\t\t\t\t\tmirror: 'gu-mirror',\n\t\t\t\t\thide: 'gu-hide',\n\t\t\t\t\tunselectable: 'gu-unselectable',\n\t\t\t\t\ttransit: 'gu-transit'\n\t\t\t\t},\n\t\t\t\tdefaultEventNames = {\n\t\t\t\t\t// drag-over DOM events\n\t\t\t\t\tdragularenter: 'dragularenter',\n\t\t\t\t\tdragularleave: 'dragularleave',\n\t\t\t\t\tdragularrelease: 'dragularrelease',\n\t\t\t\t\t// $scope events\n\t\t\t\t\tdragularcloned: 'dragularcloned',\n\t\t\t\t\tdragulardrag: 'dragulardrag',\n\t\t\t\t\tdragularcancel: 'dragularcancel',\n\t\t\t\t\tdragulardrop: 'dragulardrop',\n\t\t\t\t\tdragularremove: 'dragularremove',\n\t\t\t\t\tdragulardragend: 'dragulardragend',\n\t\t\t\t\tdragularshadow: 'dragularshadow',\n\t\t\t\t\tdragularover: 'dragularover',\n\t\t\t\t\tdragularout: 'dragularout'\n\t\t\t\t},\n\t\t\t\tdefaultOptions = { // options with defaults\n\t\t\t\t\tcopyOptions: false, // copy options object when provided\n\t\t\t\t\tclasses: defaultClasses, // classes used by dragular\n\t\t\t\t\teventNames: defaultEventNames, // event names used by dragular\n\t\t\t\t\tcontainers: false, // initial containers provided via options object (are provided via parameter by default)\n\t\t\t\t\tcontainersModel: false, // if provided, model will be synced with DOM\n\t\t\t\t\tcontainersFilteredModel: false, // if provided, dragular will handle filtered model cases\n\t\t\t\t\tisContainer: never, // potential target can be forced to be container by custom logic\n\t\t\t\t\tisContainerModel: getEmptyArray, // if isContainer function is provided, you can provide also respective model\n\t\t\t\t\tisContainerAccepts: always, // if isContainer function is provided, you can provide also respective accept function\n\t\t\t\t\tmoves: always, // can drag start?\n\t\t\t\t\taccepts: always, // can target accept dragged item? (target context used)\n\t\t\t\t\tcanBeAccepted: always, // can be dragged item accepted by target? (source context used)\n\t\t\t\t\tcopy: false, // dragged item will be copy of source? flag or function\n\t\t\t\t\tcopySortSource: false, // enable sorting in source when copying item\n\t\t\t\t\tdontCopyModel: false, // dont make copy of model when coping item (#61)\n\t\t\t\t\tinvalid: never, // target (in)validity function\n\t\t\t\t\trevertOnSpill: false, // item returns to original place\n\t\t\t\t\tremoveOnSpill: false, // item will be removed if not placed into valid target\n\t\t\t\t\tlockX: false, // lock movement into x-axis\n\t\t\t\t\tlockY: false, // lock movement into y-axis\n\t\t\t\t\tboundingBox: false, // lock movement inside this element boundaries\n\t\t\t\t\tmirrorContainer: _doc.body, // element for appending mirror\n\t\t\t\t\tignoreInputTextSelection: true, // text selection in inputs wont be considered as drag\n\t\t\t\t\tcompileItemOnDrop: false,\n\t\t\t\t\tonInit: false // function callback called after dragular initialisation and providing drake as first argument\n\t\t\t\t},\n\n\t\t\t\tdrake = {\n\t\t\t\t\tcontainers: shared.containers, // all containers\n\t\t\t\t\tcontainersCtx: shared.containersCtx, // all contexts to containers\n\t\t\t\t\tsanitizeContainersModel: depSanitize,\n\t\t\t\t\tsanitizeContainers: sanitizeContainers,\n\t\t\t\t\tisContainer: isContainer,\n\t\t\t\t\tstart: manualStart,\n\t\t\t\t\tend: end,\n\t\t\t\t\tcancel: cancel,\n\t\t\t\t\tremove: remove,\n\t\t\t\t\tdestroy: destroy,\n\t\t\t\t\tdragging: false\n\t\t\t\t};\n\n\t\t\tprocessServiceArguments(); // both arguments (containers and options) are optional, this function handle this\n\t\t\textendOptions();\n\t\t\tprocessOptionsObject();\n\t\t\tregisterEvents();\n\n\t\t\tif ( o.onInit ) {\n\t\t\t\to.onInit( drake, o );\n\t\t\t}\n\t\t\treturn drake;\n\n\n\t\t\t// Function definitions: ==============================================================================================================\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Dragular service init functions: ---------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction processServiceArguments() {\n\n\t\t\t\tif ( arguments.length === 1 && // if there is only one argument we need to distinguish if it is options object or container(s) reference\n\n\t\t\t\t\t!_isArray( arg0 ) && // array of containers elements\n\t\t\t\t\t!angular.isElement( arg0 ) && // one container element\n\t\t\t\t\t!arg0[ 0 ] && // array-like object with containers elements\n\t\t\t\t\ttypeof arg0 !== 'string' ) { // selector\n\t\t\t\t\t// then arg0 is options object\n\t\t\t\t\toptions = arg0 || {};\n\t\t\t\t\tinitialContainers = []; // containers are not provided on init\n\t\t\t\t}\n\t\t\t\telse if ( typeof arg0 === 'string' ) {\n\n\t\t\t\t\tinitialContainers = document.querySelectorAll( arg0 );\n\t\t\t\t}\n\n\t\t\t\to = options.copyOptions ? angular.copy( options ) : options;\n\t\t\t}\n\n\t\t\tfunction extendOptions() {\n\n\t\t\t\tvar tmp = angular.extend( {}, defaultOptions, o ); // tmp for keeping defaults untouched\n\t\t\t\tangular.extend( o, tmp ); // merge defaults back into options\n\n\t\t\t\tif ( o.classes ) {\n\n\t\t\t\t\ttmp = angular.extend( {}, defaultClasses, o.classes );\n\t\t\t\t\tangular.extend( o.classes, tmp );\n\t\t\t\t}\n\n\t\t\t\tif ( o.eventNames ) {\n\n\t\t\t\t\ttmp = angular.extend( {}, defaultEventNames, o.eventNames );\n\t\t\t\t\tangular.extend( o.eventNames, tmp );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction processOptionsObject() {\n\n\t\t\t\t// bounding box must be pure DOM element, not jQuery wrapper or something else..\n\t\t\t\tif ( !isElement( o.boundingBox ) ) {\n\t\t\t\t\to.boundingBox = false;\n\t\t\t\t}\n\n\t\t\t\t// initial containers provided via options are higher priority then by parameter\n\t\t\t\tif ( o.containers ) {\n\t\t\t\t\tinitialContainers = o.containers;\n\t\t\t\t}\n\n\t\t\t\t// sanitize initialContainers\n\t\t\t\to.containers = sanitizeContainers( initialContainers, false, o.scope );\n\n\t\t\t\t// sanitize o.containersModel\n\t\t\t\to.containersModel = sanitizeContainers( o.containersModel, true, o.scope );\n\n\t\t\t\t// sanitize o.containersFilteredModel\n\t\t\t\tif ( _isArray( o.containersFilteredModel ) ) {\n\t\t\t\t\t// |-------- is 2D array? -----------|\n\t\t\t\t\to.containersFilteredModel = _isArray( o.containersFilteredModel[ 0 ] ) ? o.containersFilteredModel : [ o.containersFilteredModel ];\n\t\t\t\t} else {\n\t\t\t\t\to.containersFilteredModel = [];\n\t\t\t\t}\n\n\t\t\t\t// feed containers groups and optionaly do same for models\n\t\t\t\tif ( !o.nameSpace ) {\n\t\t\t\t\to.nameSpace = [ 'dragularCommon' ];\n\t\t\t\t}\n\n\t\t\t\tif ( !_isArray( o.nameSpace ) ) {\n\t\t\t\t\to.nameSpace = [ o.nameSpace ];\n\t\t\t\t}\n\n\t\t\t\to.nameSpace.forEach( function eachNameSpace( nameSpace ) {\n\n\t\t\t\t\tif ( !shared.containers[ nameSpace ] ) {\n\n\t\t\t\t\t\tshared.containers[ nameSpace ] = [];\n\t\t\t\t\t\tshared.containersCtx[ nameSpace ] = [];\n\t\t\t\t\t}\n\n\t\t\t\t\tvar len = getContainers( o ).length,\n\t\t\t\t\t\tcont;\n\n\t\t\t\t\tfor ( var i = 0; i < len; i++ ) {\n\n\t\t\t\t\t\tcont = getContainers( o )[ i ];\n\n\t\t\t\t\t\tif (!cont) {\n\t\t\t\t\t\t\tthrow new Error( 'Container element must be defined!' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (shared.containers[ nameSpace ].indexOf(cont) !== -1) {\n\t\t\t\t\t\t\tthrow new Error( 'Cannot register container element more than once! Container element: ' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tshared.containers[ nameSpace ].push(cont);\n\t\t\t\t\t\tshared.containersCtx[ nameSpace ].push({\n\t\t\t\t\t\t\to: o,\n\t\t\t\t\t\t\tm: getContainersModel( o )[ i ], // can be undefined\n\t\t\t\t\t\t\tfm: o.containersFilteredModel[ i ] // can be undefined\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tfunction registerEvents( remove ) {\n\t\t\t\tvar op = remove ? 'off' : 'on';\n\t\t\t\tregEvent( _docElm, op, 'mouseup', release );\n\n\t\t\t\tgetContainers( o ).forEach( function addMouseDown( container ) {\n\t\t\t\t\tregEvent( container, 'on', 'mousedown', grab );\n\t\t\t\t} );\n\n\t\t\t\tif ( !remove ) { // create dragular DOM events\n\t\t\t\t\tangular.forEach( [ 'dragularenter', 'dragularleave', 'dragularrelease' ], function prepareDragOverEvents( name ) {\n\t\t\t\t\t\tvar eventName = o.eventNames[ name ];\n\t\t\t\t\t\tif ( !shared.dragOverEvents[ eventName ] ) {\n\t\t\t\t\t\t\tif ( _doc.createEvent ) {\n\t\t\t\t\t\t\t\tshared.dragOverEvents[ eventName ] = _doc.createEvent( 'HTMLEvents' );\n\t\t\t\t\t\t\t\tshared.dragOverEvents[ eventName ].initEvent( eventName, true, true );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tshared.dragOverEvents[ eventName ] = _doc.createEventObject();\n\t\t\t\t\t\t\t\tshared.dragOverEvents[ eventName ].eventType = eventName;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Grab stage: ------------------------------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction grab( e ) {\n\n\t\t\t\t// filter some odd situations\n\t\t\t\tif ( whichMouseButton( e ) !== 1 || e.metaKey || e.ctrlKey ) {\n\t\t\t\t\treturn; // we only care about honest-to-god left clicks and touch events\n\t\t\t\t}\n\n\t\t\t\t// set itial values\n\t\t\t\tshared.moveX = e.clientX;\n\t\t\t\tshared.moveY = e.clientY;\n\n\t\t\t\tvar context = canStart( e.target );\n\t\t\t\tif ( !context || !context.item ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tshared.grabbed = context;\n\t\t\t\teventualMovements();\n\t\t\t\tif ( e.type === 'mousedown' ) {\n\t\t\t\t\tif ( isInput( e.target ) ) { // see also: https://github.com/bevacqua/dragula/issues/208\n\t\t\t\t\t\te.target.focus(); // fixes https://github.com/bevacqua/dragula/issues/176\n\t\t\t\t\t\t// changed from context.item to e.target fixing https://github.com/luckylooke/dragular/issues/87#issuecomment-256865796\n\t\t\t\t\t} else {\n\t\t\t\t\t\te.preventDefault(); // fixes https://github.com/bevacqua/dragula/issues/155\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction eventualMovements( remove ) {\n\n\t\t\t\tvar op = remove ? 'off' : 'on';\n\t\t\t\tregEvent( _docElm, op, 'mousemove', startBecauseMouseMoved );\n\t\t\t}\n\n\t\t\tfunction startBecauseMouseMoved( e ) {\n\n\t\t\t\tif ( !shared.grabbed || drake.dragging ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( e.originalEvent ) {\n\t\t\t\t\te = e.originalEvent; // jQuery enviroment\n\t\t\t\t}\n\n\t\t\t\tif ( whichMouseButton( e ) === 0 ) {\n\t\t\t\t\trelease( {} );\n\t\t\t\t\treturn; // when text is selected on an input and then dragged, mouseup doesn't fire. this is our only hope\n\t\t\t\t}\n\n\t\t\t\t// truthy check fixes dragula-#239, equality fixes dragula-#207\n\t\t\t\tif ( e.clientX && e.clientX === shared.moveX && e.clientY && e.clientY === shared.moveY ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( g( o.ignoreInputTextSelection ) ) {\n\n\t\t\t\t\tvar clientX = getCoord( 'clientX', e ),\n\t\t\t\t\t\tclientY = getCoord( 'clientY', e ),\n\t\t\t\t\t\telementBehindCursor = _doc.elementFromPoint( clientX, clientY );\n\t\t\t\t\tif ( isInput( elementBehindCursor ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar grabbed = shared.grabbed; // calling end() unsets shared.grabbed\n\t\t\t\teventualMovements( 'remove' ); // remove mousemove listener\n\t\t\t\tmovements();\n\t\t\t\tend();\n\t\t\t\tstart( grabbed );\n\n\t\t\t\tif ( !shared.item ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// automaticly detect direction of elements if not set in options\n\t\t\t\tif ( !o.direction && getParent( shared.sourceItem ) ) {\n\t\t\t\t\tvar parent = shared.sourceItem.parentNode,\n\t\t\t\t\t\tparentHeight = parent.offsetHeight,\n\t\t\t\t\t\tparentWidth = parent.offsetWidth,\n\t\t\t\t\t\tchildHeight = shared.sourceItem.clientHeight,\n\t\t\t\t\t\tchildWidth = shared.sourceItem.clientWidth;\n\t\t\t\t\to.direction = parentHeight / childHeight < parentWidth / childWidth ? 'horizontal' : 'vertical';\n\t\t\t\t}\n\n\t\t\t\t// get initial coordinates, used to render shared.mirror for first time\n\t\t\t\tvar offset = getOffset( shared.sourceItem );\n\t\t\t\tshared.offsetX = getCoord( 'pageX', e ) - offset.left;\n\t\t\t\tshared.offsetY = getCoord( 'pageY', e ) - offset.top;\n\t\t\t\tshared.clientX = getCoord( 'clientX', e );\n\t\t\t\tshared.clientY = getCoord( 'clientY', e );\n\n\t\t\t\t// limiting area of shared.mirror movement, get initial coordinates\n\t\t\t\tif ( o.boundingBox ) {\n\t\t\t\t\tshared.offsetXr = getCoord( 'pageX', e ) - offset.right;\n\t\t\t\t\tshared.offsetYb = getCoord( 'pageY', e ) - offset.bottom;\n\t\t\t\t}\n\n\t\t\t\te.preventDefault();\n\n\t\t\t\trenderMirrorImage();\n\t\t\t\taddClass( shared.item, o.classes.transit );\n\t\t\t\t// initial position\n\t\t\t\tshared.mirror.style.left = shared.clientX - shared.offsetX + 'px';\n\t\t\t\tshared.mirror.style.top = shared.clientY - shared.offsetY + 'px';\n\n\t\t\t\tdrag( e );\n\t\t\t}\n\n\t\t\tfunction movements( remove ) {\n\n\t\t\t\tvar op = remove ? 'off' : 'on';\n\t\t\t\tregEvent( _docElm, op, 'selectstart', preventGrabbed ); // IE8\n\t\t\t\tregEvent( _docElm, op, 'click', preventGrabbed );\n\t\t\t\tregEvent( _docElm, op, 'touchmove', preventGrabbed ); // fixes touch devices scrolling while drag\n\t\t\t}\n\n\t\t\tfunction canStart( item ) {\n\t\t\t\tif ( drake.dragging && shared.mirror ) {\n\t\t\t\t\treturn; // already dragging\n\t\t\t\t}\n\n\t\t\t\tvar handle = item;\n\t\t\t\twhile ( getParent( item ) && !isContainer( getParent( item ) ) ) {\n\t\t\t\t\t// break loop if user tries to drag item which is considered invalid handle\n\t\t\t\t\tif ( o.invalid( item, handle ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\titem = getParent( item ); // drag target should be immediate child of container\n\t\t\t\t\tif ( !item ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar source = getParent( item );\n\t\t\t\tif ( !source ||\n\t\t\t\t\to.invalid( item, handle ) || !o.moves( item, source, handle, nextEl( item ) ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\titem: item,\n\t\t\t\t\tsource: source\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tfunction start( context ) {\n\t\t\t\tshared.sourceItem = shared.item = context.item;\n\t\t\t\tshared.source = context.source;\n\t\t\t\tshared.initialSibling = shared.currentSibling = nextEl( context.item );\n\n\t\t\t\tif ( g( o.copy, [ context.item, context.source ] ) ) {\n\t\t\t\t\t// http://api.jquery.com/clone/#clone-withDataAndEvents-deepWithDataAndEvents\n\t\t\t\t\tshared.item = angular.element( context.item ).clone( o.copy === 'events', o.copy === 'events' )[0];\n\t\t\t\t\tshared.copy = o.copy;\n\t\t\t\t\tif ( o.scope ) {\n\t\t\t\t\t\to.scope.$emit( o.eventNames.dragularcloned, shared.item, context.item );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tshared.copy = false;\n\t\t\t\t}\n\n\t\t\t\t// prepare models operations\n\t\t\t\tvar containerIndex = getContainers( o ).indexOf( context.source );\n\t\t\t\tshared.sourceModel = getContainersModel( o )[ containerIndex ];\n\n\t\t\t\tshared.sourceFilteredModel = o.containersFilteredModel[ containerIndex ];\n\t\t\t\tshared.initialIndex = domIndexOf( context.item, context.source );\n\n\t\t\t\tdrake.dragging = true;\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\to.scope.$emit( o.eventNames.dragulardrag, shared.sourceItem, shared.source );\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tfunction manualStart( item ) {\n\t\t\t\tvar context = canStart( item );\n\t\t\t\tif ( context ) {\n\t\t\t\t\tshared.grabbed = context;\n\t\t\t\t\teventualMovements();\n\t\t\t\t\t//start(context);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction renderMirrorImage() {\n\t\t\t\tif ( shared.mirror ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar rect = shared.sourceItem.getBoundingClientRect();\n\t\t\t\tshared.mirror = shared.sourceItem.cloneNode( true );\n\t\t\t\tshared.mirrorWidth = rect.width;\n\t\t\t\tshared.mirrorHeight = rect.height;\n\t\t\t\tshared.mirror.style.width = getRectWidth( rect ) + 'px';\n\t\t\t\tshared.mirror.style.height = getRectHeight( rect ) + 'px';\n\t\t\t\taddClass( shared.mirror, o.classes.mirror );\n\t\t\t\to.mirrorContainer.appendChild( shared.mirror );\n\t\t\t\tregEvent( _docElm, 'on', 'mousemove', drag );\n\t\t\t\taddClass( _doc.body, o.classes.unselectable );\n\t\t\t\tregEvent( shared.mirror, 'on', 'wheel', scrollContainer );\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\to.scope.$emit( o.eventNames.dragularcloned, shared.mirror, shared.sourceItem );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction end() {\n\t\t\t\tif ( !drake.dragging || !shared.item ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdrop( shared.item, getParent( shared.item ) );\n\t\t\t}\n\n\t\t\tfunction ungrab() {\n\t\t\t\tshared.grabbed = false;\n\t\t\t\teventualMovements( 'remove' );\n\t\t\t\tmovements( 'remove' );\n\t\t\t}\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Drag stage: ------------------------------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction drag( e ) { // watch performance!! - function is running each mousemove!\n\t\t\t\tif ( !shared.mirror ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( e.originalEvent ) {\n\t\t\t\t\te = e.originalEvent; // jQuery environment\n\t\t\t\t}\n\n\t\t\t\t// update coordinates\n\t\t\t\tshared.clientX = getCoord( 'clientX', e );\n\t\t\t\tshared.clientY = getCoord( 'clientY', e );\n\n\t\t\t\t// count mirror coordinates\n\t\t\t\tvar x = shared.clientX - shared.offsetX,\n\t\t\t\t\ty = shared.clientY - shared.offsetY,\n\t\t\t\t\tpageX,\n\t\t\t\t\tpageY,\n\t\t\t\t\toffsetBox;\n\n\t\t\t\t// fill extra properties if boundingBox is used\n\t\t\t\tif ( o.boundingBox ) {\n\t\t\t\t\tpageX = getCoord( 'pageX', e );\n\t\t\t\t\tpageY = getCoord( 'pageY', e );\n\t\t\t\t\toffsetBox = getOffset( o.boundingBox );\n\t\t\t\t}\n\n\t\t\t\tif ( !o.lockY ) {\n\t\t\t\t\tif ( !o.boundingBox || (pageX > offsetBox.left + shared.offsetX && pageX < offsetBox.right + shared.offsetXr) ) {\n\t\t\t\t\t\tshared.mirror.style.left = x + 'px';\n\t\t\t\t\t} else if ( o.boundingBox ) { // check again in case user scrolled the view\n\t\t\t\t\t\tif ( pageX < offsetBox.left + shared.offsetX ) {\n\t\t\t\t\t\t\tshared.mirror.style.left = shared.clientX - (pageX - offsetBox.left) + 'px';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tshared.mirror.style.left = shared.clientX - shared.mirrorWidth - (pageX - offsetBox.right) + 'px';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( !o.lockX ) {\n\t\t\t\t\tif ( !o.boundingBox || (pageY > offsetBox.top + shared.offsetY && pageY < offsetBox.bottom + shared.offsetYb) ) {\n\t\t\t\t\t\tshared.mirror.style.top = y + 'px';\n\t\t\t\t\t} else if ( o.boundingBox ) { // check again in case user scrolled the view\n\t\t\t\t\t\tif ( pageY < offsetBox.top + shared.offsetY ) {\n\t\t\t\t\t\t\tshared.mirror.style.top = shared.clientY - (pageY - offsetBox.top) + 'px';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tshared.mirror.style.top = shared.clientY - shared.mirrorHeight - (pageY - offsetBox.bottom) + 'px';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar elementBehindCursor = getElementBehindPoint( shared.mirror, shared.clientX, shared.clientY ),\n\t\t\t\t\tdropTarget = findDropTarget( elementBehindCursor, shared.clientX, shared.clientY ),\n\t\t\t\t\tchanged = dropTarget !== shared.lastDropTarget;\n\n\t\t\t\tif ( elementBehindCursor !== shared.lastElementBehindCursor ) {\n\t\t\t\t\tfireEvent( elementBehindCursor, shared.dragOverEvents.dragularenter, !!dropTarget );\n\t\t\t\t\tif ( shared.lastElementBehindCursor ) {\n\t\t\t\t\t\tfireEvent( shared.lastElementBehindCursor, shared.dragOverEvents.dragularleave, elementBehindCursor );\n\t\t\t\t\t}\n\t\t\t\t\tshared.lastElementBehindCursor = elementBehindCursor;\n\t\t\t\t}\n\n\t\t\t\tif ( changed ) {\n\t\t\t\t\tif ( shared.lastDropTarget ) {\n\t\t\t\t\t\tmoved( 'out' );\n\t\t\t\t\t}\n\t\t\t\t\tshared.lastDropTarget = dropTarget;\n\t\t\t\t\tmoved( 'over' );\n\t\t\t\t}\n\n\t\t\t\t// do not copy in same container\n\t\t\t\tif ( dropTarget === shared.source && shared.copy && !g( o.copySortSource ) ) {\n\t\t\t\t\tif ( getParent( shared.item ) ) {\n\t\t\t\t\t\tshared.item.parentNode.removeChild( shared.item );\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar reference,\n\t\t\t\t\timmediate = getImmediateChild( dropTarget, elementBehindCursor );\n\n\t\t\t\tif ( immediate !== null ) {\n\t\t\t\t\treference = getReference( dropTarget, immediate, shared.clientX, shared.clientY );\n\t\t\t\t} else if ( g( o.revertOnSpill ) === true && !shared.copy ) {\n\t\t\t\t\t// the case that mirror is not over valid target and reverting is on and copy is off\n\t\t\t\t\treference = shared.initialSibling;\n\t\t\t\t\tdropTarget = shared.source;\n\t\t\t\t} else {\n\t\t\t\t\t// the case that mirror is not over valid target and removing is on or copy is on\n\t\t\t\t\tif ( shared.copy && getParent( shared.item ) ) {\n\t\t\t\t\t\t// remove item or copy of item\n\t\t\t\t\t\tshared.item.parentNode.removeChild( shared.item );\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( reference === null ||\n\t\t\t\t\treference !== shared.item &&\n\t\t\t\t\treference !== nextEl( shared.item ) &&\n\t\t\t\t\treference !== shared.currentSibling ) {\n\t\t\t\t\t// moving item/copy to new container from previous one\n\t\t\t\t\tshared.currentSibling = reference;\n\n\t\t\t\t\tdropTarget.insertBefore( shared.item, reference ); // if reference is null item is inserted at the end\n\n\t\t\t\t\tif ( o.scope ) {\n\t\t\t\t\t\to.scope.$emit( o.eventNames.dragularshadow, shared.item, dropTarget, e );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction moved( type ) {\n\t\t\t\t\tif ( o.scope ) {\n\t\t\t\t\t\tnotify( o.scope );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( shared.targetCtx && shared.targetCtx.o.scope && shared.targetCtx.o.scope !== o.scope ) {\n\t\t\t\t\t\tnotify( shared.targetCtx.o.scope );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( g( o.removeOnSpill ) === true ) {\n\t\t\t\t\t\ttype === 'over' ? spillOver() : spillOut();\n\t\t\t\t\t}\t\n\n\t\t\t\t\tfunction notify( scope ){\n\t\t\t\t\t\tscope.$emit( o.eventNames[ 'dragular' + type ], shared.item, shared.lastDropTarget, shared.source, e );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// find valid drop container\n\t\t\tfunction findDropTarget( elementBehindCursor, clientX, clientY ) { // watch performance!! - running each move!\n\t\t\t\tvar target = elementBehindCursor,\n\t\t\t\t\ttargetCtx = null;\n\n\t\t\t\twhile ( target && !accepted() ) {\n\t\t\t\t\ttarget = getParent( target );\n\t\t\t\t}\n\n\t\t\t\t// bugfix #148 model not updated on spill\n\t\t\t\t// added target condition to fix #161\n\t\t\t\tif ( target && targetCtx ){\n\t\t\t\t\tshared.targetCtx = targetCtx;\n\t\t\t\t}\n\n\t\t\t\treturn target;\n\n\t\t\t\tfunction accepted() {\n\n\t\t\t\t\tif ( !isContainer( target ) ) { // is not droppable?\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar immediate = getImmediateChild( target, elementBehindCursor ),\n\t\t\t\t\t\treference = getReference( target, immediate, clientX, clientY ),\n\t\t\t\t\t\tinitial = isInitialPlacement( target, reference ),\n\t\t\t\t\t\ti = o.nameSpace.length,\n\t\t\t\t\t\tnameSpace;\n\n\t\t\t\t\twhile ( i-- ) { // for each namespace\n\t\t\t\t\t\tnameSpace = o.nameSpace[ i ];\n\t\t\t\t\t\tif ( shared.containers[ nameSpace ].indexOf( target ) !== -1 ) {\n\t\t\t\t\t\t\ttargetCtx = getTargetCtx( nameSpace );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// shared.target must be actual (used for scroll functionality)\n\t\t\t\t\tshared.target = target;\n\n\t\t\t\t\tif ( initial ) {\n\n\t\t\t\t\t\treturn true; // accepts = true;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// try to find target in default set of containers\n\t\t\t\t\t\tif ( !targetCtx ) {\n\t\t\t\t\t\t\ttargetCtx = getTargetCtx( 'dragularCommon' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if found and containersModel is dynamic, retrieve model\n\t\t\t\t\t\tif ( targetCtx && _isFunction( targetCtx.o.containersModel ) ) {\n\t\t\t\t\t\t\t// fix targetCtx.m(odel) for dynamic containersModel\n\t\t\t\t\t\t\ttargetCtx.m = getContainersModel( targetCtx.o )[ getContainers( targetCtx.o ).indexOf( target ) ];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( targetCtx && // target container is defined via service or directive\n\t\t\t\t\t\t\ttargetCtx.o.accepts && !targetCtx.o.accepts( shared.item, target, shared.source, reference, shared.sourceModel, shared.initialIndex ) ) {\n\n\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\t} else if ( o.isContainer && // target container is recognized via o.isContainer\n\t\t\t\t\t\t\to.isContainerAccepts && !o.isContainerAccepts( shared.item, target, shared.source, reference, shared.sourceModel, shared.initialIndex ) ) {\n\n\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn !o.canBeAccepted || o.canBeAccepted( shared.item, target, shared.source, reference, shared.sourceModel, shared.initialIndex );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tfunction getTargetCtx( nameSpace ) {\n\t\t\t\t\treturn shared.containersCtx[ nameSpace ] && shared.containersCtx[ nameSpace ][ shared.containers[ nameSpace ].indexOf( target ) ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction spillOver() {\n\t\t\t\trmClass( shared.item, o.classes.hide );\n\t\t\t}\n\n\t\t\tfunction spillOut() {\n\t\t\t\tif ( drake.dragging ) {\n\t\t\t\t\taddClass( shared.item, o.classes.hide );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// is item currently placed in original container and original position?\n\t\t\tfunction isInitialPlacement( target, s ) { // watch performance - running each move several times!\n\t\t\t\tvar sibling = s !== undefined ? s : (shared.mirror ? shared.currentSibling : nextEl( shared.item ));\n\t\t\t\treturn target === shared.source && sibling === shared.initialSibling;\n\t\t\t}\n\n\t\t\tfunction getImmediateChild( dropTarget, target ) { // watch performance - running each move several times!\n\t\t\t\tvar immediate = target;\n\t\t\t\twhile ( immediate !== dropTarget && getParent( immediate ) !== dropTarget ) {\n\t\t\t\t\timmediate = getParent( immediate );\n\t\t\t\t}\n\t\t\t\tif ( immediate === _docElm ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn immediate;\n\t\t\t}\n\n\t\t\tfunction getReference( dropTarget, target, x, y ) { // watch performance - running each move several times!\n\t\t\t\tvar horizontal = o.direction === 'horizontal';\n\t\t\t\treturn target !== dropTarget ? inside() : outside();\n\n\t\t\t\tfunction outside() { // slower, but able to figure out any position\n\t\t\t\t\tvar len = dropTarget.children.length,\n\t\t\t\t\t\ti, el, rect;\n\t\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\t\tel = dropTarget.children[ i ];\n\t\t\t\t\t\trect = el.getBoundingClientRect();\n\t\t\t\t\t\tif ( horizontal && rect.left > x ) {\n\t\t\t\t\t\t\treturn el;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !horizontal && rect.top > y ) {\n\t\t\t\t\t\t\treturn el;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tfunction inside() { // faster, but only available if dropped inside a child element\n\t\t\t\t\tvar rect = target.getBoundingClientRect();\n\t\t\t\t\tif ( horizontal ) {\n\t\t\t\t\t\treturn resolve( x > rect.left + getRectWidth( rect ) / 2 );\n\t\t\t\t\t}\n\t\t\t\t\treturn resolve( y > rect.top + getRectHeight( rect ) / 2 );\n\t\t\t\t}\n\n\t\t\t\tfunction resolve( after ) {\n\t\t\t\t\treturn after ? nextEl( target ) : target;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction getElementBehindPoint( point, x, y ) { // watch performance!! - function is running each mousemove!\n\t\t\t\tvar p = point || {},\n\t\t\t\t\tstate = p.className,\n\t\t\t\t\tel;\n\t\t\t\tp.className += ' ' + o.classes.hide;\n\t\t\t\tel = _doc.elementFromPoint( x, y );\n\t\t\t\tp.className = state;\n\t\t\t\treturn el;\n\t\t\t}\n\n\t\t\tfunction isContainer( el ) {\n\n\t\t\t\tif ( !el ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar i = o.nameSpace.length;\n\t\t\t\twhile ( i-- ) {\n\n\t\t\t\t\tif ( shared.containers[ o.nameSpace[ i ] ].indexOf( el ) !== -1 ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( o.isContainer( el ) ) {\n\n\t\t\t\t\tshared.tempModel = o.isContainerModel( el );\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\n\t\t\t\t\tshared.tempModel = null;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tfunction getContainers( opt ) {\n\n\t\t\t\treturn _getContainers( 'containers', opt );\n\t\t\t}\n\n\t\t\tfunction getContainersModel( opt ) {\n\n\t\t\t\treturn _getContainers( 'containersModel', opt, true );\n\t\t\t}\n\n\t\t\tfunction _getContainers( containersType, opt, to2d ) {\n\n\t\t\t\treturn _isFunction( opt[ containersType ] ) ? sanitizeContainers(\n\t\t\t\t\topt[ containersType ](\n\t\t\t\t\t\t(opt === o ? drake : null),\n\t\t\t\t\t\tshared\n\t\t\t\t\t),\n\t\t\t\t\tto2d,\n\t\t\t\t\topt.scope\n\t\t\t\t) : opt[ containersType ];\n\t\t\t}\n\n\t\t\tfunction cancel( revert ) {\n\t\t\t\tif ( !drake.dragging ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar reverts = arguments.length > 0 ? revert : g( o.revertOnSpill ),\n\t\t\t\t\tparent = getParent( shared.item );\n\n\t\t\t\tvar initial = isInitialPlacement( parent );\n\t\t\t\tif ( !initial && !shared.copy && reverts ) {\n\t\t\t\t\tshared.source.insertBefore( shared.item, shared.initialSibling );\n\t\t\t\t}\n\t\t\t\tif ( shared.sourceModel && !shared.copy && !reverts ) {\n\t\t\t\t\tdrop( shared.item, parent );\n\t\t\t\t} else if ( o.scope ) {\n\t\t\t\t\tif ( initial || reverts ) {\n\t\t\t\t\t\to.scope.$emit( o.eventNames.dragularcancel, shared.item, shared.source, shared.sourceModel, shared.initialIndex );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( !shared.sourceModel || shared.copy || reverts || initial ) {\n\t\t\t\t\tcleanup();\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Release stage: ------------------------------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction release( e ) {\n\n\t\t\t\tungrab();\n\t\t\t\tif ( !drake.dragging ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( e.originalEvent ) {\n\t\t\t\t\te = e.originalEvent; // jQuery enviroment\n\t\t\t\t}\n\n\t\t\t\tshared.clientX = getCoord( 'clientX', e );\n\t\t\t\tshared.clientY = getCoord( 'clientY', e );\n\n\t\t\t\tvar elementBehindCursor = getElementBehindPoint( shared.mirror, shared.clientX, shared.clientY ),\n\t\t\t\t\tdropTarget = findDropTarget( elementBehindCursor, shared.clientX, shared.clientY );\n\n\t\t\t\tif ( dropTarget && ((shared.copy && g( o.copySortSource )) || (!shared.copy || dropTarget !== shared.source)) ) {\n\t\t\t\t\t// found valid target and (is not copy case or target is not initial container)\n\t\t\t\t\tdrop( shared.item, dropTarget );\n\t\t\t\t} else if ( g( o.removeOnSpill ) ) {\n\t\t\t\t\tremove();\n\t\t\t\t} else {\n\t\t\t\t\tcancel();\n\t\t\t\t}\n\n\t\t\t\t// after release there is no container hovered\n\t\t\t\tshared.target = null;\n\n\t\t\t\tif ( shared.lastElementBehindCursor ) {\n\t\t\t\t\tfireEvent( shared.lastElementBehindCursor, shared.dragOverEvents.dragularrelease, elementBehindCursor );\n\t\t\t\t}\n\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\to.scope.$emit( o.eventNames.dragularrelease, shared.item, shared.source, e );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction drop( item, target ) {\n\t\t\t\tif ( !item ) { // https://github.com/luckylooke/dragular/issues/102\n\t\t\t\t\tcleanup();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar sourceItem = shared.sourceItem,\n\t\t\t\t\tcurrentSibling = shared.currentSibling,\n\t\t\t\t\tdropIndex = domIndexOf( item, target );\n\n\t\t\t\tif ( shared.copy && target === shared.source && getParent( item ) && g( o.copySortSource ) ) {\n\t\t\t\t\titem.parentNode.removeChild( shared.sourceItem );\n\t\t\t\t}\n\n\t\t\t\tif ( shared.sourceModel && !isInitialPlacement( target ) ) {\n\t\t\t\t\tif ( shared.targetCtx && shared.targetCtx.fm ) { // target has filtered model\n\t\t\t\t\t\t// convert index from index-in-filteredModel to index-in-model\n\t\t\t\t\t\tdropIndex = shared.targetCtx.m.indexOf( shared.targetCtx.fm[ dropIndex ] );\n\t\t\t\t\t}\n\t\t\t\t\tif ( shared.sourceFilteredModel ) { // source has filtered model\n\t\t\t\t\t\t// convert index from index-in-filteredModel to index-in-model\n\t\t\t\t\t\tshared.initialIndex = shared.sourceModel.indexOf( shared.sourceFilteredModel[ shared.initialIndex ] );\n\t\t\t\t\t}\n\t\t\t\t\t$rootScope.$applyAsync( function applyDrop() {\n\t\t\t\t\t\tif ( !shared.sourceModel ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( target === shared.source ) {\n\t\t\t\t\t\t\tshared.sourceModel.splice( dropIndex, 0, shared.sourceModel.splice( shared.initialIndex, 1 )[ 0 ] );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tshared.dropElmModel = shared.copy && !o.dontCopyModel ? angular.copy( shared.sourceModel[ shared.initialIndex ] ) : shared.sourceModel[ shared.initialIndex ];\n\n\t\t\t\t\t\t\tif ( !shared.tempModel ) {\n\t\t\t\t\t\t\t\tshared.targetModel = ( shared.targetCtx && shared.targetCtx.m ) || shared.sourceModel;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tshared.targetModel = shared.tempModel;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\titem.parentNode.removeChild( item ); // element must be removed for ngRepeat to apply correctly\n\n\t\t\t\t\t\t\tif ( !shared.copy ) {\n\t\t\t\t\t\t\t\tshared.sourceModel.splice( shared.initialIndex, 1 );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( shared.targetModel ) {\n\t\t\t\t\t\t\t\tshared.targetModel.splice( dropIndex, 0, shared.dropElmModel );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// removing element, as protection against duplicates, angular ng-repeat will create new item according to model\n\t\t\t\t\t\tif ( getParent( item ) ) {\n\t\t\t\t\t\t\titem.parentNode.removeChild( item );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tafterDrop();\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tafterDrop();\n\t\t\t\t}\n\n\t\t\t\tfunction afterDrop() {\n\n\t\t\t\t\t// in nested containers case, new containers doesnt have registered mousedown\n\t\t\t\t\tgetContainers( o ).forEach( function readdMouseDown( container ) {\n\t\t\t\t\t\tregEvent( container, 'off', 'mousedown', grab );\n\t\t\t\t\t\tregEvent( container, 'on', 'mousedown', grab );\n\t\t\t\t\t} );\n\n\t\t\t\t\tif ( o.compileItemOnDrop ) {\n\t\t\t\t\t\tvar scope = angular.element( target ).scope ? angular.element( target ).scope() : o.scope;\n\t\t\t\t\t\tif ( scope ) {\n\t\t\t\t\t\t\tscope.$applyAsync( function () {\n\t\t\t\t\t\t\t\tvar content = $compile( shared.copy ? sourceItem.cloneNode( true ) : sourceItem )( scope );\n\t\t\t\t\t\t\t\tif ( item.parentNode === target ) {\n\t\t\t\t\t\t\t\t\ttarget.removeChild( item );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttarget.insertBefore( content[ 0 ], currentSibling );\n\t\t\t\t\t\t\t\tcleanup();\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( o.scope ) {\n\t\t\t\t\t\tnotify( o.scope );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( shared.targetCtx && shared.targetCtx.o.scope && shared.targetCtx.o.scope !== o.scope ) {\n\t\t\t\t\t\tnotify( shared.targetCtx.o.scope );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !o.compileItemOnDrop ) {\n\t\t\t\t\t\tcleanup();\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction notify( scope ){\n\t\t\t\t\t\tif ( isInitialPlacement( target ) ) {\n\t\t\t\t\t\t\tscope.$emit( o.eventNames.dragularcancel, item, shared.source, shared.sourceModel, shared.initialIndex );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tscope.$emit( o.eventNames.dragulardrop, item, target, shared.source, shared.sourceModel, shared.initialIndex, shared.targetModel, dropIndex );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction remove() {\n\t\t\t\tif ( !drake.dragging ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar parent = getParent( shared.item );\n\n\t\t\t\tif ( parent ) {\n\t\t\t\t\tparent.removeChild( shared.item );\n\t\t\t\t}\n\n\t\t\t\tif ( shared.sourceModel ) {\n\t\t\t\t\t$rootScope.$applyAsync( function removeModel() {\n\t\t\t\t\t\tshared.sourceModel.splice( shared.initialIndex, 1 );\n\t\t\t\t\t\tcleanup();\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\to.scope.$emit( shared.copy ? o.eventNames.dragularcancel : o.eventNames.dragularremove, shared.item, parent, shared.sourceModel, shared.initialIndex );\n\t\t\t\t}\n\t\t\t\tif ( !shared.sourceModel ) {\n\t\t\t\t\tcleanup();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction cleanup() {\n\t\t\t\tungrab();\n\t\t\t\tremoveMirrorImage();\n\n\t\t\t\tif ( shared.item ) {\n\t\t\t\t\trmClass( shared.item, o.classes.transit );\n\t\t\t\t}\n\n\t\t\t\tdrake.dragging = false;\n\n\t\t\t\tif ( g( o.removeOnSpill ) === true ) {\n\t\t\t\t\tspillOut();\n\t\t\t\t}\n\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\tif ( shared.lastDropTarget ) {\n\t\t\t\t\t\to.scope.$emit( o.eventNames.dragularout, shared.item, shared.lastDropTarget, shared.source );\n\t\t\t\t\t}\n\t\t\t\t\to.scope.$emit( o.eventNames.dragulardragend, shared.item );\n\t\t\t\t}\n\n\t\t\t\tshared.source = shared.item = shared.sourceItem = shared.initialSibling = shared.currentSibling = shared.sourceModel = null;\n\t\t\t\tshared.initialIndex = shared.currentIndex = shared.lastDropTarget = shared.tempModel = shared.targetModel = null;\n\t\t\t\tshared.dropElmModel = shared.targetCtx = shared.copy = shared.moveX = shared.moveY = null;\n\t\t\t}\n\n\t\t\tfunction destroy() {\n\n\t\t\t\tregisterEvents( true );\n\t\t\t\tremoveContainers( o.containers );\n\t\t\t\trelease( {} );\n\t\t\t}\n\n\t\t\tfunction removeContainers( all ) {\n\n\t\t\t\t$rootScope.$applyAsync( function applyDestroyed() {\n\n\t\t\t\t\tvar changes = _isArray( all ) ? all : makeArray( all );\n\t\t\t\t\tchanges.forEach( function forEachContainer( container ) {\n\n\t\t\t\t\t\tangular.forEach( o.nameSpace, function forEachNs( nameSpace ) {\n\n\t\t\t\t\t\t\tvar index;\n\t\t\t\t\t\t\tindex = shared.containers[ nameSpace ].indexOf( container );\n\t\t\t\t\t\t\tshared.containers[ nameSpace ].splice( index, 1 );\n\t\t\t\t\t\t\tshared.containersCtx[ nameSpace ].splice( index, 1 );\n\t\t\t\t\t\t} );\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tfunction scrollContainer( e ) {\n\t\t\t\tif ( shared.target ) {\n\t\t\t\t\tif ( e.originalEvent ) {\n\t\t\t\t\t\te = e.originalEvent; // jQuery enviroment\n\t\t\t\t\t}\n\t\t\t\t\tvar before = shared.target.scrollTop;\n\t\t\t\t\tshared.target.scrollTop += e.deltaY;\n\t\t\t\t\t// block scroll of the document when container can be scrolled\n\t\t\t\t\tif ( before !== shared.target.scrollTop ) {\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction removeMirrorImage() {\n\t\t\t\tif ( shared.mirror ) {\n\t\t\t\t\trmClass( _doc.body, o.classes.unselectable );\n\t\t\t\t\tregEvent( _docElm, 'off', 'mousemove', drag );\n\t\t\t\t\tregEvent( shared.mirror, 'off', 'wheel', scrollContainer );\n\t\t\t\t\tif ( getParent( shared.mirror ) ) {\n\t\t\t\t\t\tshared.mirror.parentNode.removeChild( shared.mirror );\n\t\t\t\t\t}\n\t\t\t\t\tshared.mirror = null;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Other fns: -------------------------------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction depSanitize( containersModel ) {\n\t\t\t\tconsole.warn( 'Deprecated method drake.sanitizeContainersModel! Will be removed in next major release! Please use sanitizeContainers instead.' );\n\t\t\t\tsanitizeContainers( containersModel, true, o.scope );\n\t\t\t}\n\n\t\t} // end of service\n\n\t\t/****************************************************************************************************************************/\n\t\t/****************************************************************************************************************************/\n\t\t/****************************************************************************************************************************/\n\n\t\t// HELPERS FUNCTIONS:\n\n\t\tfunction sanitizeContainers( containers, to2d, scope ) {\n\n\t\t\tif ( _isFunction( containers ) ) {\n\n\t\t\t\treturn containers;\n\t\t\t}\n\t\t\telse if ( _isArray( containers ) ) {\n\n\t\t\t\tif ( to2d ) {\n\t\t\t\t\t// |-------- is 2D array? -----------|\n\t\t\t\t\treturn _isArray( containers[ 0 ] ) ? containers : [ containers ];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn containers;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( typeof containers === 'string' && scope ) {\n\n\t\t\t\tvar evaluated = scope.$eval( containers );\n\n\t\t\t\tif ( _isFunction( evaluated ) ) {\n\t\t\t\t\treturn evaluated;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\treturn scope.$eval( containers );\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( containers ) {\n\n\t\t\t\treturn makeArray( containers );\n\t\t\t}\n\n\t\t\treturn [];\n\t\t}\n\n\t\tfunction regEvent( el, op, type, fn ) {\n\t\t\tvar touch = {\n\t\t\t\t\tmouseup: 'touchend',\n\t\t\t\t\tmousedown: 'touchstart',\n\t\t\t\t\tmousemove: 'touchmove'\n\t\t\t\t},\n\t\t\t\tpointers = {\n\t\t\t\t\tmouseup: 'pointerup',\n\t\t\t\t\tmousedown: 'pointerdown',\n\t\t\t\t\tmousemove: 'pointermove'\n\t\t\t\t},\n\t\t\t\tmicrosoft = {\n\t\t\t\t\tmouseup: 'MSPointerUp',\n\t\t\t\t\tmousedown: 'MSPointerDown',\n\t\t\t\t\tmousemove: 'MSPointerMove'\n\t\t\t\t},\n\t\t\t\t$el = angular.element( el );\n\n\t\t\tif ( el.addEventListener ) {\n\n\t\t\t\tvar opConvert = { on: 'addEventListener', off: 'removeEventListener' };\n\t\t\t\tel[ opConvert[ op ] ]( type, fn, { passive: false } );\n\t\t\t\tel[ opConvert[ op ] ]( touch[ type ], fn, { passive: false } );\n\n\t\t\t} else {\n\n\t\t\t\tif ( typeof navigator !== 'undefined' && navigator.pointerEnabled && pointers[ type ] ) {\n\t\t\t\t\t$el[ op ]( pointers[ type ], fn );\n\t\t\t\t} else if ( typeof navigator !== 'undefined' && navigator.msPointerEnabled && microsoft[ type ] ) {\n\t\t\t\t\t$el[ op ]( microsoft[ type ], fn );\n\t\t\t\t} else if ( touch[ type ] ) {\n\t\t\t\t\t$el[ op ]( touch[ type ], fn );\n\t\t\t\t}\n\t\t\t\t$el[ op ]( type, fn );\n\n\t\t\t}\n\t\t}\n\n\t\tfunction never() {\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction always() {\n\t\t\treturn true;\n\t\t}\n\n\t\t// make array from array-like objects or from single element (based on bevacqua/atoa)\n\t\tfunction makeArray( all, startIndex ) {\n\t\t\tif ( _isArray( all ) ) {\n\t\t\t\treturn all;\n\t\t\t}\n\t\t\tif ( all.length ) { // is array-like\n\t\t\t\treturn Array.prototype.slice.call( all, startIndex ); // convert to vanilla js array\n\t\t\t} else { // is one element\n\t\t\t\treturn [ all ];\n\t\t\t}\n\t\t}\n\n\t\tfunction whichMouseButton( e ) {\n\t\t\tif ( e.touches ) {\n\t\t\t\treturn e.touches.length;\n\t\t\t}\n\t\t\tif ( e.originalEvent && e.originalEvent.touches ) {\n\t\t\t\treturn e.originalEvent.touches.length;\n\t\t\t}\n\t\t\tif ( e.which !== void 0 && e.which !== 0 ) {\n\t\t\t\treturn e.which;\n\t\t\t} // github.com/bevacqua/dragula/issues/261\n\t\t\tif ( e.buttons !== undefined ) {\n\t\t\t\treturn e.buttons;\n\t\t\t}\n\t\t\tvar button = e.button;\n\t\t\tif ( button !== undefined ) { // see github.com/jquery/jquery/blob/99e8ff1baa7ae341e94bb89c3e84570c7c3ad9ea/src/event.js#L573-L575\n\t\t\t\treturn button & 1 ? 1 : button & 2 ? 3 : (button & 4 ? 2 : 0);\n\t\t\t}\n\t\t}\n\n\t\tfunction preventGrabbed( e ) {\n\t\t\tif ( e.originalEvent ) {\n\t\t\t\te = e.originalEvent; // jQuery enviroment\n\t\t\t}\n\t\t\tif ( shared.grabbed ) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tfunction getScroll( scrollProp, offsetProp ) {\n\t\t\tif ( typeof window[ offsetProp ] !== 'undefined' ) {\n\t\t\t\treturn window[ offsetProp ];\n\t\t\t}\n\t\t\tif ( _docElm.clientHeight ) {\n\t\t\t\treturn _docElm[ scrollProp ];\n\t\t\t}\n\t\t\treturn _doc.body[ scrollProp ];\n\t\t}\n\n\t\tfunction getOffset( el ) { // watch performance!! - function is running each mousemove!\n\t\t\tvar rect = el.getBoundingClientRect(),\n\t\t\t\tscrollTop = getScroll( 'scrollTop', 'pageYOffset' ),\n\t\t\t\tscrollLeft = getScroll( 'scrollLeft', 'pageXOffset' );\n\t\t\treturn {\n\t\t\t\tleft: rect.left + scrollLeft,\n\t\t\t\tright: rect.right + scrollLeft,\n\t\t\t\ttop: rect.top + scrollTop,\n\t\t\t\tbottom: rect.bottom + scrollTop\n\t\t\t};\n\t\t}\n\n\t\tfunction getRectWidth( rect ) {\n\t\t\treturn rect.width || (rect.right - rect.left);\n\t\t}\n\n\t\tfunction getRectHeight( rect ) {\n\t\t\treturn rect.height || (rect.bottom - rect.top);\n\t\t}\n\n\t\tfunction getEmptyArray() {\n\t\t\treturn [];\n\t\t}\n\n\t\tfunction nextEl( el ) {\n\t\t\tif ( !el ) { // https://github.com/luckylooke/dragular/issues/102\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn el.nextElementSibling || manually();\n\n\t\t\tfunction manually() {\n\t\t\t\tvar sibling = el;\n\t\t\t\tdo {\n\t\t\t\t\tsibling = sibling.nextSibling;\n\t\t\t\t} while ( sibling && sibling.nodeType !== 1 );\n\t\t\t\treturn sibling;\n\t\t\t}\n\t\t}\n\n\t\t//Cannot use angular.isElement because we need to check plain dom element, no jQlite wrapped\n\t\tfunction isElement( obj ) {\n\t\t\treturn (\n\t\t\t\ttypeof HTMLElement === 'object' ? obj instanceof HTMLElement : //DOM2\n\t\t\t\t\tobj && typeof obj === 'object' && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === 'string'\n\t\t\t);\n\t\t}\n\n\t\tfunction lookupClass( className ) {\n\t\t\tvar cached = shared.classesCache[ className ];\n\t\t\tif ( cached ) {\n\t\t\t\tcached.lastIndex = 0;\n\t\t\t} else {\n\t\t\t\tshared.classesCache[ className ] = cached = new RegExp( '(?:^|\\\\s)' + className + '(?:\\\\s|$)', 'g' );\n\t\t\t}\n\t\t\treturn cached;\n\t\t}\n\n\t\tfunction addClass( el, className ) {\n\t\t\tvar current = el.className;\n\t\t\tif ( !current.length ) {\n\t\t\t\tel.className = className;\n\t\t\t} else if ( !lookupClass( className ).test( current ) ) {\n\t\t\t\tel.className += ' ' + className;\n\t\t\t}\n\t\t}\n\n\t\tfunction rmClass( el, className ) {\n\t\t\tel.className = el.className.replace( lookupClass( className ), ' ' ).trim();\n\t\t}\n\n\t\tfunction getEventHost( e ) {\n\t\t\t// on touchend event, we have to use `e.changedTouches`\n\t\t\t// see http://stackoverflow.com/questions/7192563/touchend-event-properties\n\t\t\t// see https://github.com/bevacqua/dragula/issues/34\n\t\t\tif ( e.targetTouches && e.targetTouches.length ) {\n\t\t\t\treturn e.targetTouches[ 0 ];\n\t\t\t}\n\t\t\tif ( e.changedTouches && e.changedTouches.length ) {\n\t\t\t\treturn e.changedTouches[ 0 ];\n\t\t\t}\n\t\t\treturn e;\n\t\t}\n\n\t\tfunction getCoord( coord, e ) { // watch performance - running each move several times!\n\t\t\tvar host = getEventHost( e );\n\t\t\tvar missMap = {\n\t\t\t\tpageX: 'clientX', // IE8\n\t\t\t\tpageY: 'clientY' // IE8\n\t\t\t};\n\t\t\tif ( coord in missMap && !(coord in host) && missMap[ coord ] in host ) {\n\t\t\t\tcoord = missMap[ coord ];\n\t\t\t}\n\n\t\t\t// Adding support for touch events, as they are not functional in the original\n\t\t\tif ( !host.type || host.type.indexOf( 'touch' ) < 0 ) {\n\t\t\t\treturn host[ coord ];\n\t\t\t} else {\n\t\t\t\tif ( host.type.indexOf( 'end' ) === -1 ) {\n\t\t\t\t\t// No clientX or clientY in a touch event\n\t\t\t\t\treturn host.originalEvent.touches[ 0 ][ coord.replace( 'client', 'page' ) ];\n\t\t\t\t}\n\t\t\t\t// Nothing should happen for touchend\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfunction getParent( el ) { // watch performance!! - function is running each mousemove!\n\t\t\treturn el.parentNode === document ? null : el.parentNode;\n\t\t}\n\n\t\tfunction isInput( el ) {\n\t\t\treturn el.tagName === 'INPUT' || el.tagName === 'TEXTAREA' || el.tagName === 'SELECT' || isEditable( el );\n\t\t}\n\n\t\tfunction isEditable( el ) {\n\t\t\tif ( !el ) {\n\t\t\t\treturn false;\n\t\t\t} // no parents were editable\n\t\t\tif ( el.contentEditable === 'false' ) {\n\t\t\t\treturn false;\n\t\t\t} // stop the lookup\n\t\t\tif ( el.contentEditable === 'true' ) {\n\t\t\t\treturn true;\n\t\t\t} // found a contentEditable element in the chain\n\t\t\treturn isEditable( getParent( el ) ); // contentEditable is set to 'inherit'\n\t\t}\n\n\t\tfunction domIndexOf( child, parent ) {\n\t\t\treturn Array.prototype.indexOf.call( angular.element( parent ).children(), child );\n\t\t}\n\n\t\tfunction fireEvent( target, e, extra ) { // watch performance!! - function is running each mousemove!\n\t\t\tif ( !target ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tshared.extra = extra;\n\t\t\tif ( target.dispatchEvent ) {\n\t\t\t\ttarget.dispatchEvent( e );\n\t\t\t} else {\n\t\t\t\ttarget.fireEvent( 'on' + e.eventType, e );\n\t\t\t}\n\t\t}\n\n\t\tfunction getBool( prop, args, context ) {\n\t\t\tif ( _isFunction( prop ) ) {\n\t\t\t\treturn !!prop.apply( context || this, args || shared );\n\t\t\t} else {\n\t\t\t\treturn !!prop;\n\t\t\t}\n\t\t}\n\n\t};\n\n\tdragularService.$inject = [ '$rootScope', '$compile' ];\n\n\tmodule.exports = dragularService;\n\n\n/***/ })\n/******/ ])\n});\n;"]} \ No newline at end of file +{"version":3,"sources":["dragular.js"],"names":["root","factory","exports","module","define","amd","a","i","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","dragularDirective","dragularService","angular","directive","dragular","restrict","link","$scope","iElm","iAttrs","tryJson","json","JSON","parse","e","options","$eval","dragularModel","containersModel","scope","dragularNameSpace","nameSpace","split","dragularOnInit","onInit","$inject","shared","classesCache","containersCtx","containers","mirror","source","item","copy","sourceItem","sourceModel","sourceFilteredModel","target","targetCtx","targetModel","lastDropTarget","offsetX","offsetY","moveX","moveY","offsetXr","offsetYb","clientX","clientY","mirrorWidth","mirrorHeight","initialSibling","currentSibling","initialIndex","currentIndex","tempModel","dragOverEvents","lastElementBehindCursor","grabbed","$rootScope","$compile","service","arg0","arg1","processServiceArguments","arguments","length","_isArray","isElement","initialContainers","document","querySelectorAll","o","copyOptions","extendOptions","tmp","extend","defaultOptions","classes","defaultClasses","eventNames","defaultEventNames","processOptionsObject","boundingBox","sanitizeContainers","containersFilteredModel","forEach","cont","len","getContainers","Error","indexOf","push","getContainersModel","fm","registerEvents","remove","op","regEvent","_docElm","release","container","grab","name","eventName","_doc","createEvent","initEvent","createEventObject","eventType","whichMouseButton","metaKey","ctrlKey","context","canStart","eventualMovements","type","isInput","focus","preventDefault","startBecauseMouseMoved","drake","dragging","originalEvent","g","ignoreInputTextSelection","getCoord","elementBehindCursor","elementFromPoint","movements","end","start","direction","getParent","parent","parentNode","parentHeight","offsetHeight","parentWidth","offsetWidth","childHeight","clientHeight","childWidth","clientWidth","offset","getOffset","left","top","right","bottom","renderMirrorImage","addClass","transit","style","drag","preventGrabbed","handle","isContainer","invalid","moves","nextEl","element","clone","$emit","dragularcloned","containerIndex","domIndexOf","dragulardrag","manualStart","rect","getBoundingClientRect","cloneNode","width","height","getRectWidth","getRectHeight","mirrorContainer","appendChild","body","unselectable","scrollContainer","drop","ungrab","moved","notify","removeOnSpill","spillOver","spillOut","pageX","pageY","offsetBox","x","y","lockY","lockX","getElementBehindPoint","dropTarget","findDropTarget","changed","fireEvent","dragularenter","dragularleave","copySortSource","removeChild","reference","immediate","getImmediateChild","getReference","revertOnSpill","insertBefore","dragularshadow","accepted","initial","isInitialPlacement","getTargetCtx","_isFunction","accepts","isContainerAccepts","canBeAccepted","rmClass","hide","s","sibling","undefined","outside","el","children","horizontal","inside","resolve","after","point","state","className","isContainerModel","opt","_getContainers","containersType","to2d","cancel","revert","reverts","dragularcancel","cleanup","dragularrelease","afterDrop","dragulardrop","dropIndex","compileItemOnDrop","$applyAsync","content","splice","dropElmModel","dontCopyModel","dragularremove","removeMirrorImage","dragularout","dragulardragend","destroy","removeContainers","makeArray","index","addContainers","before","scrollTop","deltaY","stopPropagation","depSanitize","getBool","dragularover","never","getEmptyArray","always","sanitizeContainersModel","evaluated","fn","touch","mouseup","mousedown","mousemove","pointers","microsoft","$el","addEventListener","opConvert","on","off","passive","navigator","pointerEnabled","msPointerEnabled","all","startIndex","Array","prototype","slice","touches","which","buttons","button","getScroll","scrollProp","offsetProp","window","scrollLeft","manually","nextSibling","nodeType","nextElementSibling","obj","HTMLElement","nodeName","lookupClass","cached","lastIndex","RegExp","current","test","replace","trim","getEventHost","targetTouches","changedTouches","coord","host","missMap","tagName","isEditable","contentEditable","child","extra","dispatchEvent","prop","args","apply","documentElement","isArray","isFunction","cleanEnviroment"],"mappings":"CAAA,SAA2CA,EAAMC,GAChD,GAAsB,gBAAZC,UAA0C,gBAAXC,QACxCA,OAAOD,QAAUD,QACb,IAAqB,kBAAXG,SAAyBA,OAAOC,IAC9CD,UAAWH,OACP,CACJ,GAAIK,GAAIL,GACR,KAAI,GAAIM,KAAKD,IAAuB,gBAAZJ,SAAuBA,QAAUF,GAAMO,GAAKD,EAAEC,KAErEC,KAAM,WACT,MAAgB,UAAUC,GAKhB,QAASC,GAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,MAAOC,GAAiBD,GAAUT,OAGnC,IAAIC,GAASS,EAAiBD,IAC7BT,WACAW,GAAIF,EACJG,QAAQ,EAUT,OANAL,GAAQE,GAAUI,KAAKZ,EAAOD,QAASC,EAAQA,EAAOD,QAASQ,GAG/DP,EAAOW,QAAS,EAGTX,EAAOD,QAvBf,GAAIU,KAqCJ,OATAF,GAAoBM,EAAIP,EAGxBC,EAAoBO,EAAIL,EAGxBF,EAAoBQ,EAAI,GAGjBR,EAAoB,KAK/B,SAAUP,EAAQD,EAASQ,GAGhC,YACA,IAAIS,GAAoBT,EAAqB,GACzCU,EAAkBV,EAAqB,EAM3CP,GAAOD,QAAU,iBAEjBmB,QACElB,OAAQ,qBACRF,QAAS,kBAAmBmB,GAC5BE,UAAW,WAAYH,IAKpB,SAAUhB,EAAQD,GAEvB,YAOA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AOnM,GAC3B,MAAO+J,OAAMC,UAAU3M,QAAQ/F,KAAMM,QAAQ+J,QAAS3B,GAAS4F,WAAYuG,GAG5E,QAASlI,GAAWlK,EAAQvB,EAAG4T,GACxBrS,IAGNX,EAAOgT,MAAQA,EACVrS,EAAOsS,cACXtS,EAAOsS,cAAe7T,GAEtBuB,EAAOkK,UAAW,KAAOzL,EAAE+F,UAAW/F,IAIxC,QAAS8P,GAASgE,EAAMC,EAAM5N,GAC7B,MAAKsG,GAAaqH,KACRA,EAAKE,MAAO7N,GAAW5H,KAAMwV,GAAQnT,KAErCkT,EAh3CX,GAAInO,GAAOnC,SACV6B,EAAUM,EAAKsO,gBACf5Q,EAAWkO,MAAM2C,QACjBzH,EAAcrN,QAAQ+U,UAYvB,OATApR,GAAQqR,gBAAkB,WACzBxT,EAAOC,gBACPD,EAAOE,iBACPF,EAAOG,cACPH,EAAOI,OAASiM,QAGjBlK,EAAQnC,OAASA,EAEVmC,EAu2CR5D,GAAgBwB,SAAY,aAAc,YAE1CzC,EAAOD,QAAUkB","file":"dragular.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n\n\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* global angular */\n\t'use strict';\n\tvar dragularDirective = __webpack_require__( 1 );\n\tvar dragularService = __webpack_require__( 2 );\n\n\t/**\n\t * Dragular 4.5.0 by Luckylooke https://github.com/luckylooke/dragular\n\t * Angular version of dragula https://github.com/bevacqua/dragula\n\t */\n\tmodule.exports = 'dragularModule';\n\n\tangular\n\t\t.module( 'dragularModule', [] )\n\t\t.factory( 'dragularService', dragularService )\n\t\t.directive( 'dragular', dragularDirective );\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\t/**\n\t * dragular Directive by Luckylooke https://github.com/luckylooke/dragular\n\t * Angular version of dragula https://github.com/bevacqua/dragula\n\t */\n\n\tvar dragular = function ( dragularService ) {\n\t\treturn {\n\t\t\trestrict: 'A',\n\t\t\tlink: function ( $scope, iElm, iAttrs ) {\n\n\t\t\t\tvar options = $scope.$eval( iAttrs.dragular ) || tryJson( iAttrs.dragular ) || {};\n\n\t\t\t\tfunction tryJson( json ) {\n\t\t\t\t\ttry { // I dont like try catch solutions but I havent find sattisfying way of chcecking json validity.\n\t\t\t\t\t\treturn JSON.parse( json );\n\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( iAttrs.dragularModel ) {\n\t\t\t\t\toptions.containersModel = iAttrs.dragularModel;\n\t\t\t\t\tif ( !options.scope ){\n\t\t\t\t\t\toptions.scope = $scope;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( iAttrs.dragularNameSpace ) {\n\t\t\t\t\toptions.nameSpace = iAttrs.dragularNameSpace.split( ' ' );\n\t\t\t\t}\n\n\t\t\t\tif ( iAttrs.dragularOnInit ) {\n\t\t\t\t\toptions.onInit = $scope.$eval( iAttrs.dragularOnInit );\n\t\t\t\t}\n\n\t\t\t\tdragularService( iElm[ 0 ], options );\n\t\t\t}\n\t\t};\n\t};\n\n\tdragular.$inject = [ 'dragularService' ];\n\n\tmodule.exports = dragular;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n\t/* global angular */\n\t'use strict';\n\n\t/**\n\t * dragular Service by Luckylooke https://github.com/luckylooke/dragular\n\t * Angular version of dragula https://github.com/bevacqua/dragula\n\t */\n\n\tvar shared = { // sahred object between all service instances\n\t\tclassesCache: {}, // classes lookup cache\n\t\tcontainersCtx: {}, // containers model\n\t\tcontainers: {}, // containers\n\t\tmirror: null, // mirror image\n\t\tsource: null, // source container\n\t\titem: null, // item being dragged\n\t\tcopy: null, // copy flag\n\t\tsourceItem: null, // item originaly dragged if copy is enabled\n\t\tsourceModel: null, // source container model\n\t\tsourceFilteredModel: null, // source container filtered model if relevant\n\t\ttarget: null, // droppable container under drag item\n\t\ttargetCtx: null, // target container context\n\t\ttargetModel: null, // target container model\n\t\tlastDropTarget: null, // last container item was over\n\t\toffsetX: null, // reference x\n\t\toffsetY: null, // reference y\n\t\tmoveX: null, // reference move x\n\t\tmoveY: null, // reference move y\n\t\toffsetXr: null, // reference x right for boundingBox feature\n\t\toffsetYb: null, // reference y bottom for boundingBox feature\n\t\tclientX: null, // cache client x, init at grab, update at drag\n\t\tclientY: null, // cache client y, init at grab, update at drag\n\t\tmirrorWidth: null, // mirror width for boundingBox feature\n\t\tmirrorHeight: null, // mirror height for boundingBox feature\n\t\tinitialSibling: null, // reference sibling when grabbed\n\t\tcurrentSibling: null, // reference sibling now\n\t\tinitialIndex: null, // reference model index when grabbed\n\t\tcurrentIndex: null, // reference model index now\n\t\ttempModel: null, // if o.isContainer is used, model can be provided as well, it is temporary saved here during drags\n\t\tdragOverEvents: {}, // drag over events fired on element behind cursor\n\t\tlastElementBehindCursor: null, // last element behind cursor\n\t\tgrabbed: null // holds mousedown context until first mousemove\n\t};\n\n\tvar dragularService = function ( $rootScope, $compile ) {\n\n\t\t// abbreviations\n\t\tvar _doc = document,\n\t\t\t_docElm = _doc.documentElement,\n\t\t\t_isArray = Array.isArray,\n\t\t\t_isFunction = angular.isFunction;\n\n\t\t// clean common/shared objects\n\t\tservice.cleanEnviroment = function cleanEnviroment() {\n\t\t\tshared.classesCache = {};\n\t\t\tshared.containersCtx = {};\n\t\t\tshared.containers = {};\n\t\t\tshared.mirror = undefined;\n\t\t};\n\n\t\tservice.shared = shared;\n\n\t\treturn service;\n\n\t\t// service definition\n\t\tfunction service( arg0, arg1 ) {\n\n\t\t\t// console.log('dragularService arg0, arg1', arg0, arg1);\n\n\t\t\tvar initialContainers = arg0 || [],\n\t\t\t\toptions = arg1 || {},\n\t\t\t\to, // shorthand for options\n\t\t\t\tg = getBool, // shorthand for getBool\n\n\t\t\t\t// defaults\n\t\t\t\tdefaultClasses = {\n\t\t\t\t\tmirror: 'gu-mirror',\n\t\t\t\t\thide: 'gu-hide',\n\t\t\t\t\tunselectable: 'gu-unselectable',\n\t\t\t\t\ttransit: 'gu-transit'\n\t\t\t\t},\n\t\t\t\tdefaultEventNames = {\n\t\t\t\t\t// drag-over DOM events\n\t\t\t\t\tdragularenter: 'dragularenter',\n\t\t\t\t\tdragularleave: 'dragularleave',\n\t\t\t\t\tdragularrelease: 'dragularrelease',\n\t\t\t\t\t// $scope events\n\t\t\t\t\tdragularcloned: 'dragularcloned',\n\t\t\t\t\tdragulardrag: 'dragulardrag',\n\t\t\t\t\tdragularcancel: 'dragularcancel',\n\t\t\t\t\tdragulardrop: 'dragulardrop',\n\t\t\t\t\tdragularremove: 'dragularremove',\n\t\t\t\t\tdragulardragend: 'dragulardragend',\n\t\t\t\t\tdragularshadow: 'dragularshadow',\n\t\t\t\t\tdragularover: 'dragularover',\n\t\t\t\t\tdragularout: 'dragularout'\n\t\t\t\t},\n\t\t\t\tdefaultOptions = { // options with defaults\n\t\t\t\t\tcopyOptions: false, // copy options object when provided\n\t\t\t\t\tclasses: defaultClasses, // classes used by dragular\n\t\t\t\t\teventNames: defaultEventNames, // event names used by dragular\n\t\t\t\t\tcontainers: false, // initial containers provided via options object (are provided via parameter by default)\n\t\t\t\t\tcontainersModel: false, // if provided, model will be synced with DOM\n\t\t\t\t\tcontainersFilteredModel: false, // if provided, dragular will handle filtered model cases\n\t\t\t\t\tisContainer: never, // potential target can be forced to be container by custom logic\n\t\t\t\t\tisContainerModel: getEmptyArray, // if isContainer function is provided, you can provide also respective model\n\t\t\t\t\tisContainerAccepts: always, // if isContainer function is provided, you can provide also respective accept function\n\t\t\t\t\tmoves: always, // can drag start?\n\t\t\t\t\taccepts: always, // can target accept dragged item? (target context used)\n\t\t\t\t\tcanBeAccepted: always, // can be dragged item accepted by target? (source context used)\n\t\t\t\t\tcopy: false, // dragged item will be copy of source? flag or function\n\t\t\t\t\tcopySortSource: false, // enable sorting in source when copying item\n\t\t\t\t\tdontCopyModel: false, // dont make copy of model when coping item (#61)\n\t\t\t\t\tinvalid: never, // target (in)validity function\n\t\t\t\t\trevertOnSpill: false, // item returns to original place\n\t\t\t\t\tremoveOnSpill: false, // item will be removed if not placed into valid target\n\t\t\t\t\tlockX: false, // lock movement into x-axis\n\t\t\t\t\tlockY: false, // lock movement into y-axis\n\t\t\t\t\tboundingBox: false, // lock movement inside this element boundaries\n\t\t\t\t\tmirrorContainer: _doc.body, // element for appending mirror\n\t\t\t\t\tignoreInputTextSelection: true, // text selection in inputs wont be considered as drag\n\t\t\t\t\tcompileItemOnDrop: false,\n\t\t\t\t\tonInit: false // function callback called after dragular initialisation and providing drake as first argument\n\t\t\t\t},\n\n\t\t\t\tdrake = {\n\t\t\t\t\tcontainers: shared.containers, // all containers\n\t\t\t\t\tcontainersCtx: shared.containersCtx, // all contexts to containers\n\t\t\t\t\tsanitizeContainersModel: depSanitize,\n\t\t\t\t\tsanitizeContainers: sanitizeContainers,\n\t\t\t\t\taddContainers: addContainers,\n\t\t\t\t\tremoveContainers: removeContainers,\n\t\t\t\t\tisContainer: isContainer,\n\t\t\t\t\tstart: manualStart,\n\t\t\t\t\tend: end,\n\t\t\t\t\tcancel: cancel,\n\t\t\t\t\tremove: remove,\n\t\t\t\t\tdestroy: destroy,\n\t\t\t\t\tdragging: false\n\t\t\t\t};\n\n\t\t\tprocessServiceArguments(); // both arguments (containers and options) are optional, this function handle this\n\t\t\textendOptions();\n\t\t\tprocessOptionsObject();\n\t\t\tregisterEvents();\n\n\t\t\tif ( o.onInit ) {\n\t\t\t\to.onInit( drake, o );\n\t\t\t}\n\t\t\treturn drake;\n\n\n\t\t\t// Function definitions: ==============================================================================================================\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Dragular service init functions: ---------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction processServiceArguments() {\n\n\t\t\t\tif ( arguments.length === 1 && // if there is only one argument we need to distinguish if it is options object or container(s) reference\n\n\t\t\t\t\t!_isArray( arg0 ) && // array of containers elements\n\t\t\t\t\t!angular.isElement( arg0 ) && // one container element\n\t\t\t\t\t!arg0[ 0 ] && // array-like object with containers elements\n\t\t\t\t\ttypeof arg0 !== 'string' ) { // selector\n\t\t\t\t\t// then arg0 is options object\n\t\t\t\t\toptions = arg0 || {};\n\t\t\t\t\tinitialContainers = []; // containers are not provided on init\n\t\t\t\t}\n\t\t\t\telse if ( typeof arg0 === 'string' ) {\n\n\t\t\t\t\tinitialContainers = document.querySelectorAll( arg0 );\n\t\t\t\t}\n\n\t\t\t\to = options.copyOptions ? angular.copy( options ) : options;\n\t\t\t}\n\n\t\t\tfunction extendOptions() {\n\n\t\t\t\tvar tmp = angular.extend( {}, defaultOptions, o ); // tmp for keeping defaults untouched\n\t\t\t\tangular.extend( o, tmp ); // merge defaults back into options\n\n\t\t\t\tif ( o.classes ) {\n\n\t\t\t\t\ttmp = angular.extend( {}, defaultClasses, o.classes );\n\t\t\t\t\tangular.extend( o.classes, tmp );\n\t\t\t\t}\n\n\t\t\t\tif ( o.eventNames ) {\n\n\t\t\t\t\ttmp = angular.extend( {}, defaultEventNames, o.eventNames );\n\t\t\t\t\tangular.extend( o.eventNames, tmp );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction processOptionsObject() {\n\n\t\t\t\t// bounding box must be pure DOM element, not jQuery wrapper or something else..\n\t\t\t\tif ( !isElement( o.boundingBox ) ) {\n\t\t\t\t\to.boundingBox = false;\n\t\t\t\t}\n\n\t\t\t\t// initial containers provided via options are higher priority then by parameter\n\t\t\t\tif ( o.containers ) {\n\t\t\t\t\tinitialContainers = o.containers;\n\t\t\t\t}\n\n\t\t\t\t// sanitize initialContainers\n\t\t\t\to.containers = sanitizeContainers( initialContainers, false, o.scope );\n\n\t\t\t\t// sanitize o.containersModel\n\t\t\t\to.containersModel = sanitizeContainers( o.containersModel, true, o.scope );\n\n\t\t\t\t// sanitize o.containersFilteredModel\n\t\t\t\tif ( _isArray( o.containersFilteredModel ) ) {\n\t\t\t\t\t// |-------- is 2D array? -----------|\n\t\t\t\t\to.containersFilteredModel = _isArray( o.containersFilteredModel[ 0 ] ) ? o.containersFilteredModel : [ o.containersFilteredModel ];\n\t\t\t\t} else {\n\t\t\t\t\to.containersFilteredModel = [];\n\t\t\t\t}\n\n\t\t\t\t// feed containers groups and optionaly do same for models\n\t\t\t\tif ( !o.nameSpace ) {\n\t\t\t\t\to.nameSpace = [ 'dragularCommon' ];\n\t\t\t\t}\n\n\t\t\t\tif ( !_isArray( o.nameSpace ) ) {\n\t\t\t\t\to.nameSpace = [ o.nameSpace ];\n\t\t\t\t}\n\n\t\t\t\to.nameSpace.forEach( function eachNameSpace( nameSpace ) {\n\n\t\t\t\t\tif ( !shared.containers[ nameSpace ] ) {\n\n\t\t\t\t\t\tshared.containers[ nameSpace ] = [];\n\t\t\t\t\t\tshared.containersCtx[ nameSpace ] = [];\n\t\t\t\t\t}\n\n\t\t\t\t\tvar len = getContainers( o ).length,\n\t\t\t\t\t\tcont;\n\n\t\t\t\t\tfor ( var i = 0; i < len; i++ ) {\n\n\t\t\t\t\t\tcont = getContainers( o )[ i ];\n\n\t\t\t\t\t\tif (!cont) {\n\t\t\t\t\t\t\tthrow new Error( 'Container element must be defined!' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (shared.containers[ nameSpace ].indexOf(cont) !== -1) {\n\t\t\t\t\t\t\tthrow new Error( 'Cannot register container element more than once! Container element: ' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tshared.containers[ nameSpace ].push(cont);\n\t\t\t\t\t\tshared.containersCtx[ nameSpace ].push({\n\t\t\t\t\t\t\to: o,\n\t\t\t\t\t\t\tm: getContainersModel( o )[ i ], // can be undefined\n\t\t\t\t\t\t\tfm: o.containersFilteredModel[ i ] // can be undefined\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tfunction registerEvents( remove ) {\n\t\t\t\tvar op = remove ? 'off' : 'on';\n\t\t\t\tregEvent( _docElm, op, 'mouseup', release );\n\n\t\t\t\tgetContainers( o ).forEach( function addMouseDown( container ) {\n\t\t\t\t\tregEvent( container, 'on', 'mousedown', grab );\n\t\t\t\t} );\n\n\t\t\t\tif ( !remove ) { // create dragular DOM events\n\t\t\t\t\tangular.forEach( [ 'dragularenter', 'dragularleave', 'dragularrelease' ], function prepareDragOverEvents( name ) {\n\t\t\t\t\t\tvar eventName = o.eventNames[ name ];\n\t\t\t\t\t\tif ( !shared.dragOverEvents[ eventName ] ) {\n\t\t\t\t\t\t\tif ( _doc.createEvent ) {\n\t\t\t\t\t\t\t\tshared.dragOverEvents[ eventName ] = _doc.createEvent( 'HTMLEvents' );\n\t\t\t\t\t\t\t\tshared.dragOverEvents[ eventName ].initEvent( eventName, true, true );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tshared.dragOverEvents[ eventName ] = _doc.createEventObject();\n\t\t\t\t\t\t\t\tshared.dragOverEvents[ eventName ].eventType = eventName;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Grab stage: ------------------------------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction grab( e ) {\n\n\t\t\t\t// filter some odd situations\n\t\t\t\tif ( whichMouseButton( e ) !== 1 || e.metaKey || e.ctrlKey ) {\n\t\t\t\t\treturn; // we only care about honest-to-god left clicks and touch events\n\t\t\t\t}\n\n\t\t\t\t// set itial values\n\t\t\t\tshared.moveX = e.clientX;\n\t\t\t\tshared.moveY = e.clientY;\n\n\t\t\t\tvar context = canStart( e.target );\n\t\t\t\tif ( !context || !context.item ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tshared.grabbed = context;\n\t\t\t\teventualMovements();\n\t\t\t\tif ( e.type === 'mousedown' ) {\n\t\t\t\t\tif ( isInput( e.target ) ) { // see also: https://github.com/bevacqua/dragula/issues/208\n\t\t\t\t\t\te.target.focus(); // fixes https://github.com/bevacqua/dragula/issues/176\n\t\t\t\t\t\t// changed from context.item to e.target fixing https://github.com/luckylooke/dragular/issues/87#issuecomment-256865796\n\t\t\t\t\t} else {\n\t\t\t\t\t\te.preventDefault(); // fixes https://github.com/bevacqua/dragula/issues/155\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction eventualMovements( remove ) {\n\n\t\t\t\tvar op = remove ? 'off' : 'on';\n\t\t\t\tregEvent( _docElm, op, 'mousemove', startBecauseMouseMoved );\n\t\t\t}\n\n\t\t\tfunction startBecauseMouseMoved( e ) {\n\n\t\t\t\tif ( !shared.grabbed || drake.dragging ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( e.originalEvent ) {\n\t\t\t\t\te = e.originalEvent; // jQuery enviroment\n\t\t\t\t}\n\n\t\t\t\tif ( whichMouseButton( e ) === 0 ) {\n\t\t\t\t\trelease( {} );\n\t\t\t\t\treturn; // when text is selected on an input and then dragged, mouseup doesn't fire. this is our only hope\n\t\t\t\t}\n\n\t\t\t\t// truthy check fixes dragula-#239, equality fixes dragula-#207\n\t\t\t\tif ( e.clientX && e.clientX === shared.moveX && e.clientY && e.clientY === shared.moveY ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( g( o.ignoreInputTextSelection ) ) {\n\n\t\t\t\t\tvar clientX = getCoord( 'clientX', e ),\n\t\t\t\t\t\tclientY = getCoord( 'clientY', e ),\n\t\t\t\t\t\telementBehindCursor = _doc.elementFromPoint( clientX, clientY );\n\t\t\t\t\tif ( isInput( elementBehindCursor ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar grabbed = shared.grabbed; // calling end() unsets shared.grabbed\n\t\t\t\teventualMovements( 'remove' ); // remove mousemove listener\n\t\t\t\tmovements();\n\t\t\t\tend();\n\t\t\t\tstart( grabbed );\n\n\t\t\t\tif ( !shared.item ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// automaticly detect direction of elements if not set in options\n\t\t\t\tif ( !o.direction && getParent( shared.sourceItem ) ) {\n\t\t\t\t\tvar parent = shared.sourceItem.parentNode,\n\t\t\t\t\t\tparentHeight = parent.offsetHeight,\n\t\t\t\t\t\tparentWidth = parent.offsetWidth,\n\t\t\t\t\t\tchildHeight = shared.sourceItem.clientHeight,\n\t\t\t\t\t\tchildWidth = shared.sourceItem.clientWidth;\n\t\t\t\t\to.direction = parentHeight / childHeight < parentWidth / childWidth ? 'horizontal' : 'vertical';\n\t\t\t\t}\n\n\t\t\t\t// get initial coordinates, used to render shared.mirror for first time\n\t\t\t\tvar offset = getOffset( shared.sourceItem );\n\t\t\t\tshared.offsetX = getCoord( 'pageX', e ) - offset.left;\n\t\t\t\tshared.offsetY = getCoord( 'pageY', e ) - offset.top;\n\t\t\t\tshared.clientX = getCoord( 'clientX', e );\n\t\t\t\tshared.clientY = getCoord( 'clientY', e );\n\n\t\t\t\t// limiting area of shared.mirror movement, get initial coordinates\n\t\t\t\tif ( o.boundingBox ) {\n\t\t\t\t\tshared.offsetXr = getCoord( 'pageX', e ) - offset.right;\n\t\t\t\t\tshared.offsetYb = getCoord( 'pageY', e ) - offset.bottom;\n\t\t\t\t}\n\n\t\t\t\te.preventDefault();\n\n\t\t\t\trenderMirrorImage();\n\t\t\t\taddClass( shared.item, o.classes.transit );\n\t\t\t\t// initial position\n\t\t\t\tshared.mirror.style.left = shared.clientX - shared.offsetX + 'px';\n\t\t\t\tshared.mirror.style.top = shared.clientY - shared.offsetY + 'px';\n\n\t\t\t\tdrag( e );\n\t\t\t}\n\n\t\t\tfunction movements( remove ) {\n\n\t\t\t\tvar op = remove ? 'off' : 'on';\n\t\t\t\tregEvent( _docElm, op, 'selectstart', preventGrabbed ); // IE8\n\t\t\t\tregEvent( _docElm, op, 'click', preventGrabbed );\n\t\t\t\tregEvent( _docElm, op, 'touchmove', preventGrabbed ); // fixes touch devices scrolling while drag\n\t\t\t}\n\n\t\t\tfunction canStart( item ) {\n\t\t\t\tif ( drake.dragging && shared.mirror ) {\n\t\t\t\t\treturn; // already dragging\n\t\t\t\t}\n\n\t\t\t\tvar handle = item;\n\t\t\t\twhile ( getParent( item ) && !isContainer( getParent( item ) ) ) {\n\t\t\t\t\t// break loop if user tries to drag item which is considered invalid handle\n\t\t\t\t\tif ( o.invalid( item, handle ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\titem = getParent( item ); // drag target should be immediate child of container\n\t\t\t\t\tif ( !item ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar source = getParent( item );\n\t\t\t\tif ( !source ||\n\t\t\t\t\to.invalid( item, handle ) || !o.moves( item, source, handle, nextEl( item ) ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\titem: item,\n\t\t\t\t\tsource: source\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tfunction start( context ) {\n\t\t\t\tshared.sourceItem = shared.item = context.item;\n\t\t\t\tshared.source = context.source;\n\t\t\t\tshared.initialSibling = shared.currentSibling = nextEl( context.item );\n\n\t\t\t\tif ( g( o.copy, [ context.item, context.source ] ) ) {\n\t\t\t\t\t// http://api.jquery.com/clone/#clone-withDataAndEvents-deepWithDataAndEvents\n\t\t\t\t\tshared.item = angular.element( context.item ).clone( o.copy === 'events', o.copy === 'events' )[0];\n\t\t\t\t\tshared.copy = o.copy;\n\t\t\t\t\tif ( o.scope ) {\n\t\t\t\t\t\to.scope.$emit( o.eventNames.dragularcloned, shared.item, context.item );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tshared.copy = false;\n\t\t\t\t}\n\n\t\t\t\t// prepare models operations\n\t\t\t\tvar containerIndex = getContainers( o ).indexOf( context.source );\n\t\t\t\tshared.sourceModel = getContainersModel( o )[ containerIndex ];\n\n\t\t\t\tshared.sourceFilteredModel = o.containersFilteredModel[ containerIndex ];\n\t\t\t\tshared.initialIndex = domIndexOf( context.item, context.source );\n\n\t\t\t\tdrake.dragging = true;\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\to.scope.$emit( o.eventNames.dragulardrag, shared.sourceItem, shared.source );\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tfunction manualStart( item ) {\n\t\t\t\tvar context = canStart( item );\n\t\t\t\tif ( context ) {\n\t\t\t\t\tshared.grabbed = context;\n\t\t\t\t\teventualMovements();\n\t\t\t\t\t//start(context);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction renderMirrorImage() {\n\t\t\t\tif ( shared.mirror ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar rect = shared.sourceItem.getBoundingClientRect();\n\t\t\t\tshared.mirror = shared.sourceItem.cloneNode( true );\n\t\t\t\tshared.mirrorWidth = rect.width;\n\t\t\t\tshared.mirrorHeight = rect.height;\n\t\t\t\tshared.mirror.style.width = getRectWidth( rect ) + 'px';\n\t\t\t\tshared.mirror.style.height = getRectHeight( rect ) + 'px';\n\t\t\t\taddClass( shared.mirror, o.classes.mirror );\n\t\t\t\to.mirrorContainer.appendChild( shared.mirror );\n\t\t\t\tregEvent( _docElm, 'on', 'mousemove', drag );\n\t\t\t\taddClass( _doc.body, o.classes.unselectable );\n\t\t\t\tregEvent( shared.mirror, 'on', 'wheel', scrollContainer );\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\to.scope.$emit( o.eventNames.dragularcloned, shared.mirror, shared.sourceItem );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction end() {\n\t\t\t\tif ( !drake.dragging || !shared.item ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdrop( shared.item, getParent( shared.item ) );\n\t\t\t}\n\n\t\t\tfunction ungrab() {\n\t\t\t\tshared.grabbed = false;\n\t\t\t\teventualMovements( 'remove' );\n\t\t\t\tmovements( 'remove' );\n\t\t\t}\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Drag stage: ------------------------------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction drag( e ) { // watch performance!! - function is running each mousemove!\n\t\t\t\tif ( !shared.mirror ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( e.originalEvent ) {\n\t\t\t\t\te = e.originalEvent; // jQuery environment\n\t\t\t\t}\n\n\t\t\t\t// update coordinates\n\t\t\t\tshared.clientX = getCoord( 'clientX', e );\n\t\t\t\tshared.clientY = getCoord( 'clientY', e );\n\n\t\t\t\t// count mirror coordinates\n\t\t\t\tvar x = shared.clientX - shared.offsetX,\n\t\t\t\t\ty = shared.clientY - shared.offsetY,\n\t\t\t\t\tpageX,\n\t\t\t\t\tpageY,\n\t\t\t\t\toffsetBox;\n\n\t\t\t\t// fill extra properties if boundingBox is used\n\t\t\t\tif ( o.boundingBox ) {\n\t\t\t\t\tpageX = getCoord( 'pageX', e );\n\t\t\t\t\tpageY = getCoord( 'pageY', e );\n\t\t\t\t\toffsetBox = getOffset( o.boundingBox );\n\t\t\t\t}\n\n\t\t\t\tif ( !o.lockY ) {\n\t\t\t\t\tif ( !o.boundingBox || (pageX > offsetBox.left + shared.offsetX && pageX < offsetBox.right + shared.offsetXr) ) {\n\t\t\t\t\t\tshared.mirror.style.left = x + 'px';\n\t\t\t\t\t} else if ( o.boundingBox ) { // check again in case user scrolled the view\n\t\t\t\t\t\tif ( pageX < offsetBox.left + shared.offsetX ) {\n\t\t\t\t\t\t\tshared.mirror.style.left = shared.clientX - (pageX - offsetBox.left) + 'px';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tshared.mirror.style.left = shared.clientX - shared.mirrorWidth - (pageX - offsetBox.right) + 'px';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( !o.lockX ) {\n\t\t\t\t\tif ( !o.boundingBox || (pageY > offsetBox.top + shared.offsetY && pageY < offsetBox.bottom + shared.offsetYb) ) {\n\t\t\t\t\t\tshared.mirror.style.top = y + 'px';\n\t\t\t\t\t} else if ( o.boundingBox ) { // check again in case user scrolled the view\n\t\t\t\t\t\tif ( pageY < offsetBox.top + shared.offsetY ) {\n\t\t\t\t\t\t\tshared.mirror.style.top = shared.clientY - (pageY - offsetBox.top) + 'px';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tshared.mirror.style.top = shared.clientY - shared.mirrorHeight - (pageY - offsetBox.bottom) + 'px';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar elementBehindCursor = getElementBehindPoint( shared.mirror, shared.clientX, shared.clientY ),\n\t\t\t\t\tdropTarget = findDropTarget( elementBehindCursor, shared.clientX, shared.clientY ),\n\t\t\t\t\tchanged = dropTarget !== shared.lastDropTarget;\n\n\t\t\t\tif ( elementBehindCursor !== shared.lastElementBehindCursor ) {\n\t\t\t\t\tfireEvent( elementBehindCursor, shared.dragOverEvents.dragularenter, !!dropTarget );\n\t\t\t\t\tif ( shared.lastElementBehindCursor ) {\n\t\t\t\t\t\tfireEvent( shared.lastElementBehindCursor, shared.dragOverEvents.dragularleave, elementBehindCursor );\n\t\t\t\t\t}\n\t\t\t\t\tshared.lastElementBehindCursor = elementBehindCursor;\n\t\t\t\t}\n\n\t\t\t\tif ( changed ) {\n\t\t\t\t\tif ( shared.lastDropTarget ) {\n\t\t\t\t\t\tmoved( 'out' );\n\t\t\t\t\t}\n\t\t\t\t\tshared.lastDropTarget = dropTarget;\n\t\t\t\t\tmoved( 'over' );\n\t\t\t\t}\n\n\t\t\t\t// do not copy in same container\n\t\t\t\tif ( dropTarget === shared.source && shared.copy && !g( o.copySortSource ) ) {\n\t\t\t\t\tif ( getParent( shared.item ) ) {\n\t\t\t\t\t\tshared.item.parentNode.removeChild( shared.item );\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar reference,\n\t\t\t\t\timmediate = getImmediateChild( dropTarget, elementBehindCursor );\n\n\t\t\t\tif ( immediate !== null ) {\n\t\t\t\t\treference = getReference( dropTarget, immediate, shared.clientX, shared.clientY );\n\t\t\t\t} else if ( g( o.revertOnSpill ) === true && !shared.copy ) {\n\t\t\t\t\t// the case that mirror is not over valid target and reverting is on and copy is off\n\t\t\t\t\treference = shared.initialSibling;\n\t\t\t\t\tdropTarget = shared.source;\n\t\t\t\t} else {\n\t\t\t\t\t// the case that mirror is not over valid target and removing is on or copy is on\n\t\t\t\t\tif ( shared.copy && getParent( shared.item ) ) {\n\t\t\t\t\t\t// remove item or copy of item\n\t\t\t\t\t\tshared.item.parentNode.removeChild( shared.item );\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( (reference === null && changed) ||\n\t\t\t\t\treference !== shared.item &&\n\t\t\t\t\treference !== nextEl( shared.item ) &&\n\t\t\t\t\treference !== shared.currentSibling ) {\n\t\t\t\t\t// moving item/copy to new container from previous one\n\t\t\t\t\tshared.currentSibling = reference;\n\n\t\t\t\t\tdropTarget.insertBefore( shared.item, reference ); // if reference is null item is inserted at the end\n\n\t\t\t\t\tif ( o.scope ) {\n\t\t\t\t\t\to.scope.$emit( o.eventNames.dragularshadow, shared.item, dropTarget, e );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction moved( type ) {\n\t\t\t\t\tif ( o.scope ) {\n\t\t\t\t\t\tnotify( o.scope );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( shared.targetCtx && shared.targetCtx.o.scope && shared.targetCtx.o.scope !== o.scope ) {\n\t\t\t\t\t\tnotify( shared.targetCtx.o.scope );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( g( o.removeOnSpill ) === true ) {\n\t\t\t\t\t\ttype === 'over' ? spillOver() : spillOut();\n\t\t\t\t\t}\t\n\n\t\t\t\t\tfunction notify( scope ){\n\t\t\t\t\t\tscope.$emit( o.eventNames[ 'dragular' + type ], shared.item, shared.lastDropTarget, shared.source, e );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// find valid drop container\n\t\t\tfunction findDropTarget( elementBehindCursor, clientX, clientY ) { // watch performance!! - running each move!\n\t\t\t\tvar target = elementBehindCursor,\n\t\t\t\t\ttargetCtx = null;\n\n\t\t\t\twhile ( target && !accepted() ) {\n\t\t\t\t\ttarget = getParent( target );\n\t\t\t\t}\n\n\t\t\t\t// bugfix #148 model not updated on spill\n\t\t\t\t// added target condition to fix #161\n\t\t\t\tif ( target && targetCtx ){\n\t\t\t\t\tshared.targetCtx = targetCtx;\n\t\t\t\t}\n\n\t\t\t\treturn target;\n\n\t\t\t\tfunction accepted() {\n\n\t\t\t\t\tif ( !isContainer( target ) ) { // is not droppable?\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar immediate = getImmediateChild( target, elementBehindCursor ),\n\t\t\t\t\t\treference = getReference( target, immediate, clientX, clientY ),\n\t\t\t\t\t\tinitial = isInitialPlacement( target, reference ),\n\t\t\t\t\t\ti = o.nameSpace.length,\n\t\t\t\t\t\tnameSpace;\n\n\t\t\t\t\twhile ( i-- ) { // for each namespace\n\t\t\t\t\t\tnameSpace = o.nameSpace[ i ];\n\t\t\t\t\t\tif ( shared.containers[ nameSpace ].indexOf( target ) !== -1 ) {\n\t\t\t\t\t\t\ttargetCtx = getTargetCtx( nameSpace );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// shared.target must be actual (used for scroll functionality)\n\t\t\t\t\tshared.target = target;\n\n\t\t\t\t\tif ( initial ) {\n\n\t\t\t\t\t\treturn true; // accepts = true;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// try to find target in default set of containers\n\t\t\t\t\t\tif ( !targetCtx ) {\n\t\t\t\t\t\t\ttargetCtx = getTargetCtx( 'dragularCommon' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if found and containersModel is dynamic, retrieve model\n\t\t\t\t\t\tif ( targetCtx && _isFunction( targetCtx.o.containersModel ) ) {\n\t\t\t\t\t\t\t// fix targetCtx.m(odel) for dynamic containersModel\n\t\t\t\t\t\t\ttargetCtx.m = getContainersModel( targetCtx.o )[ getContainers( targetCtx.o ).indexOf( target ) ];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( targetCtx && // target container is defined via service or directive\n\t\t\t\t\t\t\ttargetCtx.o.accepts && !targetCtx.o.accepts( shared.item, target, shared.source, reference, shared.sourceModel, shared.initialIndex ) ) {\n\n\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\t} else if ( o.isContainer && // target container is recognized via o.isContainer\n\t\t\t\t\t\t\to.isContainerAccepts && !o.isContainerAccepts( shared.item, target, shared.source, reference, shared.sourceModel, shared.initialIndex ) ) {\n\n\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn !o.canBeAccepted || o.canBeAccepted( shared.item, target, shared.source, reference, shared.sourceModel, shared.initialIndex );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tfunction getTargetCtx( nameSpace ) {\n\t\t\t\t\treturn shared.containersCtx[ nameSpace ] && shared.containersCtx[ nameSpace ][ shared.containers[ nameSpace ].indexOf( target ) ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction spillOver() {\n\t\t\t\trmClass( shared.item, o.classes.hide );\n\t\t\t}\n\n\t\t\tfunction spillOut() {\n\t\t\t\tif ( drake.dragging ) {\n\t\t\t\t\taddClass( shared.item, o.classes.hide );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// is item currently placed in original container and original position?\n\t\t\tfunction isInitialPlacement( target, s ) { // watch performance - running each move several times!\n\t\t\t\tvar sibling = s !== undefined ? s : (shared.mirror ? shared.currentSibling : nextEl( shared.item ));\n\t\t\t\treturn target === shared.source && sibling === shared.initialSibling;\n\t\t\t}\n\n\t\t\tfunction getImmediateChild( dropTarget, target ) { // watch performance - running each move several times!\n\t\t\t\tvar immediate = target;\n\t\t\t\twhile ( immediate !== dropTarget && getParent( immediate ) !== dropTarget ) {\n\t\t\t\t\timmediate = getParent( immediate );\n\t\t\t\t}\n\t\t\t\tif ( immediate === _docElm ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn immediate;\n\t\t\t}\n\n\t\t\tfunction getReference( dropTarget, target, x, y ) { // watch performance - running each move several times!\n\t\t\t\tvar horizontal = o.direction === 'horizontal';\n\t\t\t\treturn target !== dropTarget ? inside() : outside();\n\n\t\t\t\tfunction outside() { // slower, but able to figure out any position\n\t\t\t\t\tvar len = dropTarget.children.length,\n\t\t\t\t\t\ti, el, rect;\n\t\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\t\tel = dropTarget.children[ i ];\n\t\t\t\t\t\trect = el.getBoundingClientRect();\n\t\t\t\t\t\tif ( horizontal && rect.left > x ) {\n\t\t\t\t\t\t\treturn el;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !horizontal && rect.top > y ) {\n\t\t\t\t\t\t\treturn el;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tfunction inside() { // faster, but only available if dropped inside a child element\n\t\t\t\t\tvar rect = target.getBoundingClientRect();\n\t\t\t\t\tif ( horizontal ) {\n\t\t\t\t\t\treturn resolve( x > rect.left + getRectWidth( rect ) / 2 );\n\t\t\t\t\t}\n\t\t\t\t\treturn resolve( y > rect.top + getRectHeight( rect ) / 2 );\n\t\t\t\t}\n\n\t\t\t\tfunction resolve( after ) {\n\t\t\t\t\treturn after ? nextEl( target ) : target;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction getElementBehindPoint( point, x, y ) { // watch performance!! - function is running each mousemove!\n\t\t\t\tvar p = point || {},\n\t\t\t\t\tstate = p.className,\n\t\t\t\t\tel;\n\t\t\t\tp.className += ' ' + o.classes.hide;\n\t\t\t\tel = _doc.elementFromPoint( x, y );\n\t\t\t\tp.className = state;\n\t\t\t\treturn el;\n\t\t\t}\n\n\t\t\tfunction isContainer( el ) {\n\n\t\t\t\tif ( !el ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar i = o.nameSpace.length;\n\t\t\t\twhile ( i-- ) {\n\n\t\t\t\t\tif ( shared.containers[ o.nameSpace[ i ] ].indexOf( el ) !== -1 ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( o.isContainer( el ) ) {\n\n\t\t\t\t\tshared.tempModel = o.isContainerModel( el );\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\n\t\t\t\t\tshared.tempModel = null;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tfunction getContainers( opt ) {\n\n\t\t\t\treturn _getContainers( 'containers', opt );\n\t\t\t}\n\n\t\t\tfunction getContainersModel( opt ) {\n\n\t\t\t\treturn _getContainers( 'containersModel', opt, true );\n\t\t\t}\n\n\t\t\tfunction _getContainers( containersType, opt, to2d ) {\n\n\t\t\t\treturn _isFunction( opt[ containersType ] ) ? sanitizeContainers(\n\t\t\t\t\topt[ containersType ](\n\t\t\t\t\t\t(opt === o ? drake : null),\n\t\t\t\t\t\tshared\n\t\t\t\t\t),\n\t\t\t\t\tto2d,\n\t\t\t\t\topt.scope\n\t\t\t\t) : opt[ containersType ];\n\t\t\t}\n\n\t\t\tfunction cancel( revert ) {\n\t\t\t\tif ( !drake.dragging ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar reverts = arguments.length > 0 ? revert : g( o.revertOnSpill ),\n\t\t\t\t\tparent = getParent( shared.item );\n\n\t\t\t\tvar initial = isInitialPlacement( parent );\n\t\t\t\tif ( !initial && !shared.copy && reverts ) {\n\t\t\t\t\tshared.source.insertBefore( shared.item, shared.initialSibling );\n\t\t\t\t}\n\t\t\t\tif ( shared.sourceModel && !shared.copy && !reverts ) {\n\t\t\t\t\tdrop( shared.item, parent );\n\t\t\t\t} else if ( o.scope ) {\n\t\t\t\t\tif ( initial || reverts ) {\n\t\t\t\t\t\to.scope.$emit( o.eventNames.dragularcancel, shared.item, shared.source, shared.sourceModel, shared.initialIndex );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( !shared.sourceModel || shared.copy || reverts || initial ) {\n\t\t\t\t\tcleanup();\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Release stage: ------------------------------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction release( e ) {\n\n\t\t\t\tungrab();\n\t\t\t\tif ( !drake.dragging ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( e.originalEvent ) {\n\t\t\t\t\te = e.originalEvent; // jQuery enviroment\n\t\t\t\t}\n\n\t\t\t\tshared.clientX = getCoord( 'clientX', e );\n\t\t\t\tshared.clientY = getCoord( 'clientY', e );\n\n\t\t\t\tvar elementBehindCursor = getElementBehindPoint( shared.mirror, shared.clientX, shared.clientY ),\n\t\t\t\t\tdropTarget = findDropTarget( elementBehindCursor, shared.clientX, shared.clientY );\n\n\t\t\t\tif ( dropTarget && ((shared.copy && g( o.copySortSource )) || (!shared.copy || dropTarget !== shared.source)) ) {\n\t\t\t\t\t// found valid target and (is not copy case or target is not initial container)\n\t\t\t\t\tdrop( shared.item, dropTarget );\n\t\t\t\t} else if ( g( o.removeOnSpill ) ) {\n\t\t\t\t\tremove();\n\t\t\t\t} else {\n\t\t\t\t\tcancel();\n\t\t\t\t}\n\n\t\t\t\t// after release there is no container hovered\n\t\t\t\tshared.target = null;\n\n\t\t\t\tif ( shared.lastElementBehindCursor ) {\n\t\t\t\t\tfireEvent( shared.lastElementBehindCursor, shared.dragOverEvents.dragularrelease, elementBehindCursor );\n\t\t\t\t}\n\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\to.scope.$emit( o.eventNames.dragularrelease, shared.item, shared.source, e );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction drop( item, target ) {\n\t\t\t\tif ( !item ) { // https://github.com/luckylooke/dragular/issues/102\n\t\t\t\t\tcleanup();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar sourceItem = shared.sourceItem,\n\t\t\t\t\tcurrentSibling = shared.currentSibling,\n\t\t\t\t\tdropIndex = domIndexOf( item, target );\n\n\t\t\t\tif ( shared.copy && target === shared.source && getParent( item ) && g( o.copySortSource ) ) {\n\t\t\t\t\titem.parentNode.removeChild( shared.sourceItem );\n\t\t\t\t}\n\n\t\t\t\tif ( shared.sourceModel && !isInitialPlacement( target ) ) {\n\t\t\t\t\tif ( shared.targetCtx && shared.targetCtx.fm ) { // target has filtered model\n\t\t\t\t\t\t// convert index from index-in-filteredModel to index-in-model\n\t\t\t\t\t\tdropIndex = shared.targetCtx.m.indexOf( shared.targetCtx.fm[ dropIndex ] );\n\t\t\t\t\t}\n\t\t\t\t\tif ( shared.sourceFilteredModel ) { // source has filtered model\n\t\t\t\t\t\t// convert index from index-in-filteredModel to index-in-model\n\t\t\t\t\t\tshared.initialIndex = shared.sourceModel.indexOf( shared.sourceFilteredModel[ shared.initialIndex ] );\n\t\t\t\t\t}\n\t\t\t\t\t$rootScope.$applyAsync( function applyDrop() {\n\t\t\t\t\t\tif ( !shared.sourceModel ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( target === shared.source ) {\n\t\t\t\t\t\t\tshared.sourceModel.splice( dropIndex, 0, shared.sourceModel.splice( shared.initialIndex, 1 )[ 0 ] );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tshared.dropElmModel = shared.copy && !o.dontCopyModel ? angular.copy( shared.sourceModel[ shared.initialIndex ] ) : shared.sourceModel[ shared.initialIndex ];\n\n\t\t\t\t\t\t\tif ( !shared.tempModel ) {\n\t\t\t\t\t\t\t\tshared.targetModel = ( shared.targetCtx && shared.targetCtx.m ) || shared.sourceModel;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tshared.targetModel = shared.tempModel;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\titem.parentNode.removeChild( item ); // element must be removed for ngRepeat to apply correctly\n\n\t\t\t\t\t\t\tif ( !shared.copy ) {\n\t\t\t\t\t\t\t\tshared.sourceModel.splice( shared.initialIndex, 1 );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( shared.targetModel ) {\n\t\t\t\t\t\t\t\tshared.targetModel.splice( dropIndex, 0, shared.dropElmModel );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// removing element, as protection against duplicates, angular ng-repeat will create new item according to model\n\t\t\t\t\t\tif ( getParent( item ) ) {\n\t\t\t\t\t\t\titem.parentNode.removeChild( item );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tafterDrop();\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tafterDrop();\n\t\t\t\t}\n\n\t\t\t\tfunction afterDrop() {\n\n\t\t\t\t\t// in nested containers case, new containers doesnt have registered mousedown\n\t\t\t\t\tgetContainers( o ).forEach( function readdMouseDown( container ) {\n\t\t\t\t\t\tregEvent( container, 'off', 'mousedown', grab );\n\t\t\t\t\t\tregEvent( container, 'on', 'mousedown', grab );\n\t\t\t\t\t} );\n\n\t\t\t\t\tif ( o.compileItemOnDrop ) {\n\t\t\t\t\t\tvar scope = angular.element( target ).scope ? angular.element( target ).scope() : o.scope;\n\t\t\t\t\t\tif ( scope ) {\n\t\t\t\t\t\t\tscope.$applyAsync( function () {\n\t\t\t\t\t\t\t\tvar content = $compile( shared.copy ? sourceItem.cloneNode( true ) : sourceItem )( scope );\n\t\t\t\t\t\t\t\tif ( item.parentNode === target ) {\n\t\t\t\t\t\t\t\t\ttarget.removeChild( item );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttarget.insertBefore( content[ 0 ], currentSibling );\n\t\t\t\t\t\t\t\tcleanup();\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( o.scope ) {\n\t\t\t\t\t\tnotify( o.scope );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( shared.targetCtx && shared.targetCtx.o.scope && shared.targetCtx.o.scope !== o.scope ) {\n\t\t\t\t\t\tnotify( shared.targetCtx.o.scope );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !o.compileItemOnDrop ) {\n\t\t\t\t\t\tcleanup();\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction notify( scope ){\n\t\t\t\t\t\tif ( isInitialPlacement( target ) ) {\n\t\t\t\t\t\t\tscope.$emit( o.eventNames.dragularcancel, item, shared.source, shared.sourceModel, shared.initialIndex );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tscope.$emit( o.eventNames.dragulardrop, item, target, shared.source, shared.sourceModel, shared.initialIndex, shared.targetModel, dropIndex );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction remove() {\n\t\t\t\tif ( !drake.dragging ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar parent = getParent( shared.item );\n\n\t\t\t\tif ( parent ) {\n\t\t\t\t\tparent.removeChild( shared.item );\n\t\t\t\t}\n\n\t\t\t\tif ( shared.sourceModel ) {\n\t\t\t\t\t$rootScope.$applyAsync( function removeModel() {\n\t\t\t\t\t\tshared.sourceModel.splice( shared.initialIndex, 1 );\n\t\t\t\t\t\tcleanup();\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\to.scope.$emit( shared.copy ? o.eventNames.dragularcancel : o.eventNames.dragularremove, shared.item, parent, shared.sourceModel, shared.initialIndex );\n\t\t\t\t}\n\t\t\t\tif ( !shared.sourceModel ) {\n\t\t\t\t\tcleanup();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction cleanup() {\n\t\t\t\tungrab();\n\t\t\t\tremoveMirrorImage();\n\n\t\t\t\tif ( shared.item ) {\n\t\t\t\t\trmClass( shared.item, o.classes.transit );\n\t\t\t\t}\n\n\t\t\t\tdrake.dragging = false;\n\n\t\t\t\tif ( g( o.removeOnSpill ) === true ) {\n\t\t\t\t\tspillOut();\n\t\t\t\t}\n\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\tif ( shared.lastDropTarget ) {\n\t\t\t\t\t\to.scope.$emit( o.eventNames.dragularout, shared.item, shared.lastDropTarget, shared.source );\n\t\t\t\t\t}\n\t\t\t\t\to.scope.$emit( o.eventNames.dragulardragend, shared.item );\n\t\t\t\t}\n\n\t\t\t\tshared.source = shared.item = shared.sourceItem = shared.initialSibling = shared.currentSibling = shared.sourceModel = null;\n\t\t\t\tshared.initialIndex = shared.currentIndex = shared.lastDropTarget = shared.tempModel = shared.targetModel = null;\n\t\t\t\tshared.dropElmModel = shared.targetCtx = shared.copy = shared.moveX = shared.moveY = null;\n\t\t\t}\n\n\t\t\tfunction destroy() {\n\n\t\t\t\tregisterEvents( true );\n\t\t\t\tremoveContainers( o.containers );\n\t\t\t\trelease( {} );\n\t\t\t}\n\n\t\t\tfunction removeContainers( containers ) {\n\n\t\t\t\t$rootScope.$applyAsync( function applyDestroyed() {\n\n\t\t\t\t\tcontainers = _isArray( containers ) ? containers : makeArray( containers );\n\t\t\t\t\tcontainers.forEach( function forEachContainer( container ) {\n\n\t\t\t\t\t\tangular.forEach( o.nameSpace, function forEachNs( nameSpace ) {\n\n\t\t\t\t\t\t\tvar index;\n\t\t\t\t\t\t\tindex = shared.containers[ nameSpace ].indexOf( container );\n\t\t\t\t\t\t\tshared.containers[ nameSpace ].splice( index, 1 );\n\t\t\t\t\t\t\tshared.containersCtx[ nameSpace ].splice( index, 1 );\n\n\t\t\t\t\t\t\tif ( -1 < (index = initialContainers.indexOf( container ))) {\n\t\t\t\t\t\t\t\tinitialContainers.splice( index, 1 );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tfunction addContainers( containers ) {\n\n\t\t\t\tcontainers = _isArray( containers ) ? containers : makeArray( containers );\n\t\t\t\tcontainers.forEach( function forEachContainer( container, i ) {\n\n\t\t\t\t\tangular.forEach( o.nameSpace, function forEachNs( nameSpace ) {\n\n\t\t\t\t\t\tshared.containers[ nameSpace ].push( container );\n\t\t\t\t\t\tshared.containersCtx[ nameSpace ].push({\n\t\t\t\t\t\t\to: o,\n\t\t\t\t\t\t\tm: getContainersModel( o )[ i ], // can be undefined\n\t\t\t\t\t\t\tfm: o.containersFilteredModel[ i ] // can be undefined\n\t\t\t\t\t\t});\n\t\t\t\t\t\tinitialContainers.push( container );\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tfunction scrollContainer( e ) {\n\t\t\t\tif ( shared.target ) {\n\t\t\t\t\tif ( e.originalEvent ) {\n\t\t\t\t\t\te = e.originalEvent; // jQuery enviroment\n\t\t\t\t\t}\n\t\t\t\t\tvar before = shared.target.scrollTop;\n\t\t\t\t\tshared.target.scrollTop += e.deltaY;\n\t\t\t\t\t// block scroll of the document when container can be scrolled\n\t\t\t\t\tif ( before !== shared.target.scrollTop ) {\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction removeMirrorImage() {\n\t\t\t\tif ( shared.mirror ) {\n\t\t\t\t\trmClass( _doc.body, o.classes.unselectable );\n\t\t\t\t\tregEvent( _docElm, 'off', 'mousemove', drag );\n\t\t\t\t\tregEvent( shared.mirror, 'off', 'wheel', scrollContainer );\n\t\t\t\t\tif ( getParent( shared.mirror ) ) {\n\t\t\t\t\t\tshared.mirror.parentNode.removeChild( shared.mirror );\n\t\t\t\t\t}\n\t\t\t\t\tshared.mirror = null;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Other fns: -------------------------------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction depSanitize( containersModel ) {\n\t\t\t\tconsole.warn( 'Deprecated method drake.sanitizeContainersModel! Will be removed in next major release! Please use sanitizeContainers instead.' );\n\t\t\t\tsanitizeContainers( containersModel, true, o.scope );\n\t\t\t}\n\n\t\t} // end of service\n\n\t\t/****************************************************************************************************************************/\n\t\t/****************************************************************************************************************************/\n\t\t/****************************************************************************************************************************/\n\n\t\t// HELPERS FUNCTIONS:\n\n\t\tfunction sanitizeContainers( containers, to2d, scope ) {\n\n\t\t\tif ( _isFunction( containers ) ) {\n\n\t\t\t\treturn containers;\n\t\t\t}\n\t\t\telse if ( _isArray( containers ) ) {\n\n\t\t\t\tif ( to2d ) {\n\t\t\t\t\t// |-------- is 2D array? -----------|\n\t\t\t\t\treturn _isArray( containers[ 0 ] ) ? containers : [ containers ];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn containers;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( typeof containers === 'string' && scope ) {\n\n\t\t\t\tvar evaluated = scope.$eval( containers );\n\n\t\t\t\tif ( _isFunction( evaluated ) ) {\n\t\t\t\t\treturn evaluated;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\treturn scope.$eval( containers );\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( containers ) {\n\n\t\t\t\treturn makeArray( containers );\n\t\t\t}\n\n\t\t\treturn [];\n\t\t}\n\n\t\tfunction regEvent( el, op, type, fn ) {\n\t\t\tvar touch = {\n\t\t\t\t\tmouseup: 'touchend',\n\t\t\t\t\tmousedown: 'touchstart',\n\t\t\t\t\tmousemove: 'touchmove'\n\t\t\t\t},\n\t\t\t\tpointers = {\n\t\t\t\t\tmouseup: 'pointerup',\n\t\t\t\t\tmousedown: 'pointerdown',\n\t\t\t\t\tmousemove: 'pointermove'\n\t\t\t\t},\n\t\t\t\tmicrosoft = {\n\t\t\t\t\tmouseup: 'MSPointerUp',\n\t\t\t\t\tmousedown: 'MSPointerDown',\n\t\t\t\t\tmousemove: 'MSPointerMove'\n\t\t\t\t},\n\t\t\t\t$el = angular.element( el );\n\n\t\t\tif ( el.addEventListener ) {\n\n\t\t\t\tvar opConvert = { on: 'addEventListener', off: 'removeEventListener' };\n\t\t\t\tel[ opConvert[ op ] ]( type, fn, { passive: false } );\n\t\t\t\tel[ opConvert[ op ] ]( touch[ type ], fn, { passive: false } );\n\n\t\t\t} else {\n\n\t\t\t\tif ( typeof navigator !== 'undefined' && navigator.pointerEnabled && pointers[ type ] ) {\n\t\t\t\t\t$el[ op ]( pointers[ type ], fn );\n\t\t\t\t} else if ( typeof navigator !== 'undefined' && navigator.msPointerEnabled && microsoft[ type ] ) {\n\t\t\t\t\t$el[ op ]( microsoft[ type ], fn );\n\t\t\t\t} else if ( touch[ type ] ) {\n\t\t\t\t\t$el[ op ]( touch[ type ], fn );\n\t\t\t\t}\n\t\t\t\t$el[ op ]( type, fn );\n\n\t\t\t}\n\t\t}\n\n\t\tfunction never() {\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction always() {\n\t\t\treturn true;\n\t\t}\n\n\t\t// make array from array-like objects or from single element (based on bevacqua/atoa)\n\t\tfunction makeArray( all, startIndex ) {\n\t\t\tif ( _isArray( all ) ) {\n\t\t\t\treturn all;\n\t\t\t}\n\t\t\tif ( all.length ) { // is array-like\n\t\t\t\treturn Array.prototype.slice.call( all, startIndex ); // convert to vanilla js array\n\t\t\t} else { // is one element\n\t\t\t\treturn [ all ];\n\t\t\t}\n\t\t}\n\n\t\tfunction whichMouseButton( e ) {\n\t\t\tif ( e.touches ) {\n\t\t\t\treturn e.touches.length;\n\t\t\t}\n\t\t\tif ( e.originalEvent && e.originalEvent.touches ) {\n\t\t\t\treturn e.originalEvent.touches.length;\n\t\t\t}\n\t\t\tif ( e.which !== void 0 && e.which !== 0 ) {\n\t\t\t\treturn e.which;\n\t\t\t} // github.com/bevacqua/dragula/issues/261\n\t\t\tif ( e.buttons !== undefined ) {\n\t\t\t\treturn e.buttons;\n\t\t\t}\n\t\t\tvar button = e.button;\n\t\t\tif ( button !== undefined ) { // see github.com/jquery/jquery/blob/99e8ff1baa7ae341e94bb89c3e84570c7c3ad9ea/src/event.js#L573-L575\n\t\t\t\treturn button & 1 ? 1 : button & 2 ? 3 : (button & 4 ? 2 : 0);\n\t\t\t}\n\t\t}\n\n\t\tfunction preventGrabbed( e ) {\n\t\t\tif ( e.originalEvent ) {\n\t\t\t\te = e.originalEvent; // jQuery enviroment\n\t\t\t}\n\t\t\tif ( shared.grabbed ) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tfunction getScroll( scrollProp, offsetProp ) {\n\t\t\tif ( typeof window[ offsetProp ] !== 'undefined' ) {\n\t\t\t\treturn window[ offsetProp ];\n\t\t\t}\n\t\t\tif ( _docElm.clientHeight ) {\n\t\t\t\treturn _docElm[ scrollProp ];\n\t\t\t}\n\t\t\treturn _doc.body[ scrollProp ];\n\t\t}\n\n\t\tfunction getOffset( el ) { // watch performance!! - function is running each mousemove!\n\t\t\tvar rect = el.getBoundingClientRect(),\n\t\t\t\tscrollTop = getScroll( 'scrollTop', 'pageYOffset' ),\n\t\t\t\tscrollLeft = getScroll( 'scrollLeft', 'pageXOffset' );\n\t\t\treturn {\n\t\t\t\tleft: rect.left + scrollLeft,\n\t\t\t\tright: rect.right + scrollLeft,\n\t\t\t\ttop: rect.top + scrollTop,\n\t\t\t\tbottom: rect.bottom + scrollTop\n\t\t\t};\n\t\t}\n\n\t\tfunction getRectWidth( rect ) {\n\t\t\treturn rect.width || (rect.right - rect.left);\n\t\t}\n\n\t\tfunction getRectHeight( rect ) {\n\t\t\treturn rect.height || (rect.bottom - rect.top);\n\t\t}\n\n\t\tfunction getEmptyArray() {\n\t\t\treturn [];\n\t\t}\n\n\t\tfunction nextEl( el ) {\n\t\t\tif ( !el ) { // https://github.com/luckylooke/dragular/issues/102\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn el.nextElementSibling || manually();\n\n\t\t\tfunction manually() {\n\t\t\t\tvar sibling = el;\n\t\t\t\tdo {\n\t\t\t\t\tsibling = sibling.nextSibling;\n\t\t\t\t} while ( sibling && sibling.nodeType !== 1 );\n\t\t\t\treturn sibling;\n\t\t\t}\n\t\t}\n\n\t\t//Cannot use angular.isElement because we need to check plain dom element, no jQlite wrapped\n\t\tfunction isElement( obj ) {\n\t\t\treturn (\n\t\t\t\ttypeof HTMLElement === 'object' ? obj instanceof HTMLElement : //DOM2\n\t\t\t\t\tobj && typeof obj === 'object' && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === 'string'\n\t\t\t);\n\t\t}\n\n\t\tfunction lookupClass( className ) {\n\t\t\tvar cached = shared.classesCache[ className ];\n\t\t\tif ( cached ) {\n\t\t\t\tcached.lastIndex = 0;\n\t\t\t} else {\n\t\t\t\tshared.classesCache[ className ] = cached = new RegExp( '(?:^|\\\\s)' + className + '(?:\\\\s|$)', 'g' );\n\t\t\t}\n\t\t\treturn cached;\n\t\t}\n\n\t\tfunction addClass( el, className ) {\n\t\t\tvar current = el.className;\n\t\t\tif ( !current.length ) {\n\t\t\t\tel.className = className;\n\t\t\t} else if ( !lookupClass( className ).test( current ) ) {\n\t\t\t\tel.className += ' ' + className;\n\t\t\t}\n\t\t}\n\n\t\tfunction rmClass( el, className ) {\n\t\t\tel.className = el.className.replace( lookupClass( className ), ' ' ).trim();\n\t\t}\n\n\t\tfunction getEventHost( e ) {\n\t\t\t// on touchend event, we have to use `e.changedTouches`\n\t\t\t// see http://stackoverflow.com/questions/7192563/touchend-event-properties\n\t\t\t// see https://github.com/bevacqua/dragula/issues/34\n\t\t\tif ( e.targetTouches && e.targetTouches.length ) {\n\t\t\t\treturn e.targetTouches[ 0 ];\n\t\t\t}\n\t\t\tif ( e.changedTouches && e.changedTouches.length ) {\n\t\t\t\treturn e.changedTouches[ 0 ];\n\t\t\t}\n\t\t\treturn e;\n\t\t}\n\n\t\tfunction getCoord( coord, e ) { // watch performance - running each move several times!\n\t\t\tvar host = getEventHost( e );\n\t\t\tvar missMap = {\n\t\t\t\tpageX: 'clientX', // IE8\n\t\t\t\tpageY: 'clientY' // IE8\n\t\t\t};\n\t\t\tif ( coord in missMap && !(coord in host) && missMap[ coord ] in host ) {\n\t\t\t\tcoord = missMap[ coord ];\n\t\t\t}\n\n\t\t\t// Adding support for touch events, as they are not functional in the original\n\t\t\tif ( !host.type || host.type.indexOf( 'touch' ) < 0 ) {\n\t\t\t\treturn host[ coord ];\n\t\t\t} else {\n\t\t\t\tif ( host.type.indexOf( 'end' ) === -1 ) {\n\t\t\t\t\t// No clientX or clientY in a touch event\n\t\t\t\t\treturn host.originalEvent.touches[ 0 ][ coord.replace( 'client', 'page' ) ];\n\t\t\t\t}\n\t\t\t\t// Nothing should happen for touchend\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfunction getParent( el ) { // watch performance!! - function is running each mousemove!\n\t\t\treturn el.parentNode === document ? null : el.parentNode;\n\t\t}\n\n\t\tfunction isInput( el ) {\n\t\t\treturn el.tagName === 'INPUT' || el.tagName === 'TEXTAREA' || el.tagName === 'SELECT' || isEditable( el );\n\t\t}\n\n\t\tfunction isEditable( el ) {\n\t\t\tif ( !el ) {\n\t\t\t\treturn false;\n\t\t\t} // no parents were editable\n\t\t\tif ( el.contentEditable === 'false' ) {\n\t\t\t\treturn false;\n\t\t\t} // stop the lookup\n\t\t\tif ( el.contentEditable === 'true' ) {\n\t\t\t\treturn true;\n\t\t\t} // found a contentEditable element in the chain\n\t\t\treturn isEditable( getParent( el ) ); // contentEditable is set to 'inherit'\n\t\t}\n\n\t\tfunction domIndexOf( child, parent ) {\n\t\t\treturn Array.prototype.indexOf.call( angular.element( parent ).children(), child );\n\t\t}\n\n\t\tfunction fireEvent( target, e, extra ) { // watch performance!! - function is running each mousemove!\n\t\t\tif ( !target ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tshared.extra = extra;\n\t\t\tif ( target.dispatchEvent ) {\n\t\t\t\ttarget.dispatchEvent( e );\n\t\t\t} else {\n\t\t\t\ttarget.fireEvent( 'on' + e.eventType, e );\n\t\t\t}\n\t\t}\n\n\t\tfunction getBool( prop, args, context ) {\n\t\t\tif ( _isFunction( prop ) ) {\n\t\t\t\treturn !!prop.apply( context || this, args || shared );\n\t\t\t} else {\n\t\t\t\treturn !!prop;\n\t\t\t}\n\t\t}\n\n\t};\n\n\tdragularService.$inject = [ '$rootScope', '$compile' ];\n\n\tmodule.exports = dragularService;\n\n\n/***/ })\n/******/ ])\n});\n;"]} \ No newline at end of file diff --git a/docs/dist/examples.js b/docs/dist/examples.js index e5188e94..0ba6a194 100644 --- a/docs/dist/examples.js +++ b/docs/dist/examples.js @@ -270,7 +270,7 @@ return /******/ (function(modules) { // webpackBootstrap var dragularService = __webpack_require__( 3 ); /** - * Dragular 4.4.6 by Luckylooke https://github.com/luckylooke/dragular + * Dragular 4.5.0 by Luckylooke https://github.com/luckylooke/dragular * Angular version of dragula https://github.com/bevacqua/dragula */ module.exports = 'dragularModule'; @@ -1422,8 +1422,9 @@ return /******/ (function(modules) { // webpackBootstrap shared.containers[ nameSpace ].splice( index, 1 ); shared.containersCtx[ nameSpace ].splice( index, 1 ); - if ( -1 < (index = initialContainers.indexOf( container ))) + if ( -1 < (index = initialContainers.indexOf( container ))) { initialContainers.splice( index, 1 ); + } } ); } ); } ); @@ -2994,8 +2995,8 @@ return /******/ (function(modules) { // webpackBootstrap $templateCache.put("exampleBasic/exampleBasic.html","
\n

Basic

\n \n
\n
\n
Move me, but you can only drop me in one of these containers.
\n
If you try to drop me somewhere other than these containers, I\'ll just come back.
\n
Item 3.
\n
Item 6.
\n
\n
\n
You can drop me in the left container, otherwise I\'ll stay here.
\n
Try to click me, dragular distinguish drag from click
\n
Item 5.
\n
\n
\n
\n        \n// JS\n  controller(\'Basic\', [\'$element\', \'dragularService\', function TodoCtrl($element, dragularService) {\n    dragularService(\'.containerVertical\');\n  }])\n        \n        \n// CSS\n.clickedClass {\n  background-color: orange !important;\n}\n        \n        \n<!-- HTML -->\n  <div class=\'wrapper\' ng-controller="Basic">\n    <div class=\'containerVertical\'>\n        <div>Move me, but you can only drop me in one of these containers.</div>\n        <div>If you try to drop me somewhere other than these containers, I\'ll just come back.</div>\n        <div>Item 3.</div>\n        <div>Item 6.</div>\n    </div>\n    <div class=\'containerVertical\'>\n        <div>You can drop me in the left container, otherwise I\'ll stay here.</div>\n        <div ng-click=\"clicked = !clicked\" ng-class=\"clicked && \'clickedClass\'\">Try to click me, dragular distinguish drag from click</div>\n        <div>Item 5.</div>\n    </div>\n</div>\n        \n      
\n
\n"); $templateCache.put("exampleBasicWithModel/exampleBasicWithModel.html","
\n

Basic - with model

\n \n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n          
{{items1 | json}}
\n
\n
\n
Items2:\n          
{{items2 | json}}
\n
\n
\n
\n
\n        \n// JS\n  controller(\'BasicModel\', [\'$scope\', \'$element\', \'dragularService\', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items1 = [{\n      content: \'Move me, but you can only drop me in one of these containers.\'\n    }, {\n      content: \'If you try to drop me somewhere other than these containers, I\\\'ll just come back.\'\n    }, {\n      content: \'Item 3\'\n    }, {\n      content: \'Item 4\'\n    }];\n    $scope.items2 = [{\n      content: \'Item 5\'\n    }, {\n      content: \'Item 6\'\n    }, {\n      content: \'Item 7\'\n    }, {\n      content: \'Item 8\'\n    }];\n    var containers = $element.children().children();\n    dragularService([containers[0],containers[1]],{\n      containersModel: [$scope.items1, $scope.items2]\n    });\n  }])\n        \n        \n<!-- HTML -->\n<div class=\'wrapper\' ng-controller="Basic">\n    <div class=\'tableRow\'>\n        <div class=\'containerVertical\'>\n            <div ng-repeat="item in items1">{{item.content}}</div>\n        </div>\n        <div class=\'containerVertical\'>\n            <div ng-repeat="item in items2">{{item.content}}</div>\n        </div>\n    </div>\n    <div class="tableRow">\n        <div class="container">\n            <div>Items1:\n                <br/>{{items1 | json}}</div>\n        </div>\n        <div class="container">\n            <div>Items2:\n                <br/>{{items2 | json}}</div>\n        </div>\n    </div>\n</div>\n        \n      
\n
\n"); $templateCache.put("exampleBoundingBox/exampleBoundingBox.html","
\n

BoundingBox

\n \n
\n
\n
This items cannot cross its example element, just try it your selves.
\n
Item 2.
\n
Item 3.
\n
Item 6.
\n
\n
\n
This items cannot cross its example element, just try it your selves.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n        \n  dragularService([$element.children(), {\n    boundingBox: $element\n  });\n        \n      
\n
"); - $templateCache.put("exampleBoundingBoxLockY/exampleBoundingBoxLockY.html","
\n

BoundingBox and LockY

\n \n
\n
\n
\n
Items are locked in Y axis movement and cannot cross its closest parent div.boundingBox, just try it your selves.
\n
item 2
\n
item 3
\n
item 4
\n
item 5
\n
item 6
\n
\n
\n
\n
\n        \n  dragularService([$element.children()[0].children(), {\n    boundingBox: $element.children()[0],\n    lockY: true\n  });\n        \n      
\n
"); $templateCache.put("exampleBoundingBoxLockX/exampleBoundingBoxLockX.html","
\n

BoundingBox and lockX

\n \n
\n
\n
\n
Items are locked in X axis movement and cannot cross its closest parent div.boundingBox, just try it your selves.
\n
item 2
\n
item 3
\n
item 4
\n
\n
\n
\n
\n        \n  dragularService([$element.children()[0].children(), {\n    boundingBox: $element.children()[0],\n    lockX: true\n  });\n        \n      
\n
"); + $templateCache.put("exampleBoundingBoxLockY/exampleBoundingBoxLockY.html","
\n

BoundingBox and LockY

\n \n
\n
\n
\n
Items are locked in Y axis movement and cannot cross its closest parent div.boundingBox, just try it your selves.
\n
item 2
\n
item 3
\n
item 4
\n
item 5
\n
item 6
\n
\n
\n
\n
\n        \n  dragularService([$element.children()[0].children(), {\n    boundingBox: $element.children()[0],\n    lockY: true\n  });\n        \n      
\n
"); $templateCache.put("exampleCopy/exampleCopy.html","
\n

Copy

\n \n
\n
\n
Move me, and make copy on drop.
\n
If you try to drop me somewhere other than these containers, I\'ll just come back.
\n
\n
\n
You can drop me in the left container, otherwise I\'ll stay here.
\n
\n
\n
\n        \n// JS\n  controller(\'Copy\', [\'$element\', \'dragularService\', function TodoCtrl($element, dragularService) {\n    dragularService($element.children(), {\n      copy: true\n    });\n  }])\n        \n        \n<!-- HTML -->\n<div class=\'wrapper\' ng-controller="Copy" ng-hide="globals.showModelExamples">\n    <div id=\'left2\' class=\'containerVertical\'>\n      <div>Move me, and make copy on drop.</div>\n      <div>If you try to drop me somewhere other than these containers, I\'ll just come back.</div>\n    </div>\n    <div id=\'right2\' class=\'containerVertical\'>\n      <div>You can drop me in the left container, otherwise I\'ll stay here.</div>\n    </div>\n  </div>\n        \n      
\n
\n"); $templateCache.put("exampleCopyWithModel/exampleCopyWithModel.html","
\n

Copy - with model

\n \n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n
\n            {{ items1 | json }}\n          
\n
\n
\n
\n
Items2:\n
\n            {{ items2 | json }}\n          
\n
\n
\n
\n
\n
\n        \n// JS\n  controller(\'CopyModel\', [\'$scope\', \'$element\', \'dragularService\', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items1 = [{\n      content: \'Move me, and make copy on drop.\'\n    }, {\n      content: \'If you try to drop me somewhere other than these containers, I\\\'ll just come back.\'\n    }, {\n      content: \'Item 3\'\n    }, {\n      content: \'Item 4\'\n    }];\n    $scope.items2 = [{\n      content: \'Item 5\'\n    }, {\n      content: \'Item 6\'\n    }, {\n      content: \'Item 7\'\n    }, {\n      content: \'Item 8\'\n    }];\n    var containers = $element.children().children();\n    dragularService([containers[0],containers[1]],{\n      containersModel: [$scope.items1, $scope.items2],\n      copy: true\n    });\n  }])\n        \n        \n<!-- HTML -->\n<div class=\'wrapper\' ng-controller="CopyModel" ng-show="globals.showModelExamples">\n    <div class=\'tableRow\'>\n      <div class=\'containerVertical\'>\n        <div ng-repeat="item in items1">{{item.content}}</div>\n      </div>\n      <div class=\'containerVertical\'>\n        <div ng-repeat="item in items2">{{item.content}}</div>\n      </div>\n    </div>\n    <div class="tableRow">\n      <div class="container">\n        <div>Items1:\n          <br/>{{items1 | json}}</div>\n      </div>\n      <div class="container">\n        <div>Items2:\n          <br/>{{items2 | json}}</div>\n      </div>\n    </div>\n  </div>\n        \n      
\n
\n"); $templateCache.put("exampleCustomClasses/exampleCustomClasses.html","
\n

Custom classes

\n \n
\n
\n
Move me, but you can only drop me in one of these containers.
\n
If you try to drop me somewhere other than these containers, I\'ll just come back.
\n
Item 3.
\n
Item 6.
\n
\n
\n
You can drop me in the left container, otherwise I\'ll stay here.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n        \n  dragularService([document.getElementById(left), document.getElementById(right)], { classes: {\n    mirror: \'custom-green-mirror\'\n  } });\n\n  // Default classes are:\n  option.classes = {\n    mirror: \'gu-mirror\',\n    hide: \'gu-hide\',\n    unselectable: \'gu-unselectable\',\n    transit: \'gu-transit\',\n    overActive: \'gu-over-active\',\n    overAccepts: \'gu-over-accept\',\n    overDeclines: \'gu-over-decline\'\n  };\n        \n      
\n
\n"); @@ -3011,8 +3012,8 @@ return /******/ (function(modules) { // webpackBootstrap $templateCache.put("exampleNestedNgRepeatWithModel/exampleNestedNgRepeatWithModel.html","
\n

Nested ngRepeat - with model

\n \n
\n
\n
\n
\n
Row {{::$index}}
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
\n
\n
\n            
Items:\n
{{items | json}}
\n
\n
\n
\n
\n
\n    \n<!-- HTML -->\n<div ng-controller="NestedNgRepeatWithModel">\n  <div class=\'containerVertical\'>\n    <div ng-repeat="item in items" class=\'exampleRow\'>\n      <div class="row-handle">Row {{::$index}}</div>\n      <div class="exampleRow exampleCell containerNested">\n        <div ng-repeat="item in item.items" class="exampleCell">{{item.content}}</div>\n      </div>\n    </div>\n  </div>\n</div>\n    \n  
\n
\n    \n  // CSS\n\n  .exampleRow {\n    display: flex;\n    flex-direction: row;\n  }\n\n  .exampleCell {\n    flex-grow: 1;\n  }\n\n  .exampleRow,\n  .exampleCell {\n    margin: 10px;\n    padding: 10px;\n    background-color: rgba(0, 0, 0, 0.2);\n    cursor: move;\n    cursor: grab;\n    cursor: -moz-grab;\n    cursor: -webkit-grab;\n  }\n    \n  
\n
\n    \n  // JS\n.controller(\'NestedNgRepeatWithModel\', [\'$timeout\', \'$scope\', \'$element\', \'dragularService\', function NestedNgRepeatWithModelCtrl($timeout, $scope, $element, dragularService) {\n    $timeout(function() { // timeount due to nested ngRepeat to be ready\n      var container = $element.children().eq(0).children(),\n        parentContainers = container.children(),\n        nestedContainers = [];\n\n      dragularService(container, {\n        moves: function(el, container, handle) {\n          return handle.classList.contains(\'row-handle\');\n        },\n        containersModel: $scope.items,\n        nameSpace: \'rows\'\n      });\n\n      // collect nested contianers\n      for (var i = 0; i < parentContainers.length; i++) {\n        nestedContainers.push(parentContainers.eq(i).children()[1]);\n      }\n\n      dragularService(nestedContainers, {\n        moves: function(el, container, handle) {\n          return !handle.classList.contains(\'row-handle\');\n        },\n        containersModel: (function getNestedContainersModel(){\n          var parent = $scope.items,\n            containersModel = [];\n          for (var i = 0; i < parent.length; i++) {\n            containersModel.push(parent[i].items);\n          }\n          return containersModel;\n        })(),\n        nameSpace: \'cells\'\n      });\n    }, 0);\n    $scope.items = [{\n      items: [{\n        content: \'Item a1\'\n      }, {\n        content: \'Item a2\'\n      }, {\n        content: \'Item a3\'\n      }, {\n        content: \'Item a4\'\n      }]\n    }, {\n      items: [{\n        content: \'Item b1\'\n      }, {\n        content: \'Item b2\'\n      }, {\n        content: \'Item b3\'\n      }, {\n        content: \'Item b4\'\n      }]\n    }, {\n      items: [{\n        content: \'Item c1\'\n      }, {\n        content: \'Item c2\'\n      }, {\n        content: \'Item c3\'\n      }, {\n        content: \'Item c4\'\n      }]\n    }];\n  }])\n    \n  
\n
\n"); $templateCache.put("exampleNestedRepeatsWithCustomDirective/exampleNestedRepeatsWithCustomDirective.html","
\n
\n
\n {{item.order}}: ({{item.name}} + {{item.age}})\n
\n \n \n
\n
\n
\n
\n"); $templateCache.put("exampleNgRepeat/exampleNgRepeat.html","
\n

ngRepeat

\n \n
\n
\n
\n {{item.content}}\n
\n
\n
\n
\n        \n  // HTML:\n  <div class=\'containerVertical\'>\n    <div ng-repeat="item in items">\n      {{item.content}}\n    </div>\n  </div>\n\n  // JS:\n  dragularService($element.children());\n  $scope.items = [{\n    content: \'Try to add or remove some elements (click on +- buttons), you will see that it is not problem for dragular.\'\n  },{\n    content: \'Item 2\'\n  },{\n    content: \'Item 3\'\n  },{\n    content: \'Item 4\'\n  }];\n        \n      
\n
\n"); - $templateCache.put("exampleNgRepeatFilteredWithModel/exampleNgRepeatFilteredWithModel.html","
\n

Filtered ngRepeat - with model

\n

Move stuff between these two filtered containers. You can play with filter inputs to see that everything goes right.\n
\n Please notify the getFilteredModel function, it is necessery for not replacing the initial array object with new filtered one!

\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n          
{{items1 | json}}
\n
\n
\n
Items2:\n          
{{items2 | json}}
\n
\n
\n
\n
\n        \n// JS\n  .controller(\'NgRepeatFilteredWithModel\', [\'$scope\', \'$element\', \'dragularService\', \'$filter\', function TodoCtrl($scope, $element, dragularService, $filter) {\n    $scope.items1 = [{\n      content: \'Move me, but you can only drop me in one of these containers.\'\n    }, {\n      content: \'If you try to drop me somewhere other than these containers, I\\\'ll just come back.\'\n    }, {\n      content: \'Apple 3\'\n    }, {\n      content: \'Orange 4\'\n    }, {\n      content: \'Orange 5\'\n    }, {\n      content: \'Apple 6\'\n    }, {\n      content: \'Apple 7\'\n    }, {\n      content: \'Apple 8\'\n    }];\n    $scope.items2 = [{\n      content: \'Apple 9\'\n    }, {\n      content: \'Orange 10\'\n    }, {\n      content: \'Orange 11\'\n    }, {\n      content: \'Apple 12\'\n    }, {\n      content: \'Orange 13\'\n    }, {\n      content: \'Apple 14\'\n    }];\n    $scope.filter1query = \'Orange\';\n    $scope.filter2query = \'Orange\';\n    $scope.filteredModel1 = [];\n    $scope.filteredModel2 = [];\n    $scope.getFilteredModel = function (filteredModel, items, filterQuery) {\n      filteredModel.length = 0;\n      /*\n      * Following one-liner is same like:\n      *   var filteredModelTemp = $filter(\'filter\')(items, filterQuery);\n      *   angular.forEach(filteredModelTemp, function(item){\n      *     filteredModel.push(item);\n      *   });\n      * Or like:\n      *   var filteredModelTemp = $filter(\'filter\')(items, filterQuery);\n      *   for(var i; i < filteredModelTemp.length; i++){\n      *     filteredModel.push(filteredModelTemp[i]);\n      *   }\n      *\n      * You cannot just assign filtered array to filteredModel like this:\n      *   filteredModel = $filter(\'filter\')(items, filterQuery);\n      * Because you would replace the array object you provide to dragular with new one.\n      * So dragular will continue to use the one it was provided on init.\n      * Hopefully I make it clear. :)\n       */\n      [].push.apply(filteredModel, $filter(\'filter\')(items, filterQuery));\n      return filteredModel;\n    };\n    var containers = $element.children().eq(1).children();\n    dragularService.cleanEnviroment();\n    dragularService([containers[0],containers[1]],{\n      containersModel: [$scope.items1, $scope.items2],\n      containersFilteredModel: [$scope.filteredModel1, $scope.filteredModel2]\n    });\n  }]);\n\n        \n        \n<!-- HTML -->\n  <div class=\'wrapper\' ng-controller="NgRepeatFilteredWithModel">\n    <div class="tableRow">\n      <div class=\'containerVertical\'>\n        <input ng-model="filter1query" style="margin:10px 10px">\n      </div>\n      <div class=\'containerVertical\'>\n        <input ng-model="filter2query" style="margin:10px 10px">\n      </div>\n    </div>\n    <div class=\'tableRow\'>\n      <div class=\'containerVertical\'>\n        <div ng-repeat="item in getFilteredModel(filteredModel1, items1, filter1query)">{{item.content}}</div>\n      </div>\n      <div class=\'containerVertical\'>\n        <div ng-repeat="item in getFilteredModel(filteredModel2, items2, filter2query)">{{item.content}}</div>\n      </div>\n    </div>\n    <div class="tableRow">\n      <div class=\'containerVertical\'>\n        <pre>Items1:\n          <br/>{{items1 | json}}</pre>\n      </div>\n      <div class=\'containerVertical\'>\n        <pre>Items2:\n          <br/>{{items2 | json}}</pre>\n      </div>\n    </div>\n  </div>\n        \n      
\n
\n"); $templateCache.put("exampleNgRepeatWithModel/exampleNgRepeatWithModel.html","
\n

ngRepeat - with model

\n \n
\n
\n
\n
\n {{item.content}}\n \n \n
\n
\n
\n
\n
\n
Items:\n
{{items | json}}
\n
\n
\n
\n
\n    \n  // HTML:\n   <div class=\'wrapper\' ng-controller="NgRepeatWithModel">\n      <div class=\'containerVertical\'>\n        <div ng-repeat="item in items">\n          {{item.content}}\n          <button class=\'cursorDefault\' ng-click="addItem()">+</button>\n          <button class=\'cursorDefault\' ng-click="removeItem()">x</button>\n        </div>\n    </div>\n  </div>\n    \n  
\n
\n    \n  // JS:\n  controller(\'NgRepeatWithModel\', [\'$scope\', \'$element\', \'dragularService\', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items = [{\n      content: \'Try to add or remove some elements (click on +- buttons), you will see that it is not problem for dragular.\'\n    }, {\n      content: \'Item 2\'\n    }, {\n      content: \'Item 3\'\n    }, {\n      content: \'Item 4\'\n    }];\n    dragularService($element.children().eq(0).children(), {containersModel: $scope.items});\n    $scope.addItem = function addItem() {\n      var index = $scope.items.indexOf(this.item) + 1;\n      $scope.items.splice(index, 0, {\n        content: this.item.content + \'-copy\'\n      });\n    };\n    $scope.removeItem = function removeItem() {\n      var index = $scope.items.indexOf(this.item);\n      $scope.items.splice(index, 1);\n    };\n  }])\n    \n  
\n
\n"); + $templateCache.put("exampleNgRepeatFilteredWithModel/exampleNgRepeatFilteredWithModel.html","
\n

Filtered ngRepeat - with model

\n

Move stuff between these two filtered containers. You can play with filter inputs to see that everything goes right.\n
\n Please notify the getFilteredModel function, it is necessery for not replacing the initial array object with new filtered one!

\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n          
{{items1 | json}}
\n
\n
\n
Items2:\n          
{{items2 | json}}
\n
\n
\n
\n
\n        \n// JS\n  .controller(\'NgRepeatFilteredWithModel\', [\'$scope\', \'$element\', \'dragularService\', \'$filter\', function TodoCtrl($scope, $element, dragularService, $filter) {\n    $scope.items1 = [{\n      content: \'Move me, but you can only drop me in one of these containers.\'\n    }, {\n      content: \'If you try to drop me somewhere other than these containers, I\\\'ll just come back.\'\n    }, {\n      content: \'Apple 3\'\n    }, {\n      content: \'Orange 4\'\n    }, {\n      content: \'Orange 5\'\n    }, {\n      content: \'Apple 6\'\n    }, {\n      content: \'Apple 7\'\n    }, {\n      content: \'Apple 8\'\n    }];\n    $scope.items2 = [{\n      content: \'Apple 9\'\n    }, {\n      content: \'Orange 10\'\n    }, {\n      content: \'Orange 11\'\n    }, {\n      content: \'Apple 12\'\n    }, {\n      content: \'Orange 13\'\n    }, {\n      content: \'Apple 14\'\n    }];\n    $scope.filter1query = \'Orange\';\n    $scope.filter2query = \'Orange\';\n    $scope.filteredModel1 = [];\n    $scope.filteredModel2 = [];\n    $scope.getFilteredModel = function (filteredModel, items, filterQuery) {\n      filteredModel.length = 0;\n      /*\n      * Following one-liner is same like:\n      *   var filteredModelTemp = $filter(\'filter\')(items, filterQuery);\n      *   angular.forEach(filteredModelTemp, function(item){\n      *     filteredModel.push(item);\n      *   });\n      * Or like:\n      *   var filteredModelTemp = $filter(\'filter\')(items, filterQuery);\n      *   for(var i; i < filteredModelTemp.length; i++){\n      *     filteredModel.push(filteredModelTemp[i]);\n      *   }\n      *\n      * You cannot just assign filtered array to filteredModel like this:\n      *   filteredModel = $filter(\'filter\')(items, filterQuery);\n      * Because you would replace the array object you provide to dragular with new one.\n      * So dragular will continue to use the one it was provided on init.\n      * Hopefully I make it clear. :)\n       */\n      [].push.apply(filteredModel, $filter(\'filter\')(items, filterQuery));\n      return filteredModel;\n    };\n    var containers = $element.children().eq(1).children();\n    dragularService.cleanEnviroment();\n    dragularService([containers[0],containers[1]],{\n      containersModel: [$scope.items1, $scope.items2],\n      containersFilteredModel: [$scope.filteredModel1, $scope.filteredModel2]\n    });\n  }]);\n\n        \n        \n<!-- HTML -->\n  <div class=\'wrapper\' ng-controller="NgRepeatFilteredWithModel">\n    <div class="tableRow">\n      <div class=\'containerVertical\'>\n        <input ng-model="filter1query" style="margin:10px 10px">\n      </div>\n      <div class=\'containerVertical\'>\n        <input ng-model="filter2query" style="margin:10px 10px">\n      </div>\n    </div>\n    <div class=\'tableRow\'>\n      <div class=\'containerVertical\'>\n        <div ng-repeat="item in getFilteredModel(filteredModel1, items1, filter1query)">{{item.content}}</div>\n      </div>\n      <div class=\'containerVertical\'>\n        <div ng-repeat="item in getFilteredModel(filteredModel2, items2, filter2query)">{{item.content}}</div>\n      </div>\n    </div>\n    <div class="tableRow">\n      <div class=\'containerVertical\'>\n        <pre>Items1:\n          <br/>{{items1 | json}}</pre>\n      </div>\n      <div class=\'containerVertical\'>\n        <pre>Items2:\n          <br/>{{items2 | json}}</pre>\n      </div>\n    </div>\n  </div>\n        \n      
\n
\n"); $templateCache.put("exampleRemoveOnSpill/exampleRemoveOnSpill.html","
\n

Remove on spill

\n \n
\n
\n
Move me, but you can only drop me in containers.
\n
If you try to drop me somewhere other than containers, I\'ll die a fiery death.
\n
Item 3.
\n
Item 6.
\n
Item 4.
\n
Item 5.
\n
\n
\n
You can drop me in the left container.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n        \n  dragularService([document.getElementById(single)], { removeOnSpill: true });\n        \n      
\n
"); $templateCache.put("exampleRemoveOnSpillWithModel/exampleRemoveOnSpillWithModel.html","
\n

Remove on spill - with model

\n \n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n          
{{items1 | json}}
\n
\n
\n
Items2:\n          
{{items2 | json}}
\n
\n
\n
\n
\n        \n// JS\n  .controller(\'RemoveOnSpillWithModel\', [\'$scope\', \'$element\', \'dragularService\', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items1 = [{\n      content: \'Move me, but you can only drop me in containers.\'\n    }, {\n      content: \'If you try to drop me somewhere other than containers, I\\\'ll die a fiery death.\'\n    }, {\n      content: \'Item 3\'\n    }, {\n      content: \'Item 4\'\n    }];\n    $scope.items2 = [{\n      content: \'You can drop me in the left container.\'\n    }, {\n      content: \'Item 6\'\n    }, {\n      content: \'Item 7\'\n    }, {\n      content: \'Item 8\'\n    }];\n    var containers = $element.children().eq(0).children();\n    dragularService.cleanEnviroment();\n    dragularService([containers[0],containers[1]],{\n      containersModel: [$scope.items1, $scope.items2],\n      removeOnSpill: true\n    });\n  }])\n        \n        \n<!-- HTML -->\n<div class=\'wrapper\' ng-controller="Basic">\n    <div class=\'tableRow\'>\n        <div class=\'containerVertical\'>\n            <div ng-repeat="item in items1">{{item.content}}</div>\n        </div>\n        <div class=\'containerVertical\'>\n            <div ng-repeat="item in items2">{{item.content}}</div>\n        </div>\n    </div>\n    <div class="tableRow">\n        <div class="container">\n            <div>Items1:\n                <br/>{{items1 | json}}</div>\n        </div>\n        <div class="container">\n            <div>Items2:\n                <br/>{{items2 | json}}</div>\n        </div>\n    </div>\n</div>\n        \n      
\n
\n"); $templateCache.put("exampleRevertOnSpill/exampleRevertOnSpill.html","
\n

Revert on spill

\n \n
\n
\n
Move me, but you can only drop me in one of these containers.
\n
If you try to drop me somewhere other than these containers, I\'ll just come back.
\n
Item 3.
\n
Item 6.
\n
\n
\n
You can drop me in the left container, otherwise I\'ll stay here.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n        \n  dragularService([document.getElementById(left), document.getElementById(right)], { revertOnSpill: true });\n        \n      
\n
"); diff --git a/docs/dist/examples.min.js b/docs/dist/examples.min.js index ae77974c..3806729c 100644 --- a/docs/dist/examples.min.js +++ b/docs/dist/examples.min.js @@ -1,5 +1,5 @@ !function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t=n();for(var o in t)("object"==typeof exports?exports:e)[o]=t[o]}}(this,function(){return function(e){function n(o){if(t[o])return t[o].exports;var i=t[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var t={};return n.m=e,n.c=t,n.p="",n(0)}([function(e,n,t){"use strict";var o=t(1);angular.module("examplesApp",[o,"templates","ui.router"]);var i=t(4),r=t(5),l=t(6),a=t(7),c=t(8),s=t(9),d=t(10),m=t(11),u=t(12),p=t(13),v=t(14),g=t(15),h=t(16),f=t(17),b=t(18),x=t(19),y=t(20),I=t(21),w=t(22),$=t(23),S=t(24),M=t(25),C=t(26),q=t(27),E=t(28),B=t(29),k=t(30);t(31),angular.module("examplesApp").config(i).controller("Basic",r).controller("BasicModel",l).controller("BoundingBox",a).controller("BoundingBoxLockX",c).controller("BoundingBoxLockY",s).controller("Copy",d).controller("CopyModel",m).controller("CustomClasses",u).controller("DifferentOptionsModel",p).controller("Directive",v).controller("DirectiveModel",g).controller("DragOverEvents",h).controller("Events",f[0]).controller("Events2",f[1]).controller("Handle",b).controller("IsContainerModel",x).controller("NameSpaces",y).controller("NestedNgRepeat",I).controller("NestedNgRepeatWithModel",w).controller("NgRepeat",$).controller("NgRepeatFilteredWithModel",S).controller("NgRepeatWithModel",M).controller("RemoveOnSpill",C).controller("RemoveOnSpillWithModel",q).controller("RevertOnSpill",E).controller("ScrollingDrag",B).controller("NestedRepeatsWithCustomDirective",k).controller("ExAppCtrl",["$scope",function(e){e.examplesList=[{template:"docsInstall/docsInstall.html",link:"docsInstall",title:"Installation"},{template:"exampleBasic/exampleBasic.html",link:"exampleBasic",title:"Basic"},{template:"exampleBasicWithModel/exampleBasicWithModel.html",link:"exampleBasicWithModel",title:"Basic - with model"},{template:"exampleDifferentOptionsWithModel/exampleDifferentOptionsWithModel.html",link:"exampleDifferentOptionsWithModel",title:"Different options - with model"},{template:"exampleDirective/exampleDirective.html",link:"exampleDirective",title:"Directive"},{template:"exampleDirectiveWithModel/exampleDirectiveWithModel.html",link:"exampleDirectiveWithModel",title:"Directive - with model"},{template:"exampleEvents/exampleEvents.html",link:"exampleEvents",title:"Events"},{template:"exampleRemoveOnSpill/exampleRemoveOnSpill.html",link:"exampleRemoveOnSpill",title:"Remove on spill"},{template:"exampleRemoveOnSpillWithModel/exampleRemoveOnSpillWithModel.html",link:"exampleRemoveOnSpillWithModel",title:"Remove on spill - with model"},{template:"exampleRevertOnSpill/exampleRevertOnSpill.html",link:"exampleRevertOnSpill",title:"Revert on spill"},{template:"exampleCopy/exampleCopy.html",link:"exampleCopy",title:"Copy"},{template:"exampleCopyWithModel/exampleCopyWithModel.html",link:"exampleCopyWithModel",title:"Copy - with model"},{template:"exampleHandle/exampleHandle.html",link:"exampleHandle",title:"Handle"},{template:"exampleIsContainerWithModel/exampleIsContainerWithModel.html",link:"exampleIsContainerWithModel",title:"isContainer - with model"},{template:"exampleCustomClasses/exampleCustomClasses.html",link:"exampleCustomClasses",title:"Custom classes"},{template:"exampleNameSpaces/exampleNameSpaces.html",link:"exampleNameSpaces",title:"NameSpaces"},{template:"exampleDragOverEvents/exampleDragOverEvents.html",link:"exampleDragOverEvents",title:"Drag-over events"},{template:"exampleBoundingBox/exampleBoundingBox.html",link:"exampleBoundingBox",title:"BoundingBox"},{template:"exampleBoundingBoxLockX/exampleBoundingBoxLockX.html",link:"exampleBoundingBoxLockX",title:"BoundingBox + LockX"},{template:"exampleBoundingBoxLockY/exampleBoundingBoxLockY.html",link:"exampleBoundingBoxLockY",title:"BoundingBox + LockY"},{template:"exampleNgRepeat/exampleNgRepeat.html",link:"exampleNgRepeat",title:"ngRepeat"},{template:"exampleNgRepeatWithModel/exampleNgRepeatWithModel.html",link:"exampleNgRepeatWithModel",title:"ngRepeat - with model"},{template:"exampleNgRepeatFilteredWithModel/exampleNgRepeatFilteredWithModel.html",link:"exampleNgRepeatFilteredWithModel",title:"Filtered ngRepeat - with model"},{template:"exampleNestedNgRepeat/exampleNestedNgRepeat.html",link:"exampleNestedNgRepeat",title:"Nested ngRepead"},{template:"exampleNestedNgRepeatWithModel/exampleNestedNgRepeatWithModel.html",link:"exampleNestedNgRepeatWithModel",title:"Nested ngRepead - with model"},{template:"exampleScrollingDrag/exampleScrollingDrag.html",link:"exampleScrollingDrag",title:"Scrolling drag"},{template:"exampleSNestedRepeatsWithCustomDirective/exampleNestedRepeatsWithCustomDirective.html",link:"exampleNestedRepeatsWithCustomDirective",title:"Nested repeats with custom directive"}],e.highlightCode=function(){if(document.getElementsByTagName("code").length)for(var e=document.getElementsByTagName("code"),n=e.length-1;n>=0;n--)hljs.highlightBlock(e[n])};var n;e.toggleSidebar=function(){n||(n=angular.element(document.getElementById("rowOffcanvas"))),n.toggleClass("active")}}])},function(e,n,t){"use strict";var o=t(2),i=t(3);e.exports="dragularModule",angular.module("dragularModule",[]).factory("dragularService",i).directive("dragular",o)},function(e,n){"use strict";var t=function(e){return{restrict:"A",link:function(n,t,o){function i(e){try{return JSON.parse(e)}catch(n){return}}var r=n.$eval(o.dragular)||i(o.dragular)||{};o.dragularModel&&(r.containersModel=o.dragularModel,r.scope||(r.scope=n)),o.dragularNameSpace&&(r.nameSpace=o.dragularNameSpace.split(" ")),o.dragularOnInit&&(r.onInit=n.$eval(o.dragularOnInit)),e(t[0],r)}}};t.$inject=["dragularService"],e.exports=t},function(e,n){"use strict";var t={classesCache:{},containersCtx:{},containers:{},mirror:null,source:null,item:null,copy:null,sourceItem:null,sourceModel:null,sourceFilteredModel:null,target:null,targetCtx:null,targetModel:null,lastDropTarget:null,offsetX:null,offsetY:null,moveX:null,moveY:null,offsetXr:null,offsetYb:null,clientX:null,clientY:null,mirrorWidth:null,mirrorHeight:null,initialSibling:null,currentSibling:null,initialIndex:null,currentIndex:null,tempModel:null,dragOverEvents:{},lastElementBehindCursor:null,grabbed:null},o=function(e,n){function o(o,m){function b(){1!==arguments.length||N(o)||angular.isElement(o)||o[0]||"string"==typeof o?"string"==typeof o&&(ve=document.querySelectorAll(o)):(ge=o||{},ve=[]),pe=ge.copyOptions?angular.copy(ge):ge}function I(){var e=angular.extend({},xe,pe);angular.extend(pe,e),pe.classes&&(e=angular.extend({},fe,pe.classes),angular.extend(pe.classes,e)),pe.eventNames&&(e=angular.extend({},be,pe.eventNames),angular.extend(pe.eventNames,e))}function M(){f(pe.boundingBox)||(pe.boundingBox=!1),pe.containers&&(ve=pe.containers),pe.containers=i(ve,!1,pe.scope),pe.containersModel=i(pe.containersModel,!0,pe.scope),N(pe.containersFilteredModel)?pe.containersFilteredModel=N(pe.containersFilteredModel[0])?pe.containersFilteredModel:[pe.containersFilteredModel]:pe.containersFilteredModel=[],pe.nameSpace||(pe.nameSpace=["dragularCommon"]),N(pe.nameSpace)||(pe.nameSpace=[pe.nameSpace]),pe.nameSpace.forEach(function(e){t.containers[e]||(t.containers[e]=[],t.containersCtx[e]=[]);for(var n,o=Z(pe).length,i=0;ir.left+t.offsetX&&or.top+t.offsetY&&it)return i;if(!a&&r.top>o)return i}return null}function r(){var e=n.getBoundingClientRect();return l(a?t>e.left+p(e)/2:o>e.top+v(e)/2)}function l(e){return e?h(n):n}var a="horizontal"===pe.direction;return n!==e?r():i()}function _(e,n,t){var o,i=e||{},r=i.className;return i.className+=" "+pe.classes.hide,o=B.elementFromPoint(n,t),i.className=r,o}function K(e){if(!e)return!1;for(var n=pe.nameSpace.length;n--;)if(t.containers[pe.nameSpace[n]].indexOf(e)!==-1)return!0;return pe.isContainer(e)?(t.tempModel=pe.isContainerModel(e),!0):(t.tempModel=null,!1)}function Z(e){return ne("containers",e)}function ee(e){return ne("containersModel",e,!0)}function ne(e,n,o){return R(n[e])?i(n[e](n===pe?ye:null,t),o,n.scope):n[e]}function te(e){if(ye.dragging){var n=arguments.length>0?e:he(pe.revertOnSpill),o=$(t.item),i=U(o);i||t.copy||!n||t.source.insertBefore(t.item,t.initialSibling),!t.sourceModel||t.copy||n?pe.scope&&(i||n)&&pe.scope.$emit(pe.eventNames.dragularcancel,t.item,t.source,t.sourceModel,t.initialIndex):ie(t.item,o),(!t.sourceModel||t.copy||n||i)&&le()}}function oe(e){if(A(),ye.dragging){e.originalEvent&&(e=e.originalEvent),t.clientX=w("clientX",e),t.clientY=w("clientY",e);var n=_(t.mirror,t.clientX,t.clientY),o=P(n,t.clientX,t.clientY);o&&(t.copy&&he(pe.copySortSource)||!t.copy||o!==t.source)?ie(t.item,o):he(pe.removeOnSpill)?re():te(),t.target=null,t.lastElementBehindCursor&&q(t.lastElementBehindCursor,t.dragOverEvents.dragularrelease,n),pe.scope&&pe.scope.$emit(pe.eventNames.dragularrelease,t.item,t.source,e)}}function ie(o,i){function l(){function e(e){U(i)?e.$emit(pe.eventNames.dragularcancel,o,t.source,t.sourceModel,t.initialIndex):e.$emit(pe.eventNames.dragulardrop,o,i,t.source,t.sourceModel,t.initialIndex,t.targetModel,s)}if(Z(pe).forEach(function(e){r(e,"off","mousedown",D),r(e,"on","mousedown",D)}),pe.compileItemOnDrop){var l=angular.element(i).scope?angular.element(i).scope():pe.scope;l&&l.$applyAsync(function(){var e=n(t.copy?a.cloneNode(!0):a)(l);o.parentNode===i&&i.removeChild(o),i.insertBefore(e[0],c),le()})}pe.scope&&e(pe.scope),t.targetCtx&&t.targetCtx.o.scope&&t.targetCtx.o.scope!==pe.scope&&e(t.targetCtx.o.scope),pe.compileItemOnDrop||le()}if(!o)return void le();var a=t.sourceItem,c=t.currentSibling,s=C(o,i);t.copy&&i===t.source&&$(o)&&he(pe.copySortSource)&&o.parentNode.removeChild(t.sourceItem),t.sourceModel&&!U(i)?(t.targetCtx&&t.targetCtx.fm&&(s=t.targetCtx.m.indexOf(t.targetCtx.fm[s])),t.sourceFilteredModel&&(t.initialIndex=t.sourceModel.indexOf(t.sourceFilteredModel[t.initialIndex])),e.$applyAsync(function(){t.sourceModel&&(i===t.source?t.sourceModel.splice(s,0,t.sourceModel.splice(t.initialIndex,1)[0]):(t.dropElmModel=t.copy&&!pe.dontCopyModel?angular.copy(t.sourceModel[t.initialIndex]):t.sourceModel[t.initialIndex],t.tempModel?t.targetModel=t.tempModel:t.targetModel=t.targetCtx&&t.targetCtx.m||t.sourceModel,o.parentNode.removeChild(o),t.copy||t.sourceModel.splice(t.initialIndex,1),t.targetModel&&t.targetModel.splice(s,0,t.dropElmModel)),$(o)&&o.parentNode.removeChild(o),l())})):l()}function re(){if(ye.dragging){var n=$(t.item);n&&n.removeChild(t.item),t.sourceModel&&e.$applyAsync(function(){t.sourceModel.splice(t.initialIndex,1),le()}),pe.scope&&pe.scope.$emit(t.copy?pe.eventNames.dragularcancel:pe.eventNames.dragularremove,t.item,n,t.sourceModel,t.initialIndex),t.sourceModel||le()}}function le(){A(),me(),t.item&&y(t.item,pe.classes.transit),ye.dragging=!1,he(pe.removeOnSpill)===!0&&z(),pe.scope&&(t.lastDropTarget&&pe.scope.$emit(pe.eventNames.dragularout,t.item,t.lastDropTarget,t.source),pe.scope.$emit(pe.eventNames.dragulardragend,t.item)),t.source=t.item=t.sourceItem=t.initialSibling=t.currentSibling=t.sourceModel=null,t.initialIndex=t.currentIndex=t.lastDropTarget=t.tempModel=t.targetModel=null,t.dropElmModel=t.targetCtx=t.copy=t.moveX=t.moveY=null}function ae(){O(!0),ce(pe.containers),oe({})}function ce(n){e.$applyAsync(function(){n=N(n)?n:c(n),n.forEach(function(e){angular.forEach(pe.nameSpace,function(n){var o;o=t.containers[n].indexOf(e),t.containers[n].splice(o,1),t.containersCtx[n].splice(o,1),-1<(o=ve.indexOf(e))&&ve.splice(o,1)})})})}function se(e){e=N(e)?e:c(e),e.forEach(function(e,n){angular.forEach(pe.nameSpace,function(o){t.containers[o].push(e),t.containersCtx[o].push({o:pe,m:ee(pe)[n],fm:pe.containersFilteredModel[n]}),ve.push(e)})})}function de(e){if(t.target){e.originalEvent&&(e=e.originalEvent);var n=t.target.scrollTop;t.target.scrollTop+=e.deltaY,n!==t.target.scrollTop&&(e.stopPropagation(),e.preventDefault())}}function me(){t.mirror&&(y(B.body,pe.classes.unselectable),r(k,"off","mousemove",H),r(t.mirror,"off","wheel",de),$(t.mirror)&&t.mirror.parentNode.removeChild(t.mirror),t.mirror=null)}function ue(e){i(e,!0,pe.scope)}var pe,ve=o||[],ge=m||{},he=E,fe={mirror:"gu-mirror",hide:"gu-hide",unselectable:"gu-unselectable",transit:"gu-transit"},be={dragularenter:"dragularenter",dragularleave:"dragularleave",dragularrelease:"dragularrelease",dragularcloned:"dragularcloned",dragulardrag:"dragulardrag",dragularcancel:"dragularcancel",dragulardrop:"dragulardrop",dragularremove:"dragularremove",dragulardragend:"dragulardragend",dragularshadow:"dragularshadow",dragularover:"dragularover",dragularout:"dragularout"},xe={copyOptions:!1,classes:fe,eventNames:be,containers:!1,containersModel:!1,containersFilteredModel:!1,isContainer:l,isContainerModel:g,isContainerAccepts:a,moves:a,accepts:a,canBeAccepted:a,copy:!1,copySortSource:!1,dontCopyModel:!1,invalid:l,revertOnSpill:!1,removeOnSpill:!1,lockX:!1,lockY:!1,boundingBox:!1,mirrorContainer:B.body,ignoreInputTextSelection:!0,compileItemOnDrop:!1,onInit:!1},ye={containers:t.containers,containersCtx:t.containersCtx,sanitizeContainersModel:ue,sanitizeContainers:i,addContainers:se,removeContainers:ce,isContainer:K,start:L,end:X,cancel:te,remove:re,destroy:ae,dragging:!1};return b(),I(),M(),O(),pe.onInit&&pe.onInit(ye,pe),ye}function i(e,n,t){if(R(e))return e;if(N(e))return n?N(e[0])?e:[e]:e;if("string"==typeof e&&t){var o=t.$eval(e);return R(o)?o:function(){return t.$eval(e)}}return e?c(e):[]}function r(e,n,t,o){var i={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},r={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},l={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"},a=angular.element(e);if(e.addEventListener){var c={on:"addEventListener",off:"removeEventListener"};e[c[n]](t,o,{passive:!1}),e[c[n]](i[t],o,{passive:!1})}else"undefined"!=typeof navigator&&navigator.pointerEnabled&&r[t]?a[n](r[t],o):"undefined"!=typeof navigator&&navigator.msPointerEnabled&&l[t]?a[n](l[t],o):i[t]&&a[n](i[t],o),a[n](t,o)}function l(){return!1}function a(){return!0}function c(e,n){return N(e)?e:e.length?Array.prototype.slice.call(e,n):[e]}function s(e){if(e.touches)return e.touches.length;if(e.originalEvent&&e.originalEvent.touches)return e.originalEvent.touches.length;if(void 0!==e.which&&0!==e.which)return e.which;if(void 0!==e.buttons)return e.buttons;var n=e.button;return void 0!==n?1&n?1:2&n?3:4&n?2:0:void 0}function d(e){e.originalEvent&&(e=e.originalEvent),t.grabbed&&e.preventDefault()}function m(e,n){return"undefined"!=typeof window[n]?window[n]:k.clientHeight?k[e]:B.body[e]}function u(e){var n=e.getBoundingClientRect(),t=m("scrollTop","pageYOffset"),o=m("scrollLeft","pageXOffset");return{left:n.left+o,right:n.right+o,top:n.top+t,bottom:n.bottom+t}}function p(e){return e.width||e.right-e.left}function v(e){return e.height||e.bottom-e.top}function g(){return[]}function h(e){function n(){var n=e;do n=n.nextSibling;while(n&&1!==n.nodeType);return n}if(e)return e.nextElementSibling||n()}function f(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName}function b(e){var n=t.classesCache[e];return n?n.lastIndex=0:t.classesCache[e]=n=new RegExp("(?:^|\\s)"+e+"(?:\\s|$)","g"),n}function x(e,n){var t=e.className;t.length?b(n).test(t)||(e.className+=" "+n):e.className=n}function y(e,n){e.className=e.className.replace(b(n)," ").trim()}function I(e){return e.targetTouches&&e.targetTouches.length?e.targetTouches[0]:e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e}function w(e,n){var t=I(n),o={pageX:"clientX",pageY:"clientY"};return e in o&&!(e in t)&&o[e]in t&&(e=o[e]),!t.type||t.type.indexOf("touch")<0?t[e]:t.type.indexOf("end")===-1&&t.originalEvent.touches[0][e.replace("client","page")]}function $(e){return e.parentNode===document?null:e.parentNode}function S(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName||"SELECT"===e.tagName||M(e)}function M(e){return!!e&&("false"!==e.contentEditable&&("true"===e.contentEditable||M($(e))))}function C(e,n){return Array.prototype.indexOf.call(angular.element(n).children(),e)}function q(e,n,o){e&&(t.extra=o,e.dispatchEvent?e.dispatchEvent(n):e.fireEvent("on"+n.eventType,n))}function E(e,n,o){return R(e)?!!e.apply(o||this,n||t):!!e}var B=document,k=B.documentElement,N=Array.isArray,R=angular.isFunction;return o.cleanEnviroment=function(){t.classesCache={},t.containersCtx={},t.containers={},t.mirror=void 0},o.shared=t,o};o.$inject=["$rootScope","$compile"],e.exports=o},function(e,n){"use strict";var t=function(e,n){n.otherwise("/home");var t,o=function(e,n,o){n.link?o.cancel(t):t=o(function(){e.go("docs.detail",{link:"docsInstall"})},0)};o.$inject=["$state","$stateParams","$timeout"],e.state("home",{url:"/home",templateUrl:"partials/partial-home.html"}).state("docs",{url:"/docs",templateUrl:"partials/partial-docs.html",controller:o}).state("docs.detail",{url:"/:link",templateUrl:function(e){return e.link+"/"+e.link+".html"},controller:o}).state("contribute",{url:"/contribute",templateUrl:"partials/partial-contribute.html"})};t.$inject=["$stateProvider","$urlRouterProvider"],e.exports=t},function(e,n){"use strict";var t=function(e,n){n.cleanEnviroment(),n(".containerVertical")};t.$inject=["$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e,n,t){e.items1=[{content:"Move me, but you can only drop me in one of these containers."},{content:"If you try to drop me somewhere other than these containers, I'll just come back."},{content:"Item 3"},{content:"Item 4"}],e.items2=[{content:"Item 5"},{content:"Item 6"},{content:"Item 7"},{content:"Item 8"}];var o=n.children().eq(0).children();t.cleanEnviroment(),t([o[0],o[1]],{containersModel:[e.items1,e.items2]})};t.$inject=["$scope","$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e,n){var t=e[0];n.cleanEnviroment(),n(e.children(),{boundingBox:t})};t.$inject=["$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e,n){var t=e.children().children()[0];n.cleanEnviroment(),n(t,{boundingBox:t,lockX:!0})};t.$inject=["$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e,n){var t=e.children().children()[0];n.cleanEnviroment(),n(t,{boundingBox:t,lockY:!0})};t.$inject=["$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e,n){n.cleanEnviroment(),n(e.children(),{copy:!0})};t.$inject=["$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e,n,t){e.items1=[{content:"Move me, and make copy on drop."},{content:"If you try to drop me somewhere other than these containers, I'll just come back."},{content:"Item 3"},{content:"Item 4"}],e.items2=[{content:"Item 5"},{content:"Item 6"},{content:"Item 7"},{content:"Item 8"}];var o=n.children().eq(0).children();t.cleanEnviroment(),t([o[0],o[1]],{containersModel:[e.items1,e.items2],copy:!0})};t.$inject=["$scope","$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e,n){n.cleanEnviroment(),n(e.children(),{classes:{mirror:"custom-green-mirror"}})};t.$inject=["$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e,n,t){function o(e,n,t){if(t===i||t===n)return!0}e.items1=[{content:"Move me, but you can only drop me in one of these containers."},{content:"If you try to drop me somewhere other than these containers, I'll just come back."},{content:"Item 3"},{content:"Item 4"}],e.items2=[{content:"Item 5"},{content:"Item 6"},{content:"Item 7"},{content:"Item 8"}];var i=document.querySelector("#containerLeft"),r=document.querySelector("#containerRight");t.cleanEnviroment(),t([i],{containersModel:[e.items1],copy:!0,copySortSource:!0,accepts:o}),t([r],{containersModel:[e.items2],removeOnSpill:!0,accepts:o})};t.$inject=["$scope","$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e){e.dragularOptions={classes:{mirror:"custom-green-mirror"},nameSpace:"same"}};t.$inject=["$scope"],e.exports=t},function(e,n){"use strict";var t=function(e){e.items1=[{content:"Move me, and make copy on drop."},{content:"If you try to drop me somewhere other than these containers, I'll just come back."},{content:"Item 3"},{content:"Item 4"}],e.items2=[{content:"Item 5"},{content:"Item 6"},{content:"Item 7"},{content:"Item 8"}],e.dragularOptions={containersModel:e.items1,classes:{mirror:"custom-green-mirror"},nameSpace:"common"}};t.$inject=["$scope"],e.exports=t},function(e,n){"use strict";var t=function(e,n){function t(e){e.on("dragularenter",function(t){e[0]===t.target&&e.addClass(n.shared.extra?"gu-over-accept":"gu-over-decline")}),e.on("dragularleave dragularrelease",function(t){(e[0]===t.target&&n.shared.extra&&n.shared.extra.parentElement!==t.target||"dragularrelease"===t.type)&&(e.removeClass("gu-over-accept"),e.removeClass("gu-over-decline"))})}n.cleanEnviroment(),n([e.children()[0],e.children()[2]],{nameSpace:"apples"}),n([e.children()[1],e.children()[3]],{nameSpace:"oranges"}),angular.forEach(e.children(),function(e){t(angular.element(e))});var o=angular.element(document.getElementsByClassName("notContainer"));o.on("dragularenter",function(){o.addClass("gu-over")}),o.on("dragularleave dragularrelease",function(){o.removeClass("gu-over")})};t.$inject=["$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e,n,t,o){function i(e){return function(){}}t.cleanEnviroment();t(n.children(),{scope:e});e.$on("dragulardrag",function(e,n){e.stopPropagation(),n.className=n.className.replace(" ex-moved","")}),e.$on("dragulardrop",function(e,n){e.stopPropagation(),o(function(){n.className+=" ex-moved"},0)}),e.$on("dragularcloned",i("cloned in EventsCtrl")),e.$on("dragulardrag",i("drag in EventsCtrl")),e.$on("dragularcancel",i("cancel in EventsCtrl")),e.$on("dragulardrop",i("drop in EventsCtrl")),e.$on("dragularremove",i("remove in EventsCtrl")),e.$on("dragulardragend",i("dragend in EventsCtrl")),e.$on("dragularshadow",i("shadow in EventsCtrl"))},o=function(e,n,t,o){function i(e){return function(){}}t(n.children(),{scope:e});e.$on("dragulardrag",function(e,n){e.stopPropagation(),n.className=n.className.replace(" ex-moved","")}),e.$on("dragulardrop",function(e,n){e.stopPropagation(),o(function(){n.className+=" ex-moved"},0)}),e.$on("dragularcloned",i("cloned in Events2Ctrl")),e.$on("dragulardrag",i("drag in Events2Ctrl")),e.$on("dragularcancel",i("cancel in Events2Ctrl")),e.$on("dragulardrop",i("drop in Events2Ctrl")),e.$on("dragularremove",i("remove in Events2Ctrl")),e.$on("dragulardragend",i("dragend in Events2Ctrl")),e.$on("dragularshadow",i("shadow in Events2Ctrl"))};t.$inject=["$scope","$element","dragularService","$timeout"],o.$inject=["$scope","$element","dragularService","$timeout"],e.exports=[t,o]},function(e,n){"use strict";var t=function(e,n){n.cleanEnviroment(),n(e.children(),{moves:function(e,n,t){return t.classList.contains("handle")}})};t.$inject=["$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e,n,t){e.items1=[{content:"Move me, but you can only drop me in one of these containers."},{content:"If you try to drop me somewhere other than these containers, I'll just come back."},{content:"Item 3"},{content:"Item 4"}],e.cartModel=[];var o=document.querySelector("#containerLeft");t.cleanEnviroment(),t([o],{containersModel:[e.items1],copy:!0,isContainer:function(e){return"cart"===e.id},isContainerModel:function(){return e.cartModel}}),e.removeItem=function(){var n=e.cartModel.indexOf(this.item);e.cartModel.splice(n,1)}};t.$inject=["$scope","$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e,n){n.cleanEnviroment(),n([e.children()[0],e.children()[2]],{nameSpace:"apples"}),n(e.children()[1],{nameSpace:"oranges"}),n(e.children()[3],{nameSpace:["oranges","apples"]})};t.$inject=["$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e,n,t,o){e(function(){o.cleanEnviroment(),o(t,{nameSpace:"rows",moves:function(e,n,t){return t.classList.contains("row-handle")}}),o(t.children(),{nameSpace:"cells",moves:function(e,n,t){return!t.classList.contains("row-handle")}})},0),n.items=[{items:[{content:"Item a1"},{content:"Item a2"},{content:"Item a3"},{content:"Item a4"}]},{items:[{content:"Item b1"},{content:"Item b2"},{content:"Item b3"},{content:"Item b4"}]},{items:[{content:"Item c1"},{content:"Item c2"},{content:"Item c3"},{content:"Item c4"}]}]};t.$inject=["$timeout","$scope","$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e,n,t,o){e(function(){var e=t.children().eq(0).children(),i=e.children(),r=[];o.cleanEnviroment(),o(e,{moves:function(e,n,t){return t.classList.contains("row-handle")},containersModel:n.items,nameSpace:"rows"});for(var l=0;l
{{subitem.points}}. {{subitem.text}}
',controller:"QuestionsController",scope:{question:"="}}}function i(e,n,t){n(t.children(".all-data"),{containersModel:"question",scope:e,nameSpace:"subitem",moves:function(e,n,t){return t.classList.contains("subitem")}}),e.$on("dragulardrop",function(){e.question.forEach(function(e,n){e.points=n+1})})}t.$inject=["dragularService","$element","$scope","$timeout"],angular.module("examplesApp").directive("questionDirective",o).controller("QuestionsController",i),e.exports=t},function(e,n){"use strict";e.exports=angular.module("templates",[]).run(["$templateCache",function(e){e.put("docsInstall/docsInstall.html","

Install

\n

download dragular.js and dragular.css from dist folder

\n

OR clone git

\n
\ngit clone http://github.com/luckylooke/dragular.git\n
\n

OR use npm

\n
\n[sudo] npm install dragular\n
\n

OR use bower

\n
\nbower install dragular\n
\n

AND include files into your project

\n
\n<link href='styles/dragular.css' rel='stylesheet' type='text/css' />\n<script src='scripts/dragular.js'></script>\n
\n

AND put dragularModule into dependency array

\n
\nvar app = angular.module('myApp', ['dragularModule', 'otherDependencies']);\n
\n

DONE :)

\n"),e.put("exampleBasic/exampleBasic.html","
\n

Basic

\n \n
\n
\n
Move me, but you can only drop me in one of these containers.
\n
If you try to drop me somewhere other than these containers, I'll just come back.
\n
Item 3.
\n
Item 6.
\n
\n
\n
You can drop me in the left container, otherwise I'll stay here.
\n
Try to click me, dragular distinguish drag from click
\n
Item 5.
\n
\n
\n
\n        \n// JS\n  controller('Basic', ['$element', 'dragularService', function TodoCtrl($element, dragularService) {\n    dragularService('.containerVertical');\n  }])\n        \n        \n// CSS\n.clickedClass {\n  background-color: orange !important;\n}\n        \n        \n<!-- HTML -->\n  <div class='wrapper' ng-controller="Basic">\n    <div class='containerVertical'>\n        <div>Move me, but you can only drop me in one of these containers.</div>\n        <div>If you try to drop me somewhere other than these containers, I'll just come back.</div>\n        <div>Item 3.</div>\n        <div>Item 6.</div>\n    </div>\n    <div class='containerVertical'>\n        <div>You can drop me in the left container, otherwise I'll stay here.</div>\n        <div ng-click=\"clicked = !clicked\" ng-class=\"clicked && 'clickedClass'\">Try to click me, dragular distinguish drag from click</div>\n        <div>Item 5.</div>\n    </div>\n</div>\n        \n      
\n
\n"),e.put("exampleBasicWithModel/exampleBasicWithModel.html","
\n

Basic - with model

\n \n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n          
{{items1 | json}}
\n
\n
\n
Items2:\n          
{{items2 | json}}
\n
\n
\n
\n
\n        \n// JS\n  controller('BasicModel', ['$scope', '$element', 'dragularService', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items1 = [{\n      content: 'Move me, but you can only drop me in one of these containers.'\n    }, {\n      content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n    }, {\n      content: 'Item 3'\n    }, {\n      content: 'Item 4'\n    }];\n    $scope.items2 = [{\n      content: 'Item 5'\n    }, {\n      content: 'Item 6'\n    }, {\n      content: 'Item 7'\n    }, {\n      content: 'Item 8'\n    }];\n    var containers = $element.children().children();\n    dragularService([containers[0],containers[1]],{\n      containersModel: [$scope.items1, $scope.items2]\n    });\n  }])\n        \n        \n<!-- HTML -->\n<div class='wrapper' ng-controller="Basic">\n    <div class='tableRow'>\n        <div class='containerVertical'>\n            <div ng-repeat="item in items1">{{item.content}}</div>\n        </div>\n        <div class='containerVertical'>\n            <div ng-repeat="item in items2">{{item.content}}</div>\n        </div>\n    </div>\n    <div class="tableRow">\n        <div class="container">\n            <div>Items1:\n                <br/>{{items1 | json}}</div>\n        </div>\n        <div class="container">\n            <div>Items2:\n                <br/>{{items2 | json}}</div>\n        </div>\n    </div>\n</div>\n        \n      
\n
\n"),e.put("exampleBoundingBox/exampleBoundingBox.html","
\n

BoundingBox

\n \n
\n
\n
This items cannot cross its example element, just try it your selves.
\n
Item 2.
\n
Item 3.
\n
Item 6.
\n
\n
\n
This items cannot cross its example element, just try it your selves.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n        \n  dragularService([$element.children(), {\n    boundingBox: $element\n  });\n        \n      
\n
"),e.put("exampleBoundingBoxLockY/exampleBoundingBoxLockY.html","
\n

BoundingBox and LockY

\n \n
\n
\n
\n
Items are locked in Y axis movement and cannot cross its closest parent div.boundingBox, just try it your selves.
\n
item 2
\n
item 3
\n
item 4
\n
item 5
\n
item 6
\n
\n
\n
\n
\n        \n  dragularService([$element.children()[0].children(), {\n    boundingBox: $element.children()[0],\n    lockY: true\n  });\n        \n      
\n
"),e.put("exampleBoundingBoxLockX/exampleBoundingBoxLockX.html",'
\n

BoundingBox and lockX

\n \n
\n
\n
\n
Items are locked in X axis movement and cannot cross its closest parent div.boundingBox, just try it your selves.
\n
item 2
\n
item 3
\n
item 4
\n
\n
\n
\n
\n        \n  dragularService([$element.children()[0].children(), {\n    boundingBox: $element.children()[0],\n    lockX: true\n  });\n        \n      
\n
'),e.put("exampleCopy/exampleCopy.html","
\n

Copy

\n \n
\n
\n
Move me, and make copy on drop.
\n
If you try to drop me somewhere other than these containers, I'll just come back.
\n
\n
\n
You can drop me in the left container, otherwise I'll stay here.
\n
\n
\n
\n        \n// JS\n  controller('Copy', ['$element', 'dragularService', function TodoCtrl($element, dragularService) {\n    dragularService($element.children(), {\n      copy: true\n    });\n  }])\n        \n        \n<!-- HTML -->\n<div class='wrapper' ng-controller="Copy" ng-hide="globals.showModelExamples">\n    <div id='left2' class='containerVertical'>\n      <div>Move me, and make copy on drop.</div>\n      <div>If you try to drop me somewhere other than these containers, I'll just come back.</div>\n    </div>\n    <div id='right2' class='containerVertical'>\n      <div>You can drop me in the left container, otherwise I'll stay here.</div>\n    </div>\n  </div>\n        \n      
\n
\n"),e.put("exampleCopyWithModel/exampleCopyWithModel.html","
\n

Copy - with model

\n \n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n
\n            {{ items1 | json }}\n          
\n
\n
\n
\n
Items2:\n
\n            {{ items2 | json }}\n          
\n
\n
\n
\n
\n
\n        \n// JS\n  controller('CopyModel', ['$scope', '$element', 'dragularService', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items1 = [{\n      content: 'Move me, and make copy on drop.'\n    }, {\n      content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n    }, {\n      content: 'Item 3'\n    }, {\n      content: 'Item 4'\n    }];\n    $scope.items2 = [{\n      content: 'Item 5'\n    }, {\n      content: 'Item 6'\n    }, {\n      content: 'Item 7'\n    }, {\n      content: 'Item 8'\n    }];\n    var containers = $element.children().children();\n    dragularService([containers[0],containers[1]],{\n      containersModel: [$scope.items1, $scope.items2],\n      copy: true\n    });\n  }])\n        \n        \n<!-- HTML -->\n<div class='wrapper' ng-controller="CopyModel" ng-show="globals.showModelExamples">\n    <div class='tableRow'>\n      <div class='containerVertical'>\n        <div ng-repeat="item in items1">{{item.content}}</div>\n      </div>\n      <div class='containerVertical'>\n        <div ng-repeat="item in items2">{{item.content}}</div>\n      </div>\n    </div>\n    <div class="tableRow">\n      <div class="container">\n        <div>Items1:\n          <br/>{{items1 | json}}</div>\n      </div>\n      <div class="container">\n        <div>Items2:\n          <br/>{{items2 | json}}</div>\n      </div>\n    </div>\n  </div>\n        \n      
\n
\n"),e.put("exampleCustomClasses/exampleCustomClasses.html","
\n

Custom classes

\n \n
\n
\n
Move me, but you can only drop me in one of these containers.
\n
If you try to drop me somewhere other than these containers, I'll just come back.
\n
Item 3.
\n
Item 6.
\n
\n
\n
You can drop me in the left container, otherwise I'll stay here.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n        \n  dragularService([document.getElementById(left), document.getElementById(right)], { classes: {\n    mirror: 'custom-green-mirror'\n  } });\n\n  // Default classes are:\n  option.classes = {\n    mirror: 'gu-mirror',\n    hide: 'gu-hide',\n    unselectable: 'gu-unselectable',\n    transit: 'gu-transit',\n    overActive: 'gu-over-active',\n    overAccepts: 'gu-over-accept',\n    overDeclines: 'gu-over-decline'\n  };\n        \n      
\n
\n"),e.put("exampleDifferentOptionsWithModel/exampleDifferentOptionsWithModel.html","
\n

Different options - with model

\n \n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n          
{{items1 | json}}
\n
\n
\n
Items2:\n          
{{items2 | json}}
\n
\n
\n
\n
\n        \n// JS\n  .controller('DifferentOptionsModel', ['$scope', '$element', 'dragularService', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items1 = [{\n      content: 'Move me, but you can only drop me in one of these containers.'\n    }, {\n      content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n    }, {\n      content: 'Item 3'\n    }, {\n      content: 'Item 4'\n    }];\n    $scope.items2 = [{\n      content: 'Item 5'\n    }, {\n      content: 'Item 6'\n    }, {\n      content: 'Item 7'\n    }, {\n      content: 'Item 8'\n    }];\n\n    var containerLeft = document.querySelector('#containerLeft'),\n      containerRight = document.querySelector('#containerRight');\n\n    function accepts(el, target, source) {\n      if (source === containerLeft || source === target) {\n        return true;\n      }\n    }\n\n    dragularService([containerLeft], {\n      containersModel: [$scope.items1],\n      copy: true,\n      //move only from left to right  \n      accepts: accepts\n    });\n\n    dragularService([containerRight], {\n      containersModel: [$scope.items2],\n      removeOnSpill: true,\n      //move only from left to right  \n      accepts: accepts\n    });\n\n  }])\n        \n        \n<!-- HTML -->\n<div class='wrapper' ng-controller="DifferentOptionsModel">\n    <div class='tableRow'>\n      <div id="containerLeft" class='containerVertical'>\n        <div ng-repeat="item in items1">{{item.content}}</div>\n      </div>\n      <div id="containerRight" class='containerVertical'>\n        <div ng-repeat="item in items2">{{item.content}}</div>\n      </div>\n    </div>\n    <div class="tableRow">\n      <div class='containerVertical'>\n        <pre>Items1:\n          <br/>{{items1 | json}}</pre>\n      </div>\n      <div class='containerVertical'>\n        <pre>Items2:\n          <br/>{{items2 | json}}</pre>\n      </div>\n    </div>\n  </div>\n        \n      
\n
\n"),e.put("exampleDirective/exampleDirective.html","
\n

Directive

\n \n
\n
\n
Move me, but you can only drop me in one of these containers.
\n
If you try to drop me somewhere other than these containers, I'll just come back.
\n
Item 3.
\n
Item 6.
\n
\n
\n
You can drop me in the left container, otherwise I'll stay here.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n        \n// JS\n  controller('Directive', ['$scope', 'dragularService', function TodoCtrl($scope) {\n    $scope.dragularOptions = {\n      classes: {\n        mirror: 'custom-green-mirror'\n      },\n      nameSpace: 'common' // just connecting left and right container\n    };\n  }])\n        \n        \n<!-- HTML -->\n<div class='wrapper' ng-controller="Directive">\n    <div class='containerVertical' dragular="dragularOptions">\n      <div>Move me, but you can only drop me in one of these containers.</div>\n      <div>If you try to drop me somewhere other than these containers, I'll just come back.</div>\n      <div>Item 3.</div>\n      <div>Item 6.</div>\n    </div>\n    <div class='containerVertical' dragular='{"classes":{"mirror":"custom-green-mirror"},"nameSpace":"same"}'>\n      <div>You can drop me in the left container, otherwise I'll stay here.</div>\n      <div>Item 4.</div>\n      <div>Item 5.</div>\n    </div>\n  </div>\n        \n      
\n
\n"),e.put("exampleDirectiveWithModel/exampleDirectiveWithModel.html","
\n

Directive - with model

\n \n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n
{{items1 | json}}
\n
\n
\n
Items2:\n
{{items2 | json}}
\n
\n
\n
\n
\n       \n        \n// JS\n  controller('DirectiveModel', ['$scope', function TodoCtrl($scope) {\n    $scope.items1 = [{\n      content: 'Move me, and make copy on drop.'\n    }, {\n      content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n    }, {\n      content: 'Item 3'\n    }, {\n      content: 'Item 4'\n    }];\n    $scope.items2 = [{\n      content: 'Item 5'\n    }, {\n      content: 'Item 6'\n    }, {\n      content: 'Item 7'\n    }, {\n      content: 'Item 8'\n    }];\n    $scope.dragularOptions = {\n      containersModel: $scope.items1,\n      classes: {\n        mirror: 'custom-green-mirror'\n      },\n      nameSpace: 'common' // just connecting left and right container\n    };\n  }])\n        \n        \n<!-- HTML -->\n <div class='wrapper' ng-controller="DirectiveModel">\n  <div class='containerVertical' dragular="dragularOptions">\n    <div ng-repeat="item in items1">{{item.content}}</div>\n  </div>\n  <div class='containerVertical' dragular='{"containersModel":"items2","classes":{"mirror":"custom-green-mirror"},"nameSpace":"common"}'>\n    <div ng-repeat="item in items2">{{item.content}}</div>\n  </div>\n</div>\n        \n      
\n
\n"),e.put("exampleDragOverEvents/exampleDragOverEvents.html","
\n

Drag-over events

\n

You can interact with dragging element by litening to dragOver events. Usually you want to containers show wheather they accepts element or not, but you can use it anywhere. DragOver events are: dragenter, dragleave and dragrelease. On dragOver events dragularService reveals several useful properties.

\n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
dragularService.shared.itemitem beeing dragged (it is copy of item if copy is enabled via options)
dragularService.shared.sourcesource container item is dragged from
dragularService.shared.sourceModelsource container model representation if model was porvided
dragularService.shared.initialIndexoriginal index of item, can be used to get item model from sourceModel
dragularService.shared.extracontains accepting information (boolean) on dragenter, element drag is leaving to on dragleave and element behind the cursor on dragrelease
\n
\n\n

Try to drag over the not-container too.

\n
\n
\n
apples and oranges cannot be mixed
\n
apple 2
\n
apple 3
\n
apple 4
\n
\n
\n
orange 1
\n
orange 2
\n
orange 3
\n
orange 4
\n
\n
\n
apple 5
\n
apple 6
\n
apple 7
\n
apple 8
\n
\n
\n
orange 5
\n
orange 6
\n
orange 7
\n
orange 8
\n
\n
\n
Test active class on NOT container.
\n\n
\n    \n<!-- HTML -->\n  <div class='wrapper' ng-controller="DragOverEvents">\n    <div class='container width25'>\n      <div>apples and oranges cannot be mixed</div>\n      <div>apple 2</div>\n      ...\n    </div>\n    <div class='container width25'>\n      <div>orange 1</div>\n      <div>orange 2</div>\n      ...\n    </div>\n    <div class='container width25'>\n      <div>apple 5</div>\n      <div>apple 6</div>\n      ...\n    </div>\n    <div class='container width25'>\n      <div>orange 5</div>\n      <div>orange 6</div>\n      ...\n    </div>\n  </div>\n  <div class="notContainer"> Test active class on NOT container.</div>\n    \n  
\n\n
\n    \n  // CSS\n  \n.notContainer.gu-over {\n  background-color: yellow;\n}\n\n.containerVertical.gu-over-accept {\n  background-color: green;\n}\n\n.containerVertical.gu-over-decline {\n  background-color: red;\n}\n    \n  
\n\n
\n    \n  // JS\n  controller('DragOverEvents', ['$element', 'dragularService', function TodoCtrl($element, dragularService) {\n    dragularService.cleanEnviroment();\n    dragularService([$element.children()[0], $element.children()[2]], {\n      nameSpace: 'apples'\n    });\n    dragularService([$element.children()[1], $element.children()[3]], {\n      nameSpace: 'oranges'\n    });\n\n    // containers events handling\n    function registerEvents(el) {\n      el.on('dragularenter', function(e) {\n        if (el[0] === e.target) { // filter bubbled\n          el.addClass(dragularService.shared.extra ? 'gu-over-accept' : 'gu-over-decline');\n        }\n      });\n      el.on('dragularleave dragularrelease', function(e) {\n        if ((el[0] === e.target && // filter bubbled\n          dragularService.shared.extra && // extra on dragleave contains element the drag is leaving to\n          dragularService.shared.extra.parentElement !== e.target) // is that element child of this container?\n          || e.type === 'dragularrelease') {\n          el.removeClass('gu-over-accept');\n          el.removeClass('gu-over-decline');\n        }\n      });\n    }\n\n    angular.forEach($element.children(), function forEachChild(el) {\n      registerEvents(angular.element(el));\n    });\n\n    // notContainer events handling\n    var notContainer = angular.element(document.getElementsByClassName('notContainer'));\n    notContainer.on('dragularenter', function() {\n      notContainer.addClass('gu-over');\n    });\n    notContainer.on('dragularleave dragularrelease', function() {\n      notContainer.removeClass('gu-over');\n    });\n  }])\n    \n  
\n
\n"),e.put("exampleEvents/exampleEvents.html","
\n

Events

\n

Events affecting more than on cotrollers are emitted on both scopes if provided.

\n

EventsCtrl

\n
\n
\n
Move me, but you can only drop me in one of these containers.
\n
If you try to drop me somewhere other than these containers, I'll just come back.
\n
Item 3.
\n
Item 6.
\n
\n
\n
You can drop me in the left container, otherwise I'll stay here.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n

Events2Ctrl

\n
\n
\n
Move me, but you can only drop me in one of these containers.
\n
If you try to drop me somewhere other than these containers, I'll just come back.
\n
Item 3.
\n
Item 6.
\n
\n
\n
You can drop me in the left container, otherwise I'll stay here.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n        \nvar EventsCtrl = function ($scope, $element, dragularService, $timeout) {\n  \n  var drake = dragularService($element.children(), {\n    scope: $scope\n  });\n  $scope.$on('dragulardrag', function(e, el) {\n    e.stopPropagation();\n    el.className = el.className.replace(' ex-moved', '');\n  });\n  $scope.$on('dragulardrop', function(e, el) {\n    e.stopPropagation();\n    $timeout(function() {\n      el.className += ' ex-moved';\n    }, 0);\n  });\n\n  $scope.$on('dragularcloned', myFn('cloned in EventsCtrl'));\n  $scope.$on('dragulardrag', myFn('drag in EventsCtrl'));\n  $scope.$on('dragularcancel', myFn('cancel in EventsCtrl'));\n  $scope.$on('dragulardrop', myFn('drop in EventsCtrl'));\n  $scope.$on('dragularremove', myFn('remove in EventsCtrl'));\n  $scope.$on('dragulardragend', myFn('dragend in EventsCtrl'));\n  $scope.$on('dragularshadow', myFn('shadow in EventsCtrl'));\n\n  function myFn(eventName) {\n    return function() {\n      console.log(eventName, arguments, drake);\n    };\n  }\n};\n\nvar Events2Ctrl = function ($scope, $element, dragularService, $timeout) {\n  var drake = dragularService($element.children(), {\n    scope: $scope\n  });\n  $scope.$on('dragulardrag', function(e, el) {\n    e.stopPropagation();\n    el.className = el.className.replace(' ex-moved', '');\n  });\n  $scope.$on('dragulardrop', function(e, el) {\n    e.stopPropagation();\n    $timeout(function() {\n      el.className += ' ex-moved';\n    }, 0);\n  });\n\n  $scope.$on('dragularcloned', myFn('cloned in Events2Ctrl'));\n  $scope.$on('dragulardrag', myFn('drag in Events2Ctrl'));\n  $scope.$on('dragularcancel', myFn('cancel in Events2Ctrl'));\n  $scope.$on('dragulardrop', myFn('drop in Events2Ctrl'));\n  $scope.$on('dragularremove', myFn('remove in Events2Ctrl'));\n  $scope.$on('dragulardragend', myFn('dragend in Events2Ctrl'));\n  $scope.$on('dragularshadow', myFn('shadow in Events2Ctrl'));\n\n  function myFn(eventName) {\n    return function() {\n      console.log(eventName, arguments, drake);\n    };\n  }\n};\n        \n      
\n
\n"), -e.put("exampleHandle/exampleHandle.html","
\n

Handle

\n \n
\n
\n
+Move me, but you can use the plus sign to drag me around.
\n
\n
\n
\n
\n
\n        \n  dragularService([document.getElementById(left), document.getElementById(right)], {\n    moves: function (el, container, handle) {\n      return handle.className === 'handle';\n    }\n  });\n        \n      
\n
\n"),e.put("exampleIsContainerWithModel/exampleIsContainerWithModel.html","
\n

isContainer - with model

\n \n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}\n
\n
\n
\n
\n
\n
Items1:\n          
{{items1 | json}}
\n
\n
\n
Cart:\n          
{{cartModel | json}}
\n
\n
\n
\n
\n        \n// JS\n  .controller('IsContainerModel', ['$scope', '$element', 'dragularService', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items1 = [{\n      content: 'Move me, but you can only drop me in one of these containers.'\n    }, {\n      content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n    }, {\n      content: 'Item 3'\n    }, {\n      content: 'Item 4'\n    }];\n    $scope.cartModel = [];\n\n    var containerLeft = document.querySelector('#containerLeft');\n\n    dragularService.cleanEnviroment();\n    dragularService([containerLeft], {\n      containersModel: [$scope.items1],\n      copy: true,\n      isContainer: function isContainer (el) {\n        return el.id === 'cart';\n      },\n      isContainerModel: function getModel (){\n        return $scope.cartModel;\n      }\n    });\n\n    $scope.removeItem = function removeItem() {\n      var index = $scope.cartModel.indexOf(this.item);\n      $scope.cartModel.splice(index, 1);\n    };\n\n  }])\n        \n        \n<!-- HTML -->\n <div class='wrapper' ng-controller="IsContainerModel">\n    <div class='tableRow'>\n      <div id="containerLeft" class='containerVertical'>\n        <div ng-repeat="item in items1">{{item.content}}</div>\n      </div>\n      <div id="cart" class='containerVertical'>\n        <div class='cursorDefault' ng-repeat="item in cartModel">{{item.content}}\n        <button class='cursorDefault' ng-click="removeItem()">x</button></div>\n      </div>\n    </div>\n    <div class="tableRow">\n      <div class='containerVertical'>\n        <pre>Items1:\n          <br/>{{items1 | json}}</pre>\n      </div>\n      <div class='containerVertical'>\n        <pre>Cart:\n          <br/>{{cartModel | json}}</pre>\n      </div>\n    </div>\n  </div>\n        \n      
\n
\n"),e.put("exampleNameSpaces/exampleNameSpaces.html","
\n

NameSpaces

\n \n
\n
\n
try to mix oranges and apples
\n
apple 2
\n
apple 3
\n
apple 4
\n
\n
\n
orange 1
\n
orange 2
\n
orange 3
\n
orange 4
\n
\n
\n
apple 5
\n
apple 6
\n
apple 7
\n
apple 8
\n
\n
\n
mixed 1
\n
mixed 2
\n
mixed 3
\n
mixed 4
\n
\n
\n
\n      \ndragularService([$element.children()[0], $element.children()[2]], {\n  nameSpace: 'apples'\n});\ndragularService($element.children()[1], {\n  nameSpace: 'oranges'\n});\ndragularService($element.children()[3], { // mixed\n  nameSpace: ['oranges', 'apples']\n});\n      \n    
\n
"),e.put("exampleNestedNgRepeat/exampleNestedNgRepeat.html","
\n

Nested ngRepeat

\n \n
\n
\n
Row {{$index}}
\n
{{item.content}}
\n
\n
\n
\n        \n  // HTML\n\n  <div ng-controller="Example15">\n    <div ng-repeat="item in items" class='exampleRow'>\n      <div class="row-handle">Row {{$index}}</div>\n      <div ng-repeat="item in item.items" class="exampleCell">{{item.content}}</div>\n    </div>\n  </div>\n        \n      
\n
\n        \n  // CSS\n\n  .exampleRow {\n    display: flex;\n    flex-direction: row;\n  }\n\n  .exampleCell {\n    flex-grow: 1;\n  }\n\n  .exampleRow,\n  .exampleCell {\n    margin: 10px;\n    padding: 10px;\n    background-color: rgba(0, 0, 0, 0.2);\n    cursor: move;\n    cursor: grab;\n    cursor: -moz-grab;\n    cursor: -webkit-grab;\n  }\n        \n      
\n
\n        \n  // JS\n\n  .controller('NestedNgRepeat', ['$timeout', '$scope', '$element', 'dragularService', function NestedNgRepeatCtrl($timeout, $scope, $element, dragularService) {\n    $timeout(function() { // timeount due to ngRepeat to be ready\n      dragularService($element, {\n        nameSpace: 'rows',\n        moves: function rowOnly (el, container, handle) {\n          return handle.classList.contains('row-handle');\n        }\n      });\n      dragularService($element.children(), {\n        nameSpace: 'cells',\n        moves: function excludeHandle (el, container, handle) {\n          return !handle.classList.contains('row-handle');\n        }\n      });\n    }, 0);\n    $scope.items = [{\n      items: [{\n        content: 'Item a1'\n      }, {\n        content: 'Item a2'\n      }, {\n        content: 'Item a3'\n      }, {\n        content: 'Item a4'\n      }]\n    }, {\n      items: [{\n        content: 'Item b1'\n      }, {\n        content: 'Item b2'\n      }, {\n        content: 'Item b3'\n      }, {\n        content: 'Item b4'\n      }]\n    }, {\n      items: [{\n        content: 'Item c1'\n      }, {\n        content: 'Item c2'\n      }, {\n        content: 'Item c3'\n      }, {\n        content: 'Item c4'\n      }]\n    }];\n  }])\n        \n      
\n
\n"),e.put("exampleNestedNgRepeatWithModel/exampleNestedNgRepeatWithModel.html","
\n

Nested ngRepeat - with model

\n \n
\n
\n
\n
\n
Row {{::$index}}
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
\n
\n
\n            
Items:\n
{{items | json}}
\n
\n
\n
\n
\n
\n    \n<!-- HTML -->\n<div ng-controller="NestedNgRepeatWithModel">\n  <div class='containerVertical'>\n    <div ng-repeat="item in items" class='exampleRow'>\n      <div class="row-handle">Row {{::$index}}</div>\n      <div class="exampleRow exampleCell containerNested">\n        <div ng-repeat="item in item.items" class="exampleCell">{{item.content}}</div>\n      </div>\n    </div>\n  </div>\n</div>\n    \n  
\n
\n    \n  // CSS\n\n  .exampleRow {\n    display: flex;\n    flex-direction: row;\n  }\n\n  .exampleCell {\n    flex-grow: 1;\n  }\n\n  .exampleRow,\n  .exampleCell {\n    margin: 10px;\n    padding: 10px;\n    background-color: rgba(0, 0, 0, 0.2);\n    cursor: move;\n    cursor: grab;\n    cursor: -moz-grab;\n    cursor: -webkit-grab;\n  }\n    \n  
\n
\n    \n  // JS\n.controller('NestedNgRepeatWithModel', ['$timeout', '$scope', '$element', 'dragularService', function NestedNgRepeatWithModelCtrl($timeout, $scope, $element, dragularService) {\n    $timeout(function() { // timeount due to nested ngRepeat to be ready\n      var container = $element.children().eq(0).children(),\n        parentContainers = container.children(),\n        nestedContainers = [];\n\n      dragularService(container, {\n        moves: function(el, container, handle) {\n          return handle.classList.contains('row-handle');\n        },\n        containersModel: $scope.items,\n        nameSpace: 'rows'\n      });\n\n      // collect nested contianers\n      for (var i = 0; i < parentContainers.length; i++) {\n        nestedContainers.push(parentContainers.eq(i).children()[1]);\n      }\n\n      dragularService(nestedContainers, {\n        moves: function(el, container, handle) {\n          return !handle.classList.contains('row-handle');\n        },\n        containersModel: (function getNestedContainersModel(){\n          var parent = $scope.items,\n            containersModel = [];\n          for (var i = 0; i < parent.length; i++) {\n            containersModel.push(parent[i].items);\n          }\n          return containersModel;\n        })(),\n        nameSpace: 'cells'\n      });\n    }, 0);\n    $scope.items = [{\n      items: [{\n        content: 'Item a1'\n      }, {\n        content: 'Item a2'\n      }, {\n        content: 'Item a3'\n      }, {\n        content: 'Item a4'\n      }]\n    }, {\n      items: [{\n        content: 'Item b1'\n      }, {\n        content: 'Item b2'\n      }, {\n        content: 'Item b3'\n      }, {\n        content: 'Item b4'\n      }]\n    }, {\n      items: [{\n        content: 'Item c1'\n      }, {\n        content: 'Item c2'\n      }, {\n        content: 'Item c3'\n      }, {\n        content: 'Item c4'\n      }]\n    }];\n  }])\n    \n  
\n
\n"),e.put("exampleNestedRepeatsWithCustomDirective/exampleNestedRepeatsWithCustomDirective.html",'
\n
\n
\n {{item.order}}: ({{item.name}} + {{item.age}})\n
\n \n \n
\n
\n
\n
\n'),e.put("exampleNgRepeat/exampleNgRepeat.html","
\n

ngRepeat

\n \n
\n
\n
\n {{item.content}}\n
\n
\n
\n
\n        \n  // HTML:\n  <div class='containerVertical'>\n    <div ng-repeat="item in items">\n      {{item.content}}\n    </div>\n  </div>\n\n  // JS:\n  dragularService($element.children());\n  $scope.items = [{\n    content: 'Try to add or remove some elements (click on +- buttons), you will see that it is not problem for dragular.'\n  },{\n    content: 'Item 2'\n  },{\n    content: 'Item 3'\n  },{\n    content: 'Item 4'\n  }];\n        \n      
\n
\n"),e.put("exampleNgRepeatFilteredWithModel/exampleNgRepeatFilteredWithModel.html","
\n

Filtered ngRepeat - with model

\n

Move stuff between these two filtered containers. You can play with filter inputs to see that everything goes right.\n
\n Please notify the getFilteredModel function, it is necessery for not replacing the initial array object with new filtered one!

\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n          
{{items1 | json}}
\n
\n
\n
Items2:\n          
{{items2 | json}}
\n
\n
\n
\n
\n        \n// JS\n  .controller('NgRepeatFilteredWithModel', ['$scope', '$element', 'dragularService', '$filter', function TodoCtrl($scope, $element, dragularService, $filter) {\n    $scope.items1 = [{\n      content: 'Move me, but you can only drop me in one of these containers.'\n    }, {\n      content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n    }, {\n      content: 'Apple 3'\n    }, {\n      content: 'Orange 4'\n    }, {\n      content: 'Orange 5'\n    }, {\n      content: 'Apple 6'\n    }, {\n      content: 'Apple 7'\n    }, {\n      content: 'Apple 8'\n    }];\n    $scope.items2 = [{\n      content: 'Apple 9'\n    }, {\n      content: 'Orange 10'\n    }, {\n      content: 'Orange 11'\n    }, {\n      content: 'Apple 12'\n    }, {\n      content: 'Orange 13'\n    }, {\n      content: 'Apple 14'\n    }];\n    $scope.filter1query = 'Orange';\n    $scope.filter2query = 'Orange';\n    $scope.filteredModel1 = [];\n    $scope.filteredModel2 = [];\n    $scope.getFilteredModel = function (filteredModel, items, filterQuery) {\n      filteredModel.length = 0;\n      /*\n      * Following one-liner is same like:\n      *   var filteredModelTemp = $filter('filter')(items, filterQuery);\n      *   angular.forEach(filteredModelTemp, function(item){\n      *     filteredModel.push(item);\n      *   });\n      * Or like:\n      *   var filteredModelTemp = $filter('filter')(items, filterQuery);\n      *   for(var i; i < filteredModelTemp.length; i++){\n      *     filteredModel.push(filteredModelTemp[i]);\n      *   }\n      *\n      * You cannot just assign filtered array to filteredModel like this:\n      *   filteredModel = $filter('filter')(items, filterQuery);\n      * Because you would replace the array object you provide to dragular with new one.\n      * So dragular will continue to use the one it was provided on init.\n      * Hopefully I make it clear. :)\n       */\n      [].push.apply(filteredModel, $filter('filter')(items, filterQuery));\n      return filteredModel;\n    };\n    var containers = $element.children().eq(1).children();\n    dragularService.cleanEnviroment();\n    dragularService([containers[0],containers[1]],{\n      containersModel: [$scope.items1, $scope.items2],\n      containersFilteredModel: [$scope.filteredModel1, $scope.filteredModel2]\n    });\n  }]);\n\n        \n        \n<!-- HTML -->\n  <div class='wrapper' ng-controller="NgRepeatFilteredWithModel">\n    <div class="tableRow">\n      <div class='containerVertical'>\n        <input ng-model="filter1query" style="margin:10px 10px">\n      </div>\n      <div class='containerVertical'>\n        <input ng-model="filter2query" style="margin:10px 10px">\n      </div>\n    </div>\n    <div class='tableRow'>\n      <div class='containerVertical'>\n        <div ng-repeat="item in getFilteredModel(filteredModel1, items1, filter1query)">{{item.content}}</div>\n      </div>\n      <div class='containerVertical'>\n        <div ng-repeat="item in getFilteredModel(filteredModel2, items2, filter2query)">{{item.content}}</div>\n      </div>\n    </div>\n    <div class="tableRow">\n      <div class='containerVertical'>\n        <pre>Items1:\n          <br/>{{items1 | json}}</pre>\n      </div>\n      <div class='containerVertical'>\n        <pre>Items2:\n          <br/>{{items2 | json}}</pre>\n      </div>\n    </div>\n  </div>\n        \n      
\n
\n"),e.put("exampleNgRepeatWithModel/exampleNgRepeatWithModel.html","
\n

ngRepeat - with model

\n \n
\n
\n
\n
\n {{item.content}}\n \n \n
\n
\n
\n
\n
\n
Items:\n
{{items | json}}
\n
\n
\n
\n
\n    \n  // HTML:\n   <div class='wrapper' ng-controller="NgRepeatWithModel">\n      <div class='containerVertical'>\n        <div ng-repeat="item in items">\n          {{item.content}}\n          <button class='cursorDefault' ng-click="addItem()">+</button>\n          <button class='cursorDefault' ng-click="removeItem()">x</button>\n        </div>\n    </div>\n  </div>\n    \n  
\n
\n    \n  // JS:\n  controller('NgRepeatWithModel', ['$scope', '$element', 'dragularService', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items = [{\n      content: 'Try to add or remove some elements (click on +- buttons), you will see that it is not problem for dragular.'\n    }, {\n      content: 'Item 2'\n    }, {\n      content: 'Item 3'\n    }, {\n      content: 'Item 4'\n    }];\n    dragularService($element.children().eq(0).children(), {containersModel: $scope.items});\n    $scope.addItem = function addItem() {\n      var index = $scope.items.indexOf(this.item) + 1;\n      $scope.items.splice(index, 0, {\n        content: this.item.content + '-copy'\n      });\n    };\n    $scope.removeItem = function removeItem() {\n      var index = $scope.items.indexOf(this.item);\n      $scope.items.splice(index, 1);\n    };\n  }])\n    \n  
\n
\n"),e.put("exampleRemoveOnSpill/exampleRemoveOnSpill.html","
\n

Remove on spill

\n \n
\n
\n
Move me, but you can only drop me in containers.
\n
If you try to drop me somewhere other than containers, I'll die a fiery death.
\n
Item 3.
\n
Item 6.
\n
Item 4.
\n
Item 5.
\n
\n \n
\n
\n        \n  dragularService([document.getElementById(single)], { removeOnSpill: true });\n        \n      
\n
"),e.put("exampleRemoveOnSpillWithModel/exampleRemoveOnSpillWithModel.html","
\n

Remove on spill - with model

\n \n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n          
{{items1 | json}}
\n
\n
\n
Items2:\n          
{{items2 | json}}
\n
\n
\n
\n
\n        \n// JS\n  .controller('RemoveOnSpillWithModel', ['$scope', '$element', 'dragularService', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items1 = [{\n      content: 'Move me, but you can only drop me in containers.'\n    }, {\n      content: 'If you try to drop me somewhere other than containers, I\\'ll die a fiery death.'\n    }, {\n      content: 'Item 3'\n    }, {\n      content: 'Item 4'\n    }];\n    $scope.items2 = [{\n      content: 'You can drop me in the left container.'\n    }, {\n      content: 'Item 6'\n    }, {\n      content: 'Item 7'\n    }, {\n      content: 'Item 8'\n    }];\n    var containers = $element.children().eq(0).children();\n    dragularService.cleanEnviroment();\n    dragularService([containers[0],containers[1]],{\n      containersModel: [$scope.items1, $scope.items2],\n      removeOnSpill: true\n    });\n  }])\n        \n        \n<!-- HTML -->\n<div class='wrapper' ng-controller="Basic">\n    <div class='tableRow'>\n        <div class='containerVertical'>\n            <div ng-repeat="item in items1">{{item.content}}</div>\n        </div>\n        <div class='containerVertical'>\n            <div ng-repeat="item in items2">{{item.content}}</div>\n        </div>\n    </div>\n    <div class="tableRow">\n        <div class="container">\n            <div>Items1:\n                <br/>{{items1 | json}}</div>\n        </div>\n        <div class="container">\n            <div>Items2:\n                <br/>{{items2 | json}}</div>\n        </div>\n    </div>\n</div>\n        \n      
\n
\n"),e.put("exampleRevertOnSpill/exampleRevertOnSpill.html","
\n

Revert on spill

\n \n
\n
\n
Move me, but you can only drop me in one of these containers.
\n
If you try to drop me somewhere other than these containers, I'll just come back.
\n
Item 3.
\n
Item 6.
\n
\n
\n
You can drop me in the left container, otherwise I'll stay here.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n        \n  dragularService([document.getElementById(left), document.getElementById(right)], { revertOnSpill: true });\n        \n      
\n
"),e.put("exampleScrollingDrag/exampleScrollingDrag.html",'
\n

Scrolling drag

\n \n
\n
\n
up
\n
\n
Item 1.
\n
Item 2.
\n
Item 3.
\n
Item 4.
\n
Item 5.
\n
Item 6.
\n
Item 7.
\n
Item 9.
\n
Item 10.
\n
Item 11.
\n
Item 12.
\n
Item 13.
\n
\n
down
\n
\n
\n
\n
\n
Item 1.
\n
Item 2.
\n
Item 3.
\n
Item 4.
\n
Item 5.
\n
Item 6.
\n
Item 7.
\n
Item 9.
\n
Item 10.
\n
Item 11.
\n
Item 12.
\n
Item 13.
\n
\n
\n
\n
\n
\n        \n// JS\ncontroller(\'ScrollingDrag\', [\'$interval\', \'$element\', \'dragularService\', function TodoCtrl($interval, $element, dragularService) {\n\n\n    var timer,\n      leftScrollContainer = document.getElementById(\'leftScroll\'),\n      rightScrollContainer = document.getElementById(\'rightScroll\'),\n      leftTopBar = document.getElementById(\'leftTopBar\'),\n      leftBottomBar = document.getElementById(\'leftBottomBar\'),\n      rightTopBar = document.getElementById(\'rightTopBar\'),\n      rightBottomBar = document.getElementById(\'rightBottomBar\');\n\n    dragularService.cleanEnviroment();\n    dragularService([leftScrollContainer, rightScrollContainer]);\n\n    registerEvents(leftTopBar, leftScrollContainer, -5);\n    registerEvents(leftBottomBar, leftScrollContainer, 5);\n    registerEvents(rightTopBar, rightScrollContainer, -5);\n    registerEvents(rightBottomBar, rightScrollContainer, 5);\n\n    function registerEvents(bar, container, inc, speed) {\n      if (!speed) {\n        speed = 20;\n      }\n      angular.element(bar).on(\'dragularenter\', function() {\n        container.scrollTop += inc;\n        timer = $interval(function moveScroll() {\n          container.scrollTop += inc;\n        }, speed);\n      });\n      angular.element(bar).on(\'dragularleave dragularrelease\', function() {\n        $interval.cancel(timer);\n      });\n    }\n  }])\n        \n      
\n
\n        \n<!-- HTML -->\n<div ng-controller="ScrollingDrag">\n    <div class="containerVertical scrollingDrag">\n      <div class="scrollBar" id="leftTopBar">up</div>\n      <div id="leftScroll" class="scrollingDragInner">\n        <div>Item 1</div>\n        <div>Item 2</div>\n            ...\n      </div>\n      <div class="scrollBar" id="leftBottomBar">down</div>\n    </div>\n    <div class="containerVertical scrollingDrag">\n      <div class="scrollBar" id="rightTopBar">up</div>\n      <div id="rightScroll" class="scrollingDragInner">\n        <div>Item 1</div>\n        <div>Item 2</div>\n            ...\n      </div>\n      <div class="scrollBar" id="rightBottomBar">down</div>\n    </div>\n  </div>\n        \n      
\n
\n        \n// CSS\n.scrollingDrag {\n  width: 45%;\n  display: inline-block;\n}\n\n.scrollingDragInner {\n  max-height: 200px;\n  overflow-y: auto;\n}\n\n#rightTopBar,\n#rightBottomBar {\n  background: transparent;\n  position: relative;\n  height: 20px;\n}\n\n#rightTopBar {\n  top: 10px;\n}\n\n#rightBottomBar {\n  bottom: 10px;\n}\n\ndiv.scrollBar {\n  background: yellow;\n  text-align: center;\n  padding: 1px;\n}\n\n        \n      
\n
\n'),e.put("partials/partial-contribute.html",'
\n
\n
\n \n
\n
\n
\n'), +e.items.splice(n,0,{content:this.item.content+"-copy"})},e.removeItem=function(){var n=e.items.indexOf(this.item);e.items.splice(n,1)}};t.$inject=["$scope","$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e,n,t,o){e.items1=[{content:"Move me, but you can only drop me in one of these containers."},{content:"If you try to drop me somewhere other than these containers, I'll just come back."},{content:"Apple 3"},{content:"Orange 4"},{content:"Orange 5"},{content:"Apple 6"},{content:"Apple 7"},{content:"Apple 8"}],e.items2=[{content:"Apple 9"},{content:"Orange 10"},{content:"Orange 11"},{content:"Apple 12"},{content:"Orange 13"},{content:"Apple 14"}],e.filter1query="Orange",e.filter2query="Orange",e.filteredModel1=[],e.filteredModel2=[],e.getFilteredModel=function(e,n,t){return e.length=0,[].push.apply(e,o("filter")(n,t)),e};var i=n.children().eq(1).children();t.cleanEnviroment(),t([i[0],i[1]],{containersModel:[e.items1,e.items2],containersFilteredModel:[e.filteredModel1,e.filteredModel2]})};t.$inject=["$scope","$element","dragularService","$filter"],e.exports=t},function(e,n){"use strict";var t=function(e,n,t){e.items=[{content:"Try to add or remove some elements (click on +- buttons), you will see that it is not problem for dragular."},{content:"Item 2"},{content:"Item 3"},{content:"Item 4"}],t.cleanEnviroment(),t(n.children().eq(0).children(),{containersModel:e.items}),e.addItem=function(){var n=e.items.indexOf(this.item)+1;e.items.splice(n,0,{content:this.item.content+"-copy"})},e.removeItem=function(){var n=e.items.indexOf(this.item);e.items.splice(n,1)}};t.$inject=["$scope","$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e,n){n.cleanEnviroment(),n(e.children(),{removeOnSpill:!0})};t.$inject=["$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e,n,t){e.items1=[{content:"Move me, but you can only drop me in containers."},{content:"If you try to drop me somewhere other than containers, I'll die a fiery death."},{content:"Item 3"},{content:"Item 4"}],e.items2=[{content:"You can drop me in the left container."},{content:"Item 6"},{content:"Item 7"},{content:"Item 8"}];var o=n.children().eq(0).children();t.cleanEnviroment(),t([o[0],o[1]],{containersModel:[e.items1,e.items2],removeOnSpill:!0})};t.$inject=["$scope","$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e,n){n.cleanEnviroment(),n(e.children(),{revertOnSpill:!0})};t.$inject=["$element","dragularService"],e.exports=t},function(e,n){"use strict";var t=function(e,n,t){function o(n,t,o,r){r||(r=20),angular.element(n).on("dragularenter",function(){t.scrollTop+=o,i=e(function(){t.scrollTop+=o},r)}),angular.element(n).on("dragularleave dragularrelease",function(){e.cancel(i)})}var i,r=document.getElementById("leftScroll"),l=document.getElementById("rightScroll"),a=document.getElementById("leftTopBar"),c=document.getElementById("leftBottomBar"),s=document.getElementById("rightTopBar"),d=document.getElementById("rightBottomBar");t.cleanEnviroment(),t([r,l]),o(a,r,-5),o(c,r,5),o(s,l,-5),o(d,l,5)};t.$inject=["$interval","$element","dragularService"],e.exports=t},function(e,n){"use strict";function t(e,n,t,o){e.cleanEnviroment(),t.items=[{questions:[{text:"text1",points:1},{text:"text2",points:2},{text:"text3",points:3}],order:1,name:"x",age:"1"},{questions:[{text:"text1",points:1},{text:"text2",points:2},{text:"text3",points:3}],order:2,name:"y",age:"2"},{questions:[{text:"text1",points:1},{text:"text2",points:2},{text:"text3",points:3}],order:3,name:"z",age:"3"},{questions:[{text:"text1",points:1},{text:"text2",points:2},{text:"text3",points:3}],order:1,name:"x",age:"4"},{questions:[{text:"text1",points:1},{text:"text2",points:2},{text:"text3",points:3}],order:2,name:"y",age:"5"},{questions:[{text:"text1",points:1},{text:"text2",points:2},{text:"text3",points:3}],order:3,name:"z",age:"6"}],o(function(){e("#items",{containersModel:"items",scope:t,moves:function(e,n,t){return t.classList.contains("item")},nameSpace:"items"}),t.$on("dragulardrop",function(){t.items.forEach(function(e,n){e.order=n+1})})})}function o(){return{restrict:"E",template:'
{{subitem.points}}. {{subitem.text}}
',controller:"QuestionsController",scope:{question:"="}}}function i(e,n,t){n(t.children(".all-data"),{containersModel:"question",scope:e,nameSpace:"subitem",moves:function(e,n,t){return t.classList.contains("subitem")}}),e.$on("dragulardrop",function(){e.question.forEach(function(e,n){e.points=n+1})})}t.$inject=["dragularService","$element","$scope","$timeout"],angular.module("examplesApp").directive("questionDirective",o).controller("QuestionsController",i),e.exports=t},function(e,n){"use strict";e.exports=angular.module("templates",[]).run(["$templateCache",function(e){e.put("docsInstall/docsInstall.html","

Install

\n

download dragular.js and dragular.css from dist folder

\n

OR clone git

\n
\ngit clone http://github.com/luckylooke/dragular.git\n
\n

OR use npm

\n
\n[sudo] npm install dragular\n
\n

OR use bower

\n
\nbower install dragular\n
\n

AND include files into your project

\n
\n<link href='styles/dragular.css' rel='stylesheet' type='text/css' />\n<script src='scripts/dragular.js'></script>\n
\n

AND put dragularModule into dependency array

\n
\nvar app = angular.module('myApp', ['dragularModule', 'otherDependencies']);\n
\n

DONE :)

\n"),e.put("exampleBasic/exampleBasic.html","
\n

Basic

\n \n
\n
\n
Move me, but you can only drop me in one of these containers.
\n
If you try to drop me somewhere other than these containers, I'll just come back.
\n
Item 3.
\n
Item 6.
\n
\n
\n
You can drop me in the left container, otherwise I'll stay here.
\n
Try to click me, dragular distinguish drag from click
\n
Item 5.
\n
\n
\n
\n        \n// JS\n  controller('Basic', ['$element', 'dragularService', function TodoCtrl($element, dragularService) {\n    dragularService('.containerVertical');\n  }])\n        \n        \n// CSS\n.clickedClass {\n  background-color: orange !important;\n}\n        \n        \n<!-- HTML -->\n  <div class='wrapper' ng-controller="Basic">\n    <div class='containerVertical'>\n        <div>Move me, but you can only drop me in one of these containers.</div>\n        <div>If you try to drop me somewhere other than these containers, I'll just come back.</div>\n        <div>Item 3.</div>\n        <div>Item 6.</div>\n    </div>\n    <div class='containerVertical'>\n        <div>You can drop me in the left container, otherwise I'll stay here.</div>\n        <div ng-click=\"clicked = !clicked\" ng-class=\"clicked && 'clickedClass'\">Try to click me, dragular distinguish drag from click</div>\n        <div>Item 5.</div>\n    </div>\n</div>\n        \n      
\n
\n"),e.put("exampleBasicWithModel/exampleBasicWithModel.html","
\n

Basic - with model

\n \n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n          
{{items1 | json}}
\n
\n
\n
Items2:\n          
{{items2 | json}}
\n
\n
\n
\n
\n        \n// JS\n  controller('BasicModel', ['$scope', '$element', 'dragularService', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items1 = [{\n      content: 'Move me, but you can only drop me in one of these containers.'\n    }, {\n      content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n    }, {\n      content: 'Item 3'\n    }, {\n      content: 'Item 4'\n    }];\n    $scope.items2 = [{\n      content: 'Item 5'\n    }, {\n      content: 'Item 6'\n    }, {\n      content: 'Item 7'\n    }, {\n      content: 'Item 8'\n    }];\n    var containers = $element.children().children();\n    dragularService([containers[0],containers[1]],{\n      containersModel: [$scope.items1, $scope.items2]\n    });\n  }])\n        \n        \n<!-- HTML -->\n<div class='wrapper' ng-controller="Basic">\n    <div class='tableRow'>\n        <div class='containerVertical'>\n            <div ng-repeat="item in items1">{{item.content}}</div>\n        </div>\n        <div class='containerVertical'>\n            <div ng-repeat="item in items2">{{item.content}}</div>\n        </div>\n    </div>\n    <div class="tableRow">\n        <div class="container">\n            <div>Items1:\n                <br/>{{items1 | json}}</div>\n        </div>\n        <div class="container">\n            <div>Items2:\n                <br/>{{items2 | json}}</div>\n        </div>\n    </div>\n</div>\n        \n      
\n
\n"),e.put("exampleBoundingBox/exampleBoundingBox.html","
\n

BoundingBox

\n \n
\n
\n
This items cannot cross its example element, just try it your selves.
\n
Item 2.
\n
Item 3.
\n
Item 6.
\n
\n
\n
This items cannot cross its example element, just try it your selves.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n        \n  dragularService([$element.children(), {\n    boundingBox: $element\n  });\n        \n      
\n
"),e.put("exampleBoundingBoxLockX/exampleBoundingBoxLockX.html",'
\n

BoundingBox and lockX

\n \n
\n
\n
\n
Items are locked in X axis movement and cannot cross its closest parent div.boundingBox, just try it your selves.
\n
item 2
\n
item 3
\n
item 4
\n
\n
\n
\n
\n        \n  dragularService([$element.children()[0].children(), {\n    boundingBox: $element.children()[0],\n    lockX: true\n  });\n        \n      
\n
'),e.put("exampleBoundingBoxLockY/exampleBoundingBoxLockY.html","
\n

BoundingBox and LockY

\n \n
\n
\n
\n
Items are locked in Y axis movement and cannot cross its closest parent div.boundingBox, just try it your selves.
\n
item 2
\n
item 3
\n
item 4
\n
item 5
\n
item 6
\n
\n
\n
\n
\n        \n  dragularService([$element.children()[0].children(), {\n    boundingBox: $element.children()[0],\n    lockY: true\n  });\n        \n      
\n
"),e.put("exampleCopy/exampleCopy.html","
\n

Copy

\n \n
\n
\n
Move me, and make copy on drop.
\n
If you try to drop me somewhere other than these containers, I'll just come back.
\n
\n
\n
You can drop me in the left container, otherwise I'll stay here.
\n
\n
\n
\n        \n// JS\n  controller('Copy', ['$element', 'dragularService', function TodoCtrl($element, dragularService) {\n    dragularService($element.children(), {\n      copy: true\n    });\n  }])\n        \n        \n<!-- HTML -->\n<div class='wrapper' ng-controller="Copy" ng-hide="globals.showModelExamples">\n    <div id='left2' class='containerVertical'>\n      <div>Move me, and make copy on drop.</div>\n      <div>If you try to drop me somewhere other than these containers, I'll just come back.</div>\n    </div>\n    <div id='right2' class='containerVertical'>\n      <div>You can drop me in the left container, otherwise I'll stay here.</div>\n    </div>\n  </div>\n        \n      
\n
\n"),e.put("exampleCopyWithModel/exampleCopyWithModel.html","
\n

Copy - with model

\n \n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n
\n            {{ items1 | json }}\n          
\n
\n
\n
\n
Items2:\n
\n            {{ items2 | json }}\n          
\n
\n
\n
\n
\n
\n        \n// JS\n  controller('CopyModel', ['$scope', '$element', 'dragularService', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items1 = [{\n      content: 'Move me, and make copy on drop.'\n    }, {\n      content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n    }, {\n      content: 'Item 3'\n    }, {\n      content: 'Item 4'\n    }];\n    $scope.items2 = [{\n      content: 'Item 5'\n    }, {\n      content: 'Item 6'\n    }, {\n      content: 'Item 7'\n    }, {\n      content: 'Item 8'\n    }];\n    var containers = $element.children().children();\n    dragularService([containers[0],containers[1]],{\n      containersModel: [$scope.items1, $scope.items2],\n      copy: true\n    });\n  }])\n        \n        \n<!-- HTML -->\n<div class='wrapper' ng-controller="CopyModel" ng-show="globals.showModelExamples">\n    <div class='tableRow'>\n      <div class='containerVertical'>\n        <div ng-repeat="item in items1">{{item.content}}</div>\n      </div>\n      <div class='containerVertical'>\n        <div ng-repeat="item in items2">{{item.content}}</div>\n      </div>\n    </div>\n    <div class="tableRow">\n      <div class="container">\n        <div>Items1:\n          <br/>{{items1 | json}}</div>\n      </div>\n      <div class="container">\n        <div>Items2:\n          <br/>{{items2 | json}}</div>\n      </div>\n    </div>\n  </div>\n        \n      
\n
\n"),e.put("exampleCustomClasses/exampleCustomClasses.html","
\n

Custom classes

\n \n
\n
\n
Move me, but you can only drop me in one of these containers.
\n
If you try to drop me somewhere other than these containers, I'll just come back.
\n
Item 3.
\n
Item 6.
\n
\n
\n
You can drop me in the left container, otherwise I'll stay here.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n        \n  dragularService([document.getElementById(left), document.getElementById(right)], { classes: {\n    mirror: 'custom-green-mirror'\n  } });\n\n  // Default classes are:\n  option.classes = {\n    mirror: 'gu-mirror',\n    hide: 'gu-hide',\n    unselectable: 'gu-unselectable',\n    transit: 'gu-transit',\n    overActive: 'gu-over-active',\n    overAccepts: 'gu-over-accept',\n    overDeclines: 'gu-over-decline'\n  };\n        \n      
\n
\n"),e.put("exampleDifferentOptionsWithModel/exampleDifferentOptionsWithModel.html","
\n

Different options - with model

\n \n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n          
{{items1 | json}}
\n
\n
\n
Items2:\n          
{{items2 | json}}
\n
\n
\n
\n
\n        \n// JS\n  .controller('DifferentOptionsModel', ['$scope', '$element', 'dragularService', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items1 = [{\n      content: 'Move me, but you can only drop me in one of these containers.'\n    }, {\n      content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n    }, {\n      content: 'Item 3'\n    }, {\n      content: 'Item 4'\n    }];\n    $scope.items2 = [{\n      content: 'Item 5'\n    }, {\n      content: 'Item 6'\n    }, {\n      content: 'Item 7'\n    }, {\n      content: 'Item 8'\n    }];\n\n    var containerLeft = document.querySelector('#containerLeft'),\n      containerRight = document.querySelector('#containerRight');\n\n    function accepts(el, target, source) {\n      if (source === containerLeft || source === target) {\n        return true;\n      }\n    }\n\n    dragularService([containerLeft], {\n      containersModel: [$scope.items1],\n      copy: true,\n      //move only from left to right  \n      accepts: accepts\n    });\n\n    dragularService([containerRight], {\n      containersModel: [$scope.items2],\n      removeOnSpill: true,\n      //move only from left to right  \n      accepts: accepts\n    });\n\n  }])\n        \n        \n<!-- HTML -->\n<div class='wrapper' ng-controller="DifferentOptionsModel">\n    <div class='tableRow'>\n      <div id="containerLeft" class='containerVertical'>\n        <div ng-repeat="item in items1">{{item.content}}</div>\n      </div>\n      <div id="containerRight" class='containerVertical'>\n        <div ng-repeat="item in items2">{{item.content}}</div>\n      </div>\n    </div>\n    <div class="tableRow">\n      <div class='containerVertical'>\n        <pre>Items1:\n          <br/>{{items1 | json}}</pre>\n      </div>\n      <div class='containerVertical'>\n        <pre>Items2:\n          <br/>{{items2 | json}}</pre>\n      </div>\n    </div>\n  </div>\n        \n      
\n
\n"),e.put("exampleDirective/exampleDirective.html","
\n

Directive

\n \n
\n
\n
Move me, but you can only drop me in one of these containers.
\n
If you try to drop me somewhere other than these containers, I'll just come back.
\n
Item 3.
\n
Item 6.
\n
\n
\n
You can drop me in the left container, otherwise I'll stay here.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n        \n// JS\n  controller('Directive', ['$scope', 'dragularService', function TodoCtrl($scope) {\n    $scope.dragularOptions = {\n      classes: {\n        mirror: 'custom-green-mirror'\n      },\n      nameSpace: 'common' // just connecting left and right container\n    };\n  }])\n        \n        \n<!-- HTML -->\n<div class='wrapper' ng-controller="Directive">\n    <div class='containerVertical' dragular="dragularOptions">\n      <div>Move me, but you can only drop me in one of these containers.</div>\n      <div>If you try to drop me somewhere other than these containers, I'll just come back.</div>\n      <div>Item 3.</div>\n      <div>Item 6.</div>\n    </div>\n    <div class='containerVertical' dragular='{"classes":{"mirror":"custom-green-mirror"},"nameSpace":"same"}'>\n      <div>You can drop me in the left container, otherwise I'll stay here.</div>\n      <div>Item 4.</div>\n      <div>Item 5.</div>\n    </div>\n  </div>\n        \n      
\n
\n"),e.put("exampleDirectiveWithModel/exampleDirectiveWithModel.html","
\n

Directive - with model

\n \n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n
{{items1 | json}}
\n
\n
\n
Items2:\n
{{items2 | json}}
\n
\n
\n
\n
\n       \n        \n// JS\n  controller('DirectiveModel', ['$scope', function TodoCtrl($scope) {\n    $scope.items1 = [{\n      content: 'Move me, and make copy on drop.'\n    }, {\n      content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n    }, {\n      content: 'Item 3'\n    }, {\n      content: 'Item 4'\n    }];\n    $scope.items2 = [{\n      content: 'Item 5'\n    }, {\n      content: 'Item 6'\n    }, {\n      content: 'Item 7'\n    }, {\n      content: 'Item 8'\n    }];\n    $scope.dragularOptions = {\n      containersModel: $scope.items1,\n      classes: {\n        mirror: 'custom-green-mirror'\n      },\n      nameSpace: 'common' // just connecting left and right container\n    };\n  }])\n        \n        \n<!-- HTML -->\n <div class='wrapper' ng-controller="DirectiveModel">\n  <div class='containerVertical' dragular="dragularOptions">\n    <div ng-repeat="item in items1">{{item.content}}</div>\n  </div>\n  <div class='containerVertical' dragular='{"containersModel":"items2","classes":{"mirror":"custom-green-mirror"},"nameSpace":"common"}'>\n    <div ng-repeat="item in items2">{{item.content}}</div>\n  </div>\n</div>\n        \n      
\n
\n"),e.put("exampleDragOverEvents/exampleDragOverEvents.html","
\n

Drag-over events

\n

You can interact with dragging element by litening to dragOver events. Usually you want to containers show wheather they accepts element or not, but you can use it anywhere. DragOver events are: dragenter, dragleave and dragrelease. On dragOver events dragularService reveals several useful properties.

\n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
dragularService.shared.itemitem beeing dragged (it is copy of item if copy is enabled via options)
dragularService.shared.sourcesource container item is dragged from
dragularService.shared.sourceModelsource container model representation if model was porvided
dragularService.shared.initialIndexoriginal index of item, can be used to get item model from sourceModel
dragularService.shared.extracontains accepting information (boolean) on dragenter, element drag is leaving to on dragleave and element behind the cursor on dragrelease
\n
\n\n

Try to drag over the not-container too.

\n
\n
\n
apples and oranges cannot be mixed
\n
apple 2
\n
apple 3
\n
apple 4
\n
\n
\n
orange 1
\n
orange 2
\n
orange 3
\n
orange 4
\n
\n
\n
apple 5
\n
apple 6
\n
apple 7
\n
apple 8
\n
\n
\n
orange 5
\n
orange 6
\n
orange 7
\n
orange 8
\n
\n
\n
Test active class on NOT container.
\n\n
\n    \n<!-- HTML -->\n  <div class='wrapper' ng-controller="DragOverEvents">\n    <div class='container width25'>\n      <div>apples and oranges cannot be mixed</div>\n      <div>apple 2</div>\n      ...\n    </div>\n    <div class='container width25'>\n      <div>orange 1</div>\n      <div>orange 2</div>\n      ...\n    </div>\n    <div class='container width25'>\n      <div>apple 5</div>\n      <div>apple 6</div>\n      ...\n    </div>\n    <div class='container width25'>\n      <div>orange 5</div>\n      <div>orange 6</div>\n      ...\n    </div>\n  </div>\n  <div class="notContainer"> Test active class on NOT container.</div>\n    \n  
\n\n
\n    \n  // CSS\n  \n.notContainer.gu-over {\n  background-color: yellow;\n}\n\n.containerVertical.gu-over-accept {\n  background-color: green;\n}\n\n.containerVertical.gu-over-decline {\n  background-color: red;\n}\n    \n  
\n\n
\n    \n  // JS\n  controller('DragOverEvents', ['$element', 'dragularService', function TodoCtrl($element, dragularService) {\n    dragularService.cleanEnviroment();\n    dragularService([$element.children()[0], $element.children()[2]], {\n      nameSpace: 'apples'\n    });\n    dragularService([$element.children()[1], $element.children()[3]], {\n      nameSpace: 'oranges'\n    });\n\n    // containers events handling\n    function registerEvents(el) {\n      el.on('dragularenter', function(e) {\n        if (el[0] === e.target) { // filter bubbled\n          el.addClass(dragularService.shared.extra ? 'gu-over-accept' : 'gu-over-decline');\n        }\n      });\n      el.on('dragularleave dragularrelease', function(e) {\n        if ((el[0] === e.target && // filter bubbled\n          dragularService.shared.extra && // extra on dragleave contains element the drag is leaving to\n          dragularService.shared.extra.parentElement !== e.target) // is that element child of this container?\n          || e.type === 'dragularrelease') {\n          el.removeClass('gu-over-accept');\n          el.removeClass('gu-over-decline');\n        }\n      });\n    }\n\n    angular.forEach($element.children(), function forEachChild(el) {\n      registerEvents(angular.element(el));\n    });\n\n    // notContainer events handling\n    var notContainer = angular.element(document.getElementsByClassName('notContainer'));\n    notContainer.on('dragularenter', function() {\n      notContainer.addClass('gu-over');\n    });\n    notContainer.on('dragularleave dragularrelease', function() {\n      notContainer.removeClass('gu-over');\n    });\n  }])\n    \n  
\n
\n"),e.put("exampleEvents/exampleEvents.html","
\n

Events

\n

Events affecting more than on cotrollers are emitted on both scopes if provided.

\n

EventsCtrl

\n
\n
\n
Move me, but you can only drop me in one of these containers.
\n
If you try to drop me somewhere other than these containers, I'll just come back.
\n
Item 3.
\n
Item 6.
\n
\n
\n
You can drop me in the left container, otherwise I'll stay here.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n

Events2Ctrl

\n
\n
\n
Move me, but you can only drop me in one of these containers.
\n
If you try to drop me somewhere other than these containers, I'll just come back.
\n
Item 3.
\n
Item 6.
\n
\n
\n
You can drop me in the left container, otherwise I'll stay here.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n        \nvar EventsCtrl = function ($scope, $element, dragularService, $timeout) {\n  \n  var drake = dragularService($element.children(), {\n    scope: $scope\n  });\n  $scope.$on('dragulardrag', function(e, el) {\n    e.stopPropagation();\n    el.className = el.className.replace(' ex-moved', '');\n  });\n  $scope.$on('dragulardrop', function(e, el) {\n    e.stopPropagation();\n    $timeout(function() {\n      el.className += ' ex-moved';\n    }, 0);\n  });\n\n  $scope.$on('dragularcloned', myFn('cloned in EventsCtrl'));\n  $scope.$on('dragulardrag', myFn('drag in EventsCtrl'));\n  $scope.$on('dragularcancel', myFn('cancel in EventsCtrl'));\n  $scope.$on('dragulardrop', myFn('drop in EventsCtrl'));\n  $scope.$on('dragularremove', myFn('remove in EventsCtrl'));\n  $scope.$on('dragulardragend', myFn('dragend in EventsCtrl'));\n  $scope.$on('dragularshadow', myFn('shadow in EventsCtrl'));\n\n  function myFn(eventName) {\n    return function() {\n      console.log(eventName, arguments, drake);\n    };\n  }\n};\n\nvar Events2Ctrl = function ($scope, $element, dragularService, $timeout) {\n  var drake = dragularService($element.children(), {\n    scope: $scope\n  });\n  $scope.$on('dragulardrag', function(e, el) {\n    e.stopPropagation();\n    el.className = el.className.replace(' ex-moved', '');\n  });\n  $scope.$on('dragulardrop', function(e, el) {\n    e.stopPropagation();\n    $timeout(function() {\n      el.className += ' ex-moved';\n    }, 0);\n  });\n\n  $scope.$on('dragularcloned', myFn('cloned in Events2Ctrl'));\n  $scope.$on('dragulardrag', myFn('drag in Events2Ctrl'));\n  $scope.$on('dragularcancel', myFn('cancel in Events2Ctrl'));\n  $scope.$on('dragulardrop', myFn('drop in Events2Ctrl'));\n  $scope.$on('dragularremove', myFn('remove in Events2Ctrl'));\n  $scope.$on('dragulardragend', myFn('dragend in Events2Ctrl'));\n  $scope.$on('dragularshadow', myFn('shadow in Events2Ctrl'));\n\n  function myFn(eventName) {\n    return function() {\n      console.log(eventName, arguments, drake);\n    };\n  }\n};\n        \n      
\n
\n"), +e.put("exampleHandle/exampleHandle.html","
\n

Handle

\n \n
\n
\n
+Move me, but you can use the plus sign to drag me around.
\n
\n
\n
\n
\n
\n        \n  dragularService([document.getElementById(left), document.getElementById(right)], {\n    moves: function (el, container, handle) {\n      return handle.className === 'handle';\n    }\n  });\n        \n      
\n
\n"),e.put("exampleIsContainerWithModel/exampleIsContainerWithModel.html","
\n

isContainer - with model

\n \n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}\n
\n
\n
\n
\n
\n
Items1:\n          
{{items1 | json}}
\n
\n
\n
Cart:\n          
{{cartModel | json}}
\n
\n
\n
\n
\n        \n// JS\n  .controller('IsContainerModel', ['$scope', '$element', 'dragularService', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items1 = [{\n      content: 'Move me, but you can only drop me in one of these containers.'\n    }, {\n      content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n    }, {\n      content: 'Item 3'\n    }, {\n      content: 'Item 4'\n    }];\n    $scope.cartModel = [];\n\n    var containerLeft = document.querySelector('#containerLeft');\n\n    dragularService.cleanEnviroment();\n    dragularService([containerLeft], {\n      containersModel: [$scope.items1],\n      copy: true,\n      isContainer: function isContainer (el) {\n        return el.id === 'cart';\n      },\n      isContainerModel: function getModel (){\n        return $scope.cartModel;\n      }\n    });\n\n    $scope.removeItem = function removeItem() {\n      var index = $scope.cartModel.indexOf(this.item);\n      $scope.cartModel.splice(index, 1);\n    };\n\n  }])\n        \n        \n<!-- HTML -->\n <div class='wrapper' ng-controller="IsContainerModel">\n    <div class='tableRow'>\n      <div id="containerLeft" class='containerVertical'>\n        <div ng-repeat="item in items1">{{item.content}}</div>\n      </div>\n      <div id="cart" class='containerVertical'>\n        <div class='cursorDefault' ng-repeat="item in cartModel">{{item.content}}\n        <button class='cursorDefault' ng-click="removeItem()">x</button></div>\n      </div>\n    </div>\n    <div class="tableRow">\n      <div class='containerVertical'>\n        <pre>Items1:\n          <br/>{{items1 | json}}</pre>\n      </div>\n      <div class='containerVertical'>\n        <pre>Cart:\n          <br/>{{cartModel | json}}</pre>\n      </div>\n    </div>\n  </div>\n        \n      
\n
\n"),e.put("exampleNameSpaces/exampleNameSpaces.html","
\n

NameSpaces

\n \n
\n
\n
try to mix oranges and apples
\n
apple 2
\n
apple 3
\n
apple 4
\n
\n
\n
orange 1
\n
orange 2
\n
orange 3
\n
orange 4
\n
\n
\n
apple 5
\n
apple 6
\n
apple 7
\n
apple 8
\n
\n
\n
mixed 1
\n
mixed 2
\n
mixed 3
\n
mixed 4
\n
\n
\n
\n      \ndragularService([$element.children()[0], $element.children()[2]], {\n  nameSpace: 'apples'\n});\ndragularService($element.children()[1], {\n  nameSpace: 'oranges'\n});\ndragularService($element.children()[3], { // mixed\n  nameSpace: ['oranges', 'apples']\n});\n      \n    
\n
"),e.put("exampleNestedNgRepeat/exampleNestedNgRepeat.html","
\n

Nested ngRepeat

\n \n
\n
\n
Row {{$index}}
\n
{{item.content}}
\n
\n
\n
\n        \n  // HTML\n\n  <div ng-controller="Example15">\n    <div ng-repeat="item in items" class='exampleRow'>\n      <div class="row-handle">Row {{$index}}</div>\n      <div ng-repeat="item in item.items" class="exampleCell">{{item.content}}</div>\n    </div>\n  </div>\n        \n      
\n
\n        \n  // CSS\n\n  .exampleRow {\n    display: flex;\n    flex-direction: row;\n  }\n\n  .exampleCell {\n    flex-grow: 1;\n  }\n\n  .exampleRow,\n  .exampleCell {\n    margin: 10px;\n    padding: 10px;\n    background-color: rgba(0, 0, 0, 0.2);\n    cursor: move;\n    cursor: grab;\n    cursor: -moz-grab;\n    cursor: -webkit-grab;\n  }\n        \n      
\n
\n        \n  // JS\n\n  .controller('NestedNgRepeat', ['$timeout', '$scope', '$element', 'dragularService', function NestedNgRepeatCtrl($timeout, $scope, $element, dragularService) {\n    $timeout(function() { // timeount due to ngRepeat to be ready\n      dragularService($element, {\n        nameSpace: 'rows',\n        moves: function rowOnly (el, container, handle) {\n          return handle.classList.contains('row-handle');\n        }\n      });\n      dragularService($element.children(), {\n        nameSpace: 'cells',\n        moves: function excludeHandle (el, container, handle) {\n          return !handle.classList.contains('row-handle');\n        }\n      });\n    }, 0);\n    $scope.items = [{\n      items: [{\n        content: 'Item a1'\n      }, {\n        content: 'Item a2'\n      }, {\n        content: 'Item a3'\n      }, {\n        content: 'Item a4'\n      }]\n    }, {\n      items: [{\n        content: 'Item b1'\n      }, {\n        content: 'Item b2'\n      }, {\n        content: 'Item b3'\n      }, {\n        content: 'Item b4'\n      }]\n    }, {\n      items: [{\n        content: 'Item c1'\n      }, {\n        content: 'Item c2'\n      }, {\n        content: 'Item c3'\n      }, {\n        content: 'Item c4'\n      }]\n    }];\n  }])\n        \n      
\n
\n"),e.put("exampleNestedNgRepeatWithModel/exampleNestedNgRepeatWithModel.html","
\n

Nested ngRepeat - with model

\n \n
\n
\n
\n
\n
Row {{::$index}}
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
\n
\n
\n            
Items:\n
{{items | json}}
\n
\n
\n
\n
\n
\n    \n<!-- HTML -->\n<div ng-controller="NestedNgRepeatWithModel">\n  <div class='containerVertical'>\n    <div ng-repeat="item in items" class='exampleRow'>\n      <div class="row-handle">Row {{::$index}}</div>\n      <div class="exampleRow exampleCell containerNested">\n        <div ng-repeat="item in item.items" class="exampleCell">{{item.content}}</div>\n      </div>\n    </div>\n  </div>\n</div>\n    \n  
\n
\n    \n  // CSS\n\n  .exampleRow {\n    display: flex;\n    flex-direction: row;\n  }\n\n  .exampleCell {\n    flex-grow: 1;\n  }\n\n  .exampleRow,\n  .exampleCell {\n    margin: 10px;\n    padding: 10px;\n    background-color: rgba(0, 0, 0, 0.2);\n    cursor: move;\n    cursor: grab;\n    cursor: -moz-grab;\n    cursor: -webkit-grab;\n  }\n    \n  
\n
\n    \n  // JS\n.controller('NestedNgRepeatWithModel', ['$timeout', '$scope', '$element', 'dragularService', function NestedNgRepeatWithModelCtrl($timeout, $scope, $element, dragularService) {\n    $timeout(function() { // timeount due to nested ngRepeat to be ready\n      var container = $element.children().eq(0).children(),\n        parentContainers = container.children(),\n        nestedContainers = [];\n\n      dragularService(container, {\n        moves: function(el, container, handle) {\n          return handle.classList.contains('row-handle');\n        },\n        containersModel: $scope.items,\n        nameSpace: 'rows'\n      });\n\n      // collect nested contianers\n      for (var i = 0; i < parentContainers.length; i++) {\n        nestedContainers.push(parentContainers.eq(i).children()[1]);\n      }\n\n      dragularService(nestedContainers, {\n        moves: function(el, container, handle) {\n          return !handle.classList.contains('row-handle');\n        },\n        containersModel: (function getNestedContainersModel(){\n          var parent = $scope.items,\n            containersModel = [];\n          for (var i = 0; i < parent.length; i++) {\n            containersModel.push(parent[i].items);\n          }\n          return containersModel;\n        })(),\n        nameSpace: 'cells'\n      });\n    }, 0);\n    $scope.items = [{\n      items: [{\n        content: 'Item a1'\n      }, {\n        content: 'Item a2'\n      }, {\n        content: 'Item a3'\n      }, {\n        content: 'Item a4'\n      }]\n    }, {\n      items: [{\n        content: 'Item b1'\n      }, {\n        content: 'Item b2'\n      }, {\n        content: 'Item b3'\n      }, {\n        content: 'Item b4'\n      }]\n    }, {\n      items: [{\n        content: 'Item c1'\n      }, {\n        content: 'Item c2'\n      }, {\n        content: 'Item c3'\n      }, {\n        content: 'Item c4'\n      }]\n    }];\n  }])\n    \n  
\n
\n"),e.put("exampleNestedRepeatsWithCustomDirective/exampleNestedRepeatsWithCustomDirective.html",'
\n
\n
\n {{item.order}}: ({{item.name}} + {{item.age}})\n
\n \n \n
\n
\n
\n
\n'),e.put("exampleNgRepeat/exampleNgRepeat.html","
\n

ngRepeat

\n \n
\n
\n
\n {{item.content}}\n
\n
\n
\n
\n        \n  // HTML:\n  <div class='containerVertical'>\n    <div ng-repeat="item in items">\n      {{item.content}}\n    </div>\n  </div>\n\n  // JS:\n  dragularService($element.children());\n  $scope.items = [{\n    content: 'Try to add or remove some elements (click on +- buttons), you will see that it is not problem for dragular.'\n  },{\n    content: 'Item 2'\n  },{\n    content: 'Item 3'\n  },{\n    content: 'Item 4'\n  }];\n        \n      
\n
\n"),e.put("exampleNgRepeatWithModel/exampleNgRepeatWithModel.html","
\n

ngRepeat - with model

\n \n
\n
\n
\n
\n {{item.content}}\n \n \n
\n
\n
\n
\n
\n
Items:\n
{{items | json}}
\n
\n
\n
\n
\n    \n  // HTML:\n   <div class='wrapper' ng-controller="NgRepeatWithModel">\n      <div class='containerVertical'>\n        <div ng-repeat="item in items">\n          {{item.content}}\n          <button class='cursorDefault' ng-click="addItem()">+</button>\n          <button class='cursorDefault' ng-click="removeItem()">x</button>\n        </div>\n    </div>\n  </div>\n    \n  
\n
\n    \n  // JS:\n  controller('NgRepeatWithModel', ['$scope', '$element', 'dragularService', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items = [{\n      content: 'Try to add or remove some elements (click on +- buttons), you will see that it is not problem for dragular.'\n    }, {\n      content: 'Item 2'\n    }, {\n      content: 'Item 3'\n    }, {\n      content: 'Item 4'\n    }];\n    dragularService($element.children().eq(0).children(), {containersModel: $scope.items});\n    $scope.addItem = function addItem() {\n      var index = $scope.items.indexOf(this.item) + 1;\n      $scope.items.splice(index, 0, {\n        content: this.item.content + '-copy'\n      });\n    };\n    $scope.removeItem = function removeItem() {\n      var index = $scope.items.indexOf(this.item);\n      $scope.items.splice(index, 1);\n    };\n  }])\n    \n  
\n
\n"),e.put("exampleNgRepeatFilteredWithModel/exampleNgRepeatFilteredWithModel.html","
\n

Filtered ngRepeat - with model

\n

Move stuff between these two filtered containers. You can play with filter inputs to see that everything goes right.\n
\n Please notify the getFilteredModel function, it is necessery for not replacing the initial array object with new filtered one!

\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n          
{{items1 | json}}
\n
\n
\n
Items2:\n          
{{items2 | json}}
\n
\n
\n
\n
\n        \n// JS\n  .controller('NgRepeatFilteredWithModel', ['$scope', '$element', 'dragularService', '$filter', function TodoCtrl($scope, $element, dragularService, $filter) {\n    $scope.items1 = [{\n      content: 'Move me, but you can only drop me in one of these containers.'\n    }, {\n      content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n    }, {\n      content: 'Apple 3'\n    }, {\n      content: 'Orange 4'\n    }, {\n      content: 'Orange 5'\n    }, {\n      content: 'Apple 6'\n    }, {\n      content: 'Apple 7'\n    }, {\n      content: 'Apple 8'\n    }];\n    $scope.items2 = [{\n      content: 'Apple 9'\n    }, {\n      content: 'Orange 10'\n    }, {\n      content: 'Orange 11'\n    }, {\n      content: 'Apple 12'\n    }, {\n      content: 'Orange 13'\n    }, {\n      content: 'Apple 14'\n    }];\n    $scope.filter1query = 'Orange';\n    $scope.filter2query = 'Orange';\n    $scope.filteredModel1 = [];\n    $scope.filteredModel2 = [];\n    $scope.getFilteredModel = function (filteredModel, items, filterQuery) {\n      filteredModel.length = 0;\n      /*\n      * Following one-liner is same like:\n      *   var filteredModelTemp = $filter('filter')(items, filterQuery);\n      *   angular.forEach(filteredModelTemp, function(item){\n      *     filteredModel.push(item);\n      *   });\n      * Or like:\n      *   var filteredModelTemp = $filter('filter')(items, filterQuery);\n      *   for(var i; i < filteredModelTemp.length; i++){\n      *     filteredModel.push(filteredModelTemp[i]);\n      *   }\n      *\n      * You cannot just assign filtered array to filteredModel like this:\n      *   filteredModel = $filter('filter')(items, filterQuery);\n      * Because you would replace the array object you provide to dragular with new one.\n      * So dragular will continue to use the one it was provided on init.\n      * Hopefully I make it clear. :)\n       */\n      [].push.apply(filteredModel, $filter('filter')(items, filterQuery));\n      return filteredModel;\n    };\n    var containers = $element.children().eq(1).children();\n    dragularService.cleanEnviroment();\n    dragularService([containers[0],containers[1]],{\n      containersModel: [$scope.items1, $scope.items2],\n      containersFilteredModel: [$scope.filteredModel1, $scope.filteredModel2]\n    });\n  }]);\n\n        \n        \n<!-- HTML -->\n  <div class='wrapper' ng-controller="NgRepeatFilteredWithModel">\n    <div class="tableRow">\n      <div class='containerVertical'>\n        <input ng-model="filter1query" style="margin:10px 10px">\n      </div>\n      <div class='containerVertical'>\n        <input ng-model="filter2query" style="margin:10px 10px">\n      </div>\n    </div>\n    <div class='tableRow'>\n      <div class='containerVertical'>\n        <div ng-repeat="item in getFilteredModel(filteredModel1, items1, filter1query)">{{item.content}}</div>\n      </div>\n      <div class='containerVertical'>\n        <div ng-repeat="item in getFilteredModel(filteredModel2, items2, filter2query)">{{item.content}}</div>\n      </div>\n    </div>\n    <div class="tableRow">\n      <div class='containerVertical'>\n        <pre>Items1:\n          <br/>{{items1 | json}}</pre>\n      </div>\n      <div class='containerVertical'>\n        <pre>Items2:\n          <br/>{{items2 | json}}</pre>\n      </div>\n    </div>\n  </div>\n        \n      
\n
\n"),e.put("exampleRemoveOnSpill/exampleRemoveOnSpill.html","
\n

Remove on spill

\n \n
\n
\n
Move me, but you can only drop me in containers.
\n
If you try to drop me somewhere other than containers, I'll die a fiery death.
\n
Item 3.
\n
Item 6.
\n
Item 4.
\n
Item 5.
\n
\n \n
\n
\n        \n  dragularService([document.getElementById(single)], { removeOnSpill: true });\n        \n      
\n
"),e.put("exampleRemoveOnSpillWithModel/exampleRemoveOnSpillWithModel.html","
\n

Remove on spill - with model

\n \n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n          
{{items1 | json}}
\n
\n
\n
Items2:\n          
{{items2 | json}}
\n
\n
\n
\n
\n        \n// JS\n  .controller('RemoveOnSpillWithModel', ['$scope', '$element', 'dragularService', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items1 = [{\n      content: 'Move me, but you can only drop me in containers.'\n    }, {\n      content: 'If you try to drop me somewhere other than containers, I\\'ll die a fiery death.'\n    }, {\n      content: 'Item 3'\n    }, {\n      content: 'Item 4'\n    }];\n    $scope.items2 = [{\n      content: 'You can drop me in the left container.'\n    }, {\n      content: 'Item 6'\n    }, {\n      content: 'Item 7'\n    }, {\n      content: 'Item 8'\n    }];\n    var containers = $element.children().eq(0).children();\n    dragularService.cleanEnviroment();\n    dragularService([containers[0],containers[1]],{\n      containersModel: [$scope.items1, $scope.items2],\n      removeOnSpill: true\n    });\n  }])\n        \n        \n<!-- HTML -->\n<div class='wrapper' ng-controller="Basic">\n    <div class='tableRow'>\n        <div class='containerVertical'>\n            <div ng-repeat="item in items1">{{item.content}}</div>\n        </div>\n        <div class='containerVertical'>\n            <div ng-repeat="item in items2">{{item.content}}</div>\n        </div>\n    </div>\n    <div class="tableRow">\n        <div class="container">\n            <div>Items1:\n                <br/>{{items1 | json}}</div>\n        </div>\n        <div class="container">\n            <div>Items2:\n                <br/>{{items2 | json}}</div>\n        </div>\n    </div>\n</div>\n        \n      
\n
\n"),e.put("exampleRevertOnSpill/exampleRevertOnSpill.html","
\n

Revert on spill

\n \n
\n
\n
Move me, but you can only drop me in one of these containers.
\n
If you try to drop me somewhere other than these containers, I'll just come back.
\n
Item 3.
\n
Item 6.
\n
\n
\n
You can drop me in the left container, otherwise I'll stay here.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n        \n  dragularService([document.getElementById(left), document.getElementById(right)], { revertOnSpill: true });\n        \n      
\n
"),e.put("exampleScrollingDrag/exampleScrollingDrag.html",'
\n

Scrolling drag

\n \n
\n
\n
up
\n
\n
Item 1.
\n
Item 2.
\n
Item 3.
\n
Item 4.
\n
Item 5.
\n
Item 6.
\n
Item 7.
\n
Item 9.
\n
Item 10.
\n
Item 11.
\n
Item 12.
\n
Item 13.
\n
\n
down
\n
\n
\n
\n
\n
Item 1.
\n
Item 2.
\n
Item 3.
\n
Item 4.
\n
Item 5.
\n
Item 6.
\n
Item 7.
\n
Item 9.
\n
Item 10.
\n
Item 11.
\n
Item 12.
\n
Item 13.
\n
\n
\n
\n
\n
\n        \n// JS\ncontroller(\'ScrollingDrag\', [\'$interval\', \'$element\', \'dragularService\', function TodoCtrl($interval, $element, dragularService) {\n\n\n    var timer,\n      leftScrollContainer = document.getElementById(\'leftScroll\'),\n      rightScrollContainer = document.getElementById(\'rightScroll\'),\n      leftTopBar = document.getElementById(\'leftTopBar\'),\n      leftBottomBar = document.getElementById(\'leftBottomBar\'),\n      rightTopBar = document.getElementById(\'rightTopBar\'),\n      rightBottomBar = document.getElementById(\'rightBottomBar\');\n\n    dragularService.cleanEnviroment();\n    dragularService([leftScrollContainer, rightScrollContainer]);\n\n    registerEvents(leftTopBar, leftScrollContainer, -5);\n    registerEvents(leftBottomBar, leftScrollContainer, 5);\n    registerEvents(rightTopBar, rightScrollContainer, -5);\n    registerEvents(rightBottomBar, rightScrollContainer, 5);\n\n    function registerEvents(bar, container, inc, speed) {\n      if (!speed) {\n        speed = 20;\n      }\n      angular.element(bar).on(\'dragularenter\', function() {\n        container.scrollTop += inc;\n        timer = $interval(function moveScroll() {\n          container.scrollTop += inc;\n        }, speed);\n      });\n      angular.element(bar).on(\'dragularleave dragularrelease\', function() {\n        $interval.cancel(timer);\n      });\n    }\n  }])\n        \n      
\n
\n        \n<!-- HTML -->\n<div ng-controller="ScrollingDrag">\n    <div class="containerVertical scrollingDrag">\n      <div class="scrollBar" id="leftTopBar">up</div>\n      <div id="leftScroll" class="scrollingDragInner">\n        <div>Item 1</div>\n        <div>Item 2</div>\n            ...\n      </div>\n      <div class="scrollBar" id="leftBottomBar">down</div>\n    </div>\n    <div class="containerVertical scrollingDrag">\n      <div class="scrollBar" id="rightTopBar">up</div>\n      <div id="rightScroll" class="scrollingDragInner">\n        <div>Item 1</div>\n        <div>Item 2</div>\n            ...\n      </div>\n      <div class="scrollBar" id="rightBottomBar">down</div>\n    </div>\n  </div>\n        \n      
\n
\n        \n// CSS\n.scrollingDrag {\n  width: 45%;\n  display: inline-block;\n}\n\n.scrollingDragInner {\n  max-height: 200px;\n  overflow-y: auto;\n}\n\n#rightTopBar,\n#rightBottomBar {\n  background: transparent;\n  position: relative;\n  height: 20px;\n}\n\n#rightTopBar {\n  top: 10px;\n}\n\n#rightBottomBar {\n  bottom: 10px;\n}\n\ndiv.scrollBar {\n  background: yellow;\n  text-align: center;\n  padding: 1px;\n}\n\n        \n      
\n
\n'),e.put("partials/partial-contribute.html",'
\n
\n
\n \n
\n
\n
\n'), e.put("partials/partial-docs.html",'
\n
\n \n \n
\n

\n \n

\n \n
\n
\n \n
\n \n
\n'),e.put("partials/partial-home.html",'
\n
\n \n
\n
\n

DRAGULAR

\n

Angular drag&drop based on dragula.

\n

Live examples in docs

\n
\n
\n
\n

Browser support includes every sane browser and **IE7+**. _(Granted you polyfill the functional `Array` methods in ES5)_

\n

Inspiration

\n

I am working on huge angular project and I am using several drag&drop libraries in it, one for UI, one for lists, etc.. I want to use one full-featured drag&drop library for whole project. As I could not find any suitable, I decided to create one. I have choosen great library dragula by Nicolas Bevacqua as my starting point, make it more angular and started to put features in it! If you wish light-weight angular version of dragula, there is official angular version of dragula.

\n

Actual version 4.4.6 is based on dragula 3.6.3 and tested with angular 1.5.5.

\n

Differences of dragular (against dragula)

\n
    \n
  • replaced dragula crossvent with angulars event binding
  • \n
  • replaced dragula contra.emitter with $scope.$emit if scope provided in options (options.scope)
  • \n
  • provided as service or directive dragular where options can be passed via atribute dragular
  • \n
  • automatic direction if not provided in options, instead of default vertical
  • \n
  • accepting arraylike objects as containers array (jQuery, jQlite collections etc..)
  • \n
  • accepting custom classes via option.classes
  • \n
  • namespaced containers groups available via option.nameSpace (containers in same nameSpace cooperate)
  • \n
  • boundingBox (dragging element can me moved only in specific area)
  • \n
  • lockX/Y (dragging element can me moved only in specific direction)
  • \n
  • DOM can be synced with scope model
  • \n
  • support css selectors to define containers
  • \n
  • added syntax highlighter to example codes
  • \n
  • etc..
  • \n
\n

Todo

\n
    \n
  • improve docs
  • \n
\n

Features

\n
    \n
  • provided as service and also as directive
  • \n
  • Super easy to set up
  • \n
  • No bloated dependencies
  • \n
  • Figures out sort order on its own
  • \n
  • A shadow where the item would be dropped offers visual feedback
  • \n
  • Touch events!
  • \n
\n

For installation, usage and examples go to docs

\n
\n
\n \n
\n \n
\n \n
\n'),e.put("partials/autogenerated/contribute.html",'

How to contribute

\n

It's important to us that you feel you can contribute towards the evolution of Dragular. This can take many forms: from helping to fix bugs or improve the docs, to adding in new features to the source. This guide should help you in making that process as smooth as possible.

\n

Before contributing, please read the code of conduct.

\n

Reporting issues

\n

GitHub Issues is the place to report bugs you may have found in either the core library or any of the examples that are part of the repository. When submitting a bug please do the following:

\n

1. Search for existing issues. Your bug may have already been fixed or addressed in a development branch version of Dragular, so be sure to search the issues first before putting in a duplicate issue.

\n

2. Not sure if it's a bug?. Then please ask via issues and tag it [question].

\n

3. Create an isolated and reproducible test case. If you are reporting a bug, make sure you also have a minimal, runnable, code example that reproduces the problem you have.

\n

4. Include a live example. After narrowing your code down to only the problem areas, make use of Codepen, jsBin, or a link to your live site so that we can view a live example of the problem. (you can start by forking this codepen)

\n

5. Share as much information as possible. Include browser version affected, your OS, version of the library, steps to reproduce, etc. "X isn't working!!!1!" will probably just be closed.

\n

Dev vs. Master

\n

The dev branch of Dragular is our 'current working' version. It is always ahead of the master branch in terms of features and fixes. However it's also bleeding-edge and experimental and we cannot and do not guarantee it will compile or work for you. Very often we have to break things for a few days while we rebuild and patch. So by all means please export the dev branch and contribute towards it, indeed that is where all Pull Requests should be sent, but do so understanding the API may change beneath you.

\n

Making Changes

\n

To take advantage of our npm build script and jshint config it will be easiest for you if you have node.js installed locally.

\n

You can download node.js from nodejs.org.

\n

After that you can clone the repository and run npm i inside the cloned folder. This will install dependencies necessary for building the project. For development workflow automation dragular uses gulp >= 3.9.0. Before starting development, make sure that gulp is installed on your machine globally: npm i -g gulp.

\n

Developing

\n

There are several gulp tasks that are used for generating different builds:

\n
    \n
  • gulp dev - Serves files with BrowserSync server, watches & automatically refreshes connected browsers on changes, generates non-minified but concatenated styles & scripts from the dragular source.
  • \n
  • gulp dev:docs - Does exactly the same as gulp dev, except it works with the documentation source.
  • \n
  • gulp build - Concatenates and minifies dragular source files.
  • \n
  • gulp build:docs - Concatenates and minifies documentation source files.
  • \n
\n

Linting

\n
    \n
  • gulp lint & gulp lint:docs - Lint JavaScript files.
  • \n
\n

Making a pull request

\n

Once that is ready, make your changes and submit a Pull Request:

\n
    \n
  • Send Pull Requests to the dev branch. All Pull Requests must be sent to the dev branch, master is the latest release and PRs to that branch will be closed.

    \n
  • \n
  • Ensure changes are jshint validated. Our JSHint configuration file is provided in the repository and you should check against it before submitting.

    \n
  • \n
  • Only commit relevant changes. Don't include changes that are not directly relevant to the fix you are making. The more focused a PR is, the faster it will get attention and be merged. Extra files changing only whitespace or trash files will likely get your PR closed.

    \n
  • \n
\n

Dependencies for building from source and running tests:

\n

Coding style preferences are not contributions

\n

If your PR is doing little more than changing the Dragular source code into a format / coding style that you prefer then we will automatically close it. All PRs must adhere to the coding style already set-out across the lines of code in Dragular. Your personal preferences for how things should "look" or be structured do not apply here, sorry. PRs should fix bugs, fix documentation or add features. No changes for the sake of change.

\n

I don't really like git / node.js, but I can fix this bug

\n

That is fine too. While Pull Requests are the best thing in the world for us, they are not the only way to help. You're welcome to post fixes to our forum or even just email them to us. All we ask is that you still adhere to the guidelines presented here re: JSHint, etc.

\n')}])}])}); //# sourceMappingURL=examples.min.js.map diff --git a/docs/dist/examples.min.js.map b/docs/dist/examples.min.js.map index e62fc2cc..b1e69570 100644 --- a/docs/dist/examples.min.js.map +++ b/docs/dist/examples.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["examples.js"],"names":["root","factory","exports","module","define","amd","a","i","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","dragular","angular","examplesRouter","BasicCtrl","BasicModelCtrl","BoundingBoxCtrl","BoundingBoxLockXCtrl","BoundingBoxLockYCtrl","CopyCtrl","CopyModelCtrl","CustomClassesCtrl","DifferentOptionsModelCtrl","DirectiveCtrl","DirectiveModelCtrl","DragOverEventsCtrl","EventsCtrl","HandleCtrl","IsContainerModelCtrl","NameSpacesCtrl","NestedNgRepeatCtrl","NestedNgRepeatWithModelCtrl","NgRepeatCtrl","NgRepeatFilteredWithModelCtrl","NgRepeatWithModelCtrl","RemoveOnSpillCtrl","RemoveOnSpillWithModelCtrl","RevertOnSpillCtrl","ScrollingDragCtrl","NestedRepeatsWithCustomDirective","config","controller","$scope","examplesList","template","link","title","highlightCode","document","getElementsByTagName","length","codeBlocks","hljs","highlightBlock","rowOffcanvas","toggleSidebar","element","getElementById","toggleClass","dragularDirective","dragularService","directive","restrict","iElm","iAttrs","tryJson","json","JSON","parse","e","options","$eval","dragularModel","containersModel","scope","dragularNameSpace","nameSpace","split","dragularOnInit","onInit","$inject","shared","classesCache","containersCtx","containers","mirror","source","item","copy","sourceItem","sourceModel","sourceFilteredModel","target","targetCtx","targetModel","lastDropTarget","offsetX","offsetY","moveX","moveY","offsetXr","offsetYb","clientX","clientY","mirrorWidth","mirrorHeight","initialSibling","currentSibling","initialIndex","currentIndex","tempModel","dragOverEvents","lastElementBehindCursor","grabbed","$rootScope","$compile","service","arg0","arg1","processServiceArguments","arguments","_isArray","isElement","initialContainers","querySelectorAll","o","copyOptions","extendOptions","tmp","extend","defaultOptions","classes","defaultClasses","eventNames","defaultEventNames","processOptionsObject","boundingBox","sanitizeContainers","containersFilteredModel","forEach","cont","len","getContainers","Error","indexOf","push","getContainersModel","fm","registerEvents","remove","op","regEvent","_docElm","release","container","grab","name","eventName","_doc","createEvent","initEvent","createEventObject","eventType","whichMouseButton","metaKey","ctrlKey","context","canStart","eventualMovements","type","isInput","focus","preventDefault","startBecauseMouseMoved","drake","dragging","originalEvent","g","ignoreInputTextSelection","getCoord","elementBehindCursor","elementFromPoint","movements","end","start","direction","getParent","parent","parentNode","parentHeight","offsetHeight","parentWidth","offsetWidth","childHeight","clientHeight","childWidth","clientWidth","offset","getOffset","left","top","right","bottom","renderMirrorImage","addClass","transit","style","drag","preventGrabbed","handle","isContainer","invalid","moves","nextEl","clone","$emit","dragularcloned","containerIndex","domIndexOf","dragulardrag","manualStart","rect","getBoundingClientRect","cloneNode","width","height","getRectWidth","getRectHeight","mirrorContainer","appendChild","body","unselectable","scrollContainer","drop","ungrab","moved","notify","removeOnSpill","spillOver","spillOut","pageX","pageY","offsetBox","x","y","lockY","lockX","getElementBehindPoint","dropTarget","findDropTarget","changed","fireEvent","dragularenter","dragularleave","copySortSource","removeChild","reference","immediate","getImmediateChild","getReference","revertOnSpill","insertBefore","dragularshadow","accepted","initial","isInitialPlacement","getTargetCtx","_isFunction","accepts","isContainerAccepts","canBeAccepted","rmClass","hide","s","sibling","undefined","outside","el","children","horizontal","inside","resolve","after","point","state","className","isContainerModel","opt","_getContainers","containersType","to2d","cancel","revert","reverts","dragularcancel","cleanup","dragularrelease","afterDrop","dragulardrop","dropIndex","compileItemOnDrop","$applyAsync","content","splice","dropElmModel","dontCopyModel","dragularremove","removeMirrorImage","dragularout","dragulardragend","destroy","removeContainers","makeArray","index","addContainers","before","scrollTop","deltaY","stopPropagation","depSanitize","getBool","dragularover","never","getEmptyArray","always","sanitizeContainersModel","evaluated","fn","touch","mouseup","mousedown","mousemove","pointers","microsoft","$el","addEventListener","opConvert","on","off","passive","navigator","pointerEnabled","msPointerEnabled","all","startIndex","Array","prototype","slice","touches","which","buttons","button","getScroll","scrollProp","offsetProp","window","scrollLeft","manually","nextSibling","nodeType","nextElementSibling","obj","HTMLElement","nodeName","lookupClass","cached","lastIndex","RegExp","current","test","replace","trim","getEventHost","targetTouches","changedTouches","coord","host","missMap","tagName","isEditable","contentEditable","child","extra","dispatchEvent","prop","args","apply","documentElement","isArray","isFunction","cleanEnviroment","$stateProvider","$urlRouterProvider","otherwise","timer","ctrl","$state","$stateParams","$timeout","go","url","templateUrl","$element","items1","items2","eq","containerLeft","querySelector","containerRight","dragularOptions","parentElement","removeClass","notContainer","getElementsByClassName","myFn","$on","Events2Ctrl","classList","contains","cartModel","removeItem","items","parentContainers","nestedContainers","addItem","$filter","filter1query","filter2query","filteredModel1","filteredModel2","getFilteredModel","filteredModel","filterQuery","$interval","bar","inc","speed","leftScrollContainer","rightScrollContainer","leftTopBar","leftBottomBar","rightTopBar","rightBottomBar","questions","text","points","order","age","QuestionsDirective","question","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FpE,QAAQjB,OAAO,eACbkE,UAAU,oBAAqBmY,GAC/BvZ,WAAW,sBAAuByZ,GAEpCvc,EAAOD,QAAU6C,GAgLZ,SAAU5C,EAAQD,GAEvB,YAAcC,GAAOD,QAAUkB,QAAQjB,OAAO,gBAAiBwc,KAAK,iBAAkB,SAASC,GAAiBA,EAAeC,IAAI,+BAA+B,2sBAClKD,EAAeC,IAAI,iCAAiC,s7DACpDD,EAAeC,IAAI,mDAAmD,+9EACtED,EAAeC,IAAI,6CAA6C,08BAChED,EAAeC,IAAI,uDAAuD,ihCAC1ED,EAAeC,IAAI,uDAAuD,2/BAC1ED,EAAeC,IAAI,+BAA+B,m2CAClDD,EAAeC,IAAI,iDAAiD,k9EACpED,EAAeC,IAAI,iDAAiD,svCACpED,EAAeC,IAAI,yEAAyE,wtGAC5FD,EAAeC,IAAI,yCAAyC,67DAC5DD,EAAeC,IAAI,2DAA2D,4xEAC9ED,EAAeC,IAAI,mDAAmD,o3JACtED,EAAeC,IAAI,mCAAmC;AACtDD,EAAeC,IAAI,mCAAmC,6pBACtDD,EAAeC,IAAI,+DAA+D,0sGAClFD,EAAeC,IAAI,2CAA2C,gjEAC9DD,EAAeC,IAAI,mDAAmD,+wFACtED,EAAeC,IAAI,qEAAqE,85HACxFD,EAAeC,IAAI,uFAAuF,gfAC1GD,EAAeC,IAAI,uCAAuC,i+BAC1DD,EAAeC,IAAI,yEAAyE,q/JAC5FD,EAAeC,IAAI,yDAAyD,slEAC5ED,EAAeC,IAAI,iDAAiD,8kCACpED,EAAeC,IAAI,mEAAmE,ujFACtFD,EAAeC,IAAI,iDAAiD,osCACpED,EAAeC,IAAI,iDAAiD,+3IACpED,EAAeC,IAAI,mCAAmC;AACtDD,EAAeC,IAAI,6BAA6B,syBAChDD,EAAeC,IAAI,6BAA6B,yuGAChDD,EAAeC,IAAI,yCAAyC","file":"examples.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n\n\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* global angular, hljs */\n\t'use strict';\n\n\t// var angular = require('angular');\n\n\tvar dragular = __webpack_require__(1);\n\n\tangular\n\t\t.module('examplesApp', [dragular, 'templates', 'ui.router']);\n\n\tvar examplesRouter = __webpack_require__(4);\n\tvar BasicCtrl = __webpack_require__(5);\n\tvar BasicModelCtrl = __webpack_require__(6);\n\tvar BoundingBoxCtrl = __webpack_require__(7);\n\tvar BoundingBoxLockXCtrl = __webpack_require__(8);\n\tvar BoundingBoxLockYCtrl = __webpack_require__(9);\n\tvar CopyCtrl = __webpack_require__(10);\n\tvar CopyModelCtrl = __webpack_require__(11);\n\tvar CustomClassesCtrl = __webpack_require__(12);\n\tvar DifferentOptionsModelCtrl = __webpack_require__(13);\n\tvar DirectiveCtrl = __webpack_require__(14);\n\tvar DirectiveModelCtrl = __webpack_require__(15);\n\tvar DragOverEventsCtrl = __webpack_require__(16);\n\tvar EventsCtrl = __webpack_require__(17);\n\tvar HandleCtrl = __webpack_require__(18);\n\tvar IsContainerModelCtrl = __webpack_require__(19);\n\tvar NameSpacesCtrl = __webpack_require__(20);\n\tvar NestedNgRepeatCtrl = __webpack_require__(21);\n\tvar NestedNgRepeatWithModelCtrl = __webpack_require__(22);\n\tvar NgRepeatCtrl = __webpack_require__(23);\n\tvar NgRepeatFilteredWithModelCtrl = __webpack_require__(24);\n\tvar NgRepeatWithModelCtrl = __webpack_require__(25);\n\tvar RemoveOnSpillCtrl = __webpack_require__(26);\n\tvar RemoveOnSpillWithModelCtrl = __webpack_require__(27);\n\tvar RevertOnSpillCtrl = __webpack_require__(28);\n\tvar ScrollingDragCtrl = __webpack_require__(29);\n\tvar NestedRepeatsWithCustomDirective = __webpack_require__(30);\n\t__webpack_require__(31);\n\n\t/**\n\t * Module Example App\n\t *\n\t * DEMO app for dragular https://github.com/luckylooke/dragular\n\t */\n\n\tangular\n\t .module('examplesApp')\n\t .config(examplesRouter)\n\t .controller('Basic', BasicCtrl)\n\t .controller('BasicModel', BasicModelCtrl)\n\t .controller('BoundingBox', BoundingBoxCtrl)\n\t .controller('BoundingBoxLockX', BoundingBoxLockXCtrl)\n\t .controller('BoundingBoxLockY', BoundingBoxLockYCtrl)\n\t .controller('Copy', CopyCtrl)\n\t .controller('CopyModel', CopyModelCtrl)\n\t .controller('CustomClasses', CustomClassesCtrl)\n\t .controller('DifferentOptionsModel', DifferentOptionsModelCtrl)\n\t .controller('Directive', DirectiveCtrl)\n\t .controller('DirectiveModel', DirectiveModelCtrl)\n\t .controller('DragOverEvents', DragOverEventsCtrl)\n\t .controller('Events', EventsCtrl[0])\n\t .controller('Events2', EventsCtrl[1])\n\t .controller('Handle', HandleCtrl)\n\t .controller('IsContainerModel', IsContainerModelCtrl)\n\t .controller('NameSpaces', NameSpacesCtrl)\n\t .controller('NestedNgRepeat', NestedNgRepeatCtrl)\n\t .controller('NestedNgRepeatWithModel', NestedNgRepeatWithModelCtrl)\n\t .controller('NgRepeat', NgRepeatCtrl)\n\t .controller('NgRepeatFilteredWithModel', NgRepeatFilteredWithModelCtrl)\n\t .controller('NgRepeatWithModel', NgRepeatWithModelCtrl)\n\t .controller('RemoveOnSpill', RemoveOnSpillCtrl)\n\t .controller('RemoveOnSpillWithModel', RemoveOnSpillWithModelCtrl)\n\t .controller('RevertOnSpill', RevertOnSpillCtrl)\n\t .controller('ScrollingDrag', ScrollingDragCtrl)\n\t .controller('NestedRepeatsWithCustomDirective', NestedRepeatsWithCustomDirective)\n\t .controller('ExAppCtrl', ['$scope', function($scope) {\n\t $scope.examplesList = [{\n\t template: 'docsInstall/docsInstall.html',\n\t link: 'docsInstall',\n\t title: 'Installation'\n\t },{\n\t template: 'exampleBasic/exampleBasic.html',\n\t link: 'exampleBasic',\n\t title: 'Basic'\n\t },{\n\t template: 'exampleBasicWithModel/exampleBasicWithModel.html',\n\t link: 'exampleBasicWithModel',\n\t title: 'Basic - with model'\n\t },{\n\t template: 'exampleDifferentOptionsWithModel/exampleDifferentOptionsWithModel.html',\n\t link: 'exampleDifferentOptionsWithModel',\n\t title: 'Different options - with model'\n\t }, {\n\t template: 'exampleDirective/exampleDirective.html',\n\t link: 'exampleDirective',\n\t title: 'Directive'\n\t }, {\n\t template: 'exampleDirectiveWithModel/exampleDirectiveWithModel.html',\n\t link: 'exampleDirectiveWithModel',\n\t title: 'Directive - with model'\n\t }, {\n\t template: 'exampleEvents/exampleEvents.html',\n\t link: 'exampleEvents',\n\t title: 'Events'\n\t }, {\n\t template: 'exampleRemoveOnSpill/exampleRemoveOnSpill.html',\n\t link: 'exampleRemoveOnSpill',\n\t title: 'Remove on spill'\n\t }, {\n\t template: 'exampleRemoveOnSpillWithModel/exampleRemoveOnSpillWithModel.html',\n\t link: 'exampleRemoveOnSpillWithModel',\n\t title: 'Remove on spill - with model'\n\t }, {\n\t template: 'exampleRevertOnSpill/exampleRevertOnSpill.html',\n\t link: 'exampleRevertOnSpill',\n\t title: 'Revert on spill'\n\t }, {\n\t template: 'exampleCopy/exampleCopy.html',\n\t link: 'exampleCopy',\n\t title: 'Copy'\n\t }, {\n\t template: 'exampleCopyWithModel/exampleCopyWithModel.html',\n\t link: 'exampleCopyWithModel',\n\t title: 'Copy - with model'\n\t }, {\n\t template: 'exampleHandle/exampleHandle.html',\n\t link: 'exampleHandle',\n\t title: 'Handle'\n\t }, {\n\t template: 'exampleIsContainerWithModel/exampleIsContainerWithModel.html',\n\t link: 'exampleIsContainerWithModel',\n\t title: 'isContainer - with model'\n\t }, {\n\t template: 'exampleCustomClasses/exampleCustomClasses.html',\n\t link: 'exampleCustomClasses',\n\t title: 'Custom classes'\n\t }, {\n\t template: 'exampleNameSpaces/exampleNameSpaces.html',\n\t link: 'exampleNameSpaces',\n\t title: 'NameSpaces'\n\t }, {\n\t template: 'exampleDragOverEvents/exampleDragOverEvents.html',\n\t link: 'exampleDragOverEvents',\n\t title: 'Drag-over events'\n\t }, {\n\t template: 'exampleBoundingBox/exampleBoundingBox.html',\n\t link: 'exampleBoundingBox',\n\t title: 'BoundingBox'\n\t }, {\n\t template: 'exampleBoundingBoxLockX/exampleBoundingBoxLockX.html',\n\t link: 'exampleBoundingBoxLockX',\n\t title: 'BoundingBox + LockX'\n\t }, {\n\t template: 'exampleBoundingBoxLockY/exampleBoundingBoxLockY.html',\n\t link: 'exampleBoundingBoxLockY',\n\t title: 'BoundingBox + LockY'\n\t }, {\n\t template: 'exampleNgRepeat/exampleNgRepeat.html',\n\t link: 'exampleNgRepeat',\n\t title: 'ngRepeat'\n\t }, {\n\t template: 'exampleNgRepeatWithModel/exampleNgRepeatWithModel.html',\n\t link: 'exampleNgRepeatWithModel',\n\t title: 'ngRepeat - with model'\n\t }, {\n\t template: 'exampleNgRepeatFilteredWithModel/exampleNgRepeatFilteredWithModel.html',\n\t link: 'exampleNgRepeatFilteredWithModel',\n\t title: 'Filtered ngRepeat - with model'\n\t }, {\n\t template: 'exampleNestedNgRepeat/exampleNestedNgRepeat.html',\n\t link: 'exampleNestedNgRepeat',\n\t title: 'Nested ngRepead'\n\t }, {\n\t template: 'exampleNestedNgRepeatWithModel/exampleNestedNgRepeatWithModel.html',\n\t link: 'exampleNestedNgRepeatWithModel',\n\t title: 'Nested ngRepead - with model'\n\t }, {\n\t template: 'exampleScrollingDrag/exampleScrollingDrag.html',\n\t link: 'exampleScrollingDrag',\n\t title: 'Scrolling drag'\n\t }, {\n\t template: 'exampleSNestedRepeatsWithCustomDirective/exampleNestedRepeatsWithCustomDirective.html',\n\t link: 'exampleNestedRepeatsWithCustomDirective',\n\t title: 'Nested repeats with custom directive'\n\t }];\n\n\t $scope.highlightCode = function () {\n\t if(document.getElementsByTagName('code').length){\n\t var codeBlocks = document.getElementsByTagName('code');\n\t for (var i = codeBlocks.length - 1; i >= 0; i--) {\n\t hljs.highlightBlock(codeBlocks[i]);\n\t }\n\t }\n\t };\n\n\t var rowOffcanvas;\n\t $scope.toggleSidebar = function toggleSidebar () {\n\t if(!rowOffcanvas){\n\t rowOffcanvas = angular.element(document.getElementById('rowOffcanvas'));\n\t }\n\t rowOffcanvas.toggleClass('active');\n\t };\n\n\t }]);\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* global angular */\n\t'use strict';\n\tvar dragularDirective = __webpack_require__( 2 );\n\tvar dragularService = __webpack_require__( 3 );\n\n\t/**\n\t * Dragular 4.4.6 by Luckylooke https://github.com/luckylooke/dragular\n\t * Angular version of dragula https://github.com/bevacqua/dragula\n\t */\n\tmodule.exports = 'dragularModule';\n\n\tangular\n\t\t.module( 'dragularModule', [] )\n\t\t.factory( 'dragularService', dragularService )\n\t\t.directive( 'dragular', dragularDirective );\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\t/**\n\t * dragular Directive by Luckylooke https://github.com/luckylooke/dragular\n\t * Angular version of dragula https://github.com/bevacqua/dragula\n\t */\n\n\tvar dragular = function ( dragularService ) {\n\t\treturn {\n\t\t\trestrict: 'A',\n\t\t\tlink: function ( $scope, iElm, iAttrs ) {\n\n\t\t\t\tvar options = $scope.$eval( iAttrs.dragular ) || tryJson( iAttrs.dragular ) || {};\n\n\t\t\t\tfunction tryJson( json ) {\n\t\t\t\t\ttry { // I dont like try catch solutions but I havent find sattisfying way of chcecking json validity.\n\t\t\t\t\t\treturn JSON.parse( json );\n\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( iAttrs.dragularModel ) {\n\t\t\t\t\toptions.containersModel = iAttrs.dragularModel;\n\t\t\t\t\tif ( !options.scope ){\n\t\t\t\t\t\toptions.scope = $scope;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( iAttrs.dragularNameSpace ) {\n\t\t\t\t\toptions.nameSpace = iAttrs.dragularNameSpace.split( ' ' );\n\t\t\t\t}\n\n\t\t\t\tif ( iAttrs.dragularOnInit ) {\n\t\t\t\t\toptions.onInit = $scope.$eval( iAttrs.dragularOnInit );\n\t\t\t\t}\n\n\t\t\t\tdragularService( iElm[ 0 ], options );\n\t\t\t}\n\t\t};\n\t};\n\n\tdragular.$inject = [ 'dragularService' ];\n\n\tmodule.exports = dragular;\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n\t/* global angular */\n\t'use strict';\n\n\t/**\n\t * dragular Service by Luckylooke https://github.com/luckylooke/dragular\n\t * Angular version of dragula https://github.com/bevacqua/dragula\n\t */\n\n\tvar shared = { // sahred object between all service instances\n\t\tclassesCache: {}, // classes lookup cache\n\t\tcontainersCtx: {}, // containers model\n\t\tcontainers: {}, // containers\n\t\tmirror: null, // mirror image\n\t\tsource: null, // source container\n\t\titem: null, // item being dragged\n\t\tcopy: null, // copy flag\n\t\tsourceItem: null, // item originaly dragged if copy is enabled\n\t\tsourceModel: null, // source container model\n\t\tsourceFilteredModel: null, // source container filtered model if relevant\n\t\ttarget: null, // droppable container under drag item\n\t\ttargetCtx: null, // target container context\n\t\ttargetModel: null, // target container model\n\t\tlastDropTarget: null, // last container item was over\n\t\toffsetX: null, // reference x\n\t\toffsetY: null, // reference y\n\t\tmoveX: null, // reference move x\n\t\tmoveY: null, // reference move y\n\t\toffsetXr: null, // reference x right for boundingBox feature\n\t\toffsetYb: null, // reference y bottom for boundingBox feature\n\t\tclientX: null, // cache client x, init at grab, update at drag\n\t\tclientY: null, // cache client y, init at grab, update at drag\n\t\tmirrorWidth: null, // mirror width for boundingBox feature\n\t\tmirrorHeight: null, // mirror height for boundingBox feature\n\t\tinitialSibling: null, // reference sibling when grabbed\n\t\tcurrentSibling: null, // reference sibling now\n\t\tinitialIndex: null, // reference model index when grabbed\n\t\tcurrentIndex: null, // reference model index now\n\t\ttempModel: null, // if o.isContainer is used, model can be provided as well, it is temporary saved here during drags\n\t\tdragOverEvents: {}, // drag over events fired on element behind cursor\n\t\tlastElementBehindCursor: null, // last element behind cursor\n\t\tgrabbed: null // holds mousedown context until first mousemove\n\t};\n\n\tvar dragularService = function ( $rootScope, $compile ) {\n\n\t\t// abbreviations\n\t\tvar _doc = document,\n\t\t\t_docElm = _doc.documentElement,\n\t\t\t_isArray = Array.isArray,\n\t\t\t_isFunction = angular.isFunction;\n\n\t\t// clean common/shared objects\n\t\tservice.cleanEnviroment = function cleanEnviroment() {\n\t\t\tshared.classesCache = {};\n\t\t\tshared.containersCtx = {};\n\t\t\tshared.containers = {};\n\t\t\tshared.mirror = undefined;\n\t\t};\n\n\t\tservice.shared = shared;\n\n\t\treturn service;\n\n\t\t// service definition\n\t\tfunction service( arg0, arg1 ) {\n\n\t\t\t// console.log('dragularService arg0, arg1', arg0, arg1);\n\n\t\t\tvar initialContainers = arg0 || [],\n\t\t\t\toptions = arg1 || {},\n\t\t\t\to, // shorthand for options\n\t\t\t\tg = getBool, // shorthand for getBool\n\n\t\t\t\t// defaults\n\t\t\t\tdefaultClasses = {\n\t\t\t\t\tmirror: 'gu-mirror',\n\t\t\t\t\thide: 'gu-hide',\n\t\t\t\t\tunselectable: 'gu-unselectable',\n\t\t\t\t\ttransit: 'gu-transit'\n\t\t\t\t},\n\t\t\t\tdefaultEventNames = {\n\t\t\t\t\t// drag-over DOM events\n\t\t\t\t\tdragularenter: 'dragularenter',\n\t\t\t\t\tdragularleave: 'dragularleave',\n\t\t\t\t\tdragularrelease: 'dragularrelease',\n\t\t\t\t\t// $scope events\n\t\t\t\t\tdragularcloned: 'dragularcloned',\n\t\t\t\t\tdragulardrag: 'dragulardrag',\n\t\t\t\t\tdragularcancel: 'dragularcancel',\n\t\t\t\t\tdragulardrop: 'dragulardrop',\n\t\t\t\t\tdragularremove: 'dragularremove',\n\t\t\t\t\tdragulardragend: 'dragulardragend',\n\t\t\t\t\tdragularshadow: 'dragularshadow',\n\t\t\t\t\tdragularover: 'dragularover',\n\t\t\t\t\tdragularout: 'dragularout'\n\t\t\t\t},\n\t\t\t\tdefaultOptions = { // options with defaults\n\t\t\t\t\tcopyOptions: false, // copy options object when provided\n\t\t\t\t\tclasses: defaultClasses, // classes used by dragular\n\t\t\t\t\teventNames: defaultEventNames, // event names used by dragular\n\t\t\t\t\tcontainers: false, // initial containers provided via options object (are provided via parameter by default)\n\t\t\t\t\tcontainersModel: false, // if provided, model will be synced with DOM\n\t\t\t\t\tcontainersFilteredModel: false, // if provided, dragular will handle filtered model cases\n\t\t\t\t\tisContainer: never, // potential target can be forced to be container by custom logic\n\t\t\t\t\tisContainerModel: getEmptyArray, // if isContainer function is provided, you can provide also respective model\n\t\t\t\t\tisContainerAccepts: always, // if isContainer function is provided, you can provide also respective accept function\n\t\t\t\t\tmoves: always, // can drag start?\n\t\t\t\t\taccepts: always, // can target accept dragged item? (target context used)\n\t\t\t\t\tcanBeAccepted: always, // can be dragged item accepted by target? (source context used)\n\t\t\t\t\tcopy: false, // dragged item will be copy of source? flag or function\n\t\t\t\t\tcopySortSource: false, // enable sorting in source when copying item\n\t\t\t\t\tdontCopyModel: false, // dont make copy of model when coping item (#61)\n\t\t\t\t\tinvalid: never, // target (in)validity function\n\t\t\t\t\trevertOnSpill: false, // item returns to original place\n\t\t\t\t\tremoveOnSpill: false, // item will be removed if not placed into valid target\n\t\t\t\t\tlockX: false, // lock movement into x-axis\n\t\t\t\t\tlockY: false, // lock movement into y-axis\n\t\t\t\t\tboundingBox: false, // lock movement inside this element boundaries\n\t\t\t\t\tmirrorContainer: _doc.body, // element for appending mirror\n\t\t\t\t\tignoreInputTextSelection: true, // text selection in inputs wont be considered as drag\n\t\t\t\t\tcompileItemOnDrop: false,\n\t\t\t\t\tonInit: false // function callback called after dragular initialisation and providing drake as first argument\n\t\t\t\t},\n\n\t\t\t\tdrake = {\n\t\t\t\t\tcontainers: shared.containers, // all containers\n\t\t\t\t\tcontainersCtx: shared.containersCtx, // all contexts to containers\n\t\t\t\t\tsanitizeContainersModel: depSanitize,\n\t\t\t\t\tsanitizeContainers: sanitizeContainers,\n\t\t\t\t\taddContainers: addContainers,\n\t\t\t\t\tremoveContainers: removeContainers,\n\t\t\t\t\tisContainer: isContainer,\n\t\t\t\t\tstart: manualStart,\n\t\t\t\t\tend: end,\n\t\t\t\t\tcancel: cancel,\n\t\t\t\t\tremove: remove,\n\t\t\t\t\tdestroy: destroy,\n\t\t\t\t\tdragging: false\n\t\t\t\t};\n\n\t\t\tprocessServiceArguments(); // both arguments (containers and options) are optional, this function handle this\n\t\t\textendOptions();\n\t\t\tprocessOptionsObject();\n\t\t\tregisterEvents();\n\n\t\t\tif ( o.onInit ) {\n\t\t\t\to.onInit( drake, o );\n\t\t\t}\n\t\t\treturn drake;\n\n\n\t\t\t// Function definitions: ==============================================================================================================\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Dragular service init functions: ---------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction processServiceArguments() {\n\n\t\t\t\tif ( arguments.length === 1 && // if there is only one argument we need to distinguish if it is options object or container(s) reference\n\n\t\t\t\t\t!_isArray( arg0 ) && // array of containers elements\n\t\t\t\t\t!angular.isElement( arg0 ) && // one container element\n\t\t\t\t\t!arg0[ 0 ] && // array-like object with containers elements\n\t\t\t\t\ttypeof arg0 !== 'string' ) { // selector\n\t\t\t\t\t// then arg0 is options object\n\t\t\t\t\toptions = arg0 || {};\n\t\t\t\t\tinitialContainers = []; // containers are not provided on init\n\t\t\t\t}\n\t\t\t\telse if ( typeof arg0 === 'string' ) {\n\n\t\t\t\t\tinitialContainers = document.querySelectorAll( arg0 );\n\t\t\t\t}\n\n\t\t\t\to = options.copyOptions ? angular.copy( options ) : options;\n\t\t\t}\n\n\t\t\tfunction extendOptions() {\n\n\t\t\t\tvar tmp = angular.extend( {}, defaultOptions, o ); // tmp for keeping defaults untouched\n\t\t\t\tangular.extend( o, tmp ); // merge defaults back into options\n\n\t\t\t\tif ( o.classes ) {\n\n\t\t\t\t\ttmp = angular.extend( {}, defaultClasses, o.classes );\n\t\t\t\t\tangular.extend( o.classes, tmp );\n\t\t\t\t}\n\n\t\t\t\tif ( o.eventNames ) {\n\n\t\t\t\t\ttmp = angular.extend( {}, defaultEventNames, o.eventNames );\n\t\t\t\t\tangular.extend( o.eventNames, tmp );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction processOptionsObject() {\n\n\t\t\t\t// bounding box must be pure DOM element, not jQuery wrapper or something else..\n\t\t\t\tif ( !isElement( o.boundingBox ) ) {\n\t\t\t\t\to.boundingBox = false;\n\t\t\t\t}\n\n\t\t\t\t// initial containers provided via options are higher priority then by parameter\n\t\t\t\tif ( o.containers ) {\n\t\t\t\t\tinitialContainers = o.containers;\n\t\t\t\t}\n\n\t\t\t\t// sanitize initialContainers\n\t\t\t\to.containers = sanitizeContainers( initialContainers, false, o.scope );\n\n\t\t\t\t// sanitize o.containersModel\n\t\t\t\to.containersModel = sanitizeContainers( o.containersModel, true, o.scope );\n\n\t\t\t\t// sanitize o.containersFilteredModel\n\t\t\t\tif ( _isArray( o.containersFilteredModel ) ) {\n\t\t\t\t\t// |-------- is 2D array? -----------|\n\t\t\t\t\to.containersFilteredModel = _isArray( o.containersFilteredModel[ 0 ] ) ? o.containersFilteredModel : [ o.containersFilteredModel ];\n\t\t\t\t} else {\n\t\t\t\t\to.containersFilteredModel = [];\n\t\t\t\t}\n\n\t\t\t\t// feed containers groups and optionaly do same for models\n\t\t\t\tif ( !o.nameSpace ) {\n\t\t\t\t\to.nameSpace = [ 'dragularCommon' ];\n\t\t\t\t}\n\n\t\t\t\tif ( !_isArray( o.nameSpace ) ) {\n\t\t\t\t\to.nameSpace = [ o.nameSpace ];\n\t\t\t\t}\n\n\t\t\t\to.nameSpace.forEach( function eachNameSpace( nameSpace ) {\n\n\t\t\t\t\tif ( !shared.containers[ nameSpace ] ) {\n\n\t\t\t\t\t\tshared.containers[ nameSpace ] = [];\n\t\t\t\t\t\tshared.containersCtx[ nameSpace ] = [];\n\t\t\t\t\t}\n\n\t\t\t\t\tvar len = getContainers( o ).length,\n\t\t\t\t\t\tcont;\n\n\t\t\t\t\tfor ( var i = 0; i < len; i++ ) {\n\n\t\t\t\t\t\tcont = getContainers( o )[ i ];\n\n\t\t\t\t\t\tif (!cont) {\n\t\t\t\t\t\t\tthrow new Error( 'Container element must be defined!' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (shared.containers[ nameSpace ].indexOf(cont) !== -1) {\n\t\t\t\t\t\t\tthrow new Error( 'Cannot register container element more than once! Container element: ' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tshared.containers[ nameSpace ].push(cont);\n\t\t\t\t\t\tshared.containersCtx[ nameSpace ].push({\n\t\t\t\t\t\t\to: o,\n\t\t\t\t\t\t\tm: getContainersModel( o )[ i ], // can be undefined\n\t\t\t\t\t\t\tfm: o.containersFilteredModel[ i ] // can be undefined\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tfunction registerEvents( remove ) {\n\t\t\t\tvar op = remove ? 'off' : 'on';\n\t\t\t\tregEvent( _docElm, op, 'mouseup', release );\n\n\t\t\t\tgetContainers( o ).forEach( function addMouseDown( container ) {\n\t\t\t\t\tregEvent( container, 'on', 'mousedown', grab );\n\t\t\t\t} );\n\n\t\t\t\tif ( !remove ) { // create dragular DOM events\n\t\t\t\t\tangular.forEach( [ 'dragularenter', 'dragularleave', 'dragularrelease' ], function prepareDragOverEvents( name ) {\n\t\t\t\t\t\tvar eventName = o.eventNames[ name ];\n\t\t\t\t\t\tif ( !shared.dragOverEvents[ eventName ] ) {\n\t\t\t\t\t\t\tif ( _doc.createEvent ) {\n\t\t\t\t\t\t\t\tshared.dragOverEvents[ eventName ] = _doc.createEvent( 'HTMLEvents' );\n\t\t\t\t\t\t\t\tshared.dragOverEvents[ eventName ].initEvent( eventName, true, true );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tshared.dragOverEvents[ eventName ] = _doc.createEventObject();\n\t\t\t\t\t\t\t\tshared.dragOverEvents[ eventName ].eventType = eventName;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Grab stage: ------------------------------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction grab( e ) {\n\n\t\t\t\t// filter some odd situations\n\t\t\t\tif ( whichMouseButton( e ) !== 1 || e.metaKey || e.ctrlKey ) {\n\t\t\t\t\treturn; // we only care about honest-to-god left clicks and touch events\n\t\t\t\t}\n\n\t\t\t\t// set itial values\n\t\t\t\tshared.moveX = e.clientX;\n\t\t\t\tshared.moveY = e.clientY;\n\n\t\t\t\tvar context = canStart( e.target );\n\t\t\t\tif ( !context || !context.item ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tshared.grabbed = context;\n\t\t\t\teventualMovements();\n\t\t\t\tif ( e.type === 'mousedown' ) {\n\t\t\t\t\tif ( isInput( e.target ) ) { // see also: https://github.com/bevacqua/dragula/issues/208\n\t\t\t\t\t\te.target.focus(); // fixes https://github.com/bevacqua/dragula/issues/176\n\t\t\t\t\t\t// changed from context.item to e.target fixing https://github.com/luckylooke/dragular/issues/87#issuecomment-256865796\n\t\t\t\t\t} else {\n\t\t\t\t\t\te.preventDefault(); // fixes https://github.com/bevacqua/dragula/issues/155\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction eventualMovements( remove ) {\n\n\t\t\t\tvar op = remove ? 'off' : 'on';\n\t\t\t\tregEvent( _docElm, op, 'mousemove', startBecauseMouseMoved );\n\t\t\t}\n\n\t\t\tfunction startBecauseMouseMoved( e ) {\n\n\t\t\t\tif ( !shared.grabbed || drake.dragging ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( e.originalEvent ) {\n\t\t\t\t\te = e.originalEvent; // jQuery enviroment\n\t\t\t\t}\n\n\t\t\t\tif ( whichMouseButton( e ) === 0 ) {\n\t\t\t\t\trelease( {} );\n\t\t\t\t\treturn; // when text is selected on an input and then dragged, mouseup doesn't fire. this is our only hope\n\t\t\t\t}\n\n\t\t\t\t// truthy check fixes dragula-#239, equality fixes dragula-#207\n\t\t\t\tif ( e.clientX && e.clientX === shared.moveX && e.clientY && e.clientY === shared.moveY ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( g( o.ignoreInputTextSelection ) ) {\n\n\t\t\t\t\tvar clientX = getCoord( 'clientX', e ),\n\t\t\t\t\t\tclientY = getCoord( 'clientY', e ),\n\t\t\t\t\t\telementBehindCursor = _doc.elementFromPoint( clientX, clientY );\n\t\t\t\t\tif ( isInput( elementBehindCursor ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar grabbed = shared.grabbed; // calling end() unsets shared.grabbed\n\t\t\t\teventualMovements( 'remove' ); // remove mousemove listener\n\t\t\t\tmovements();\n\t\t\t\tend();\n\t\t\t\tstart( grabbed );\n\n\t\t\t\tif ( !shared.item ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// automaticly detect direction of elements if not set in options\n\t\t\t\tif ( !o.direction && getParent( shared.sourceItem ) ) {\n\t\t\t\t\tvar parent = shared.sourceItem.parentNode,\n\t\t\t\t\t\tparentHeight = parent.offsetHeight,\n\t\t\t\t\t\tparentWidth = parent.offsetWidth,\n\t\t\t\t\t\tchildHeight = shared.sourceItem.clientHeight,\n\t\t\t\t\t\tchildWidth = shared.sourceItem.clientWidth;\n\t\t\t\t\to.direction = parentHeight / childHeight < parentWidth / childWidth ? 'horizontal' : 'vertical';\n\t\t\t\t}\n\n\t\t\t\t// get initial coordinates, used to render shared.mirror for first time\n\t\t\t\tvar offset = getOffset( shared.sourceItem );\n\t\t\t\tshared.offsetX = getCoord( 'pageX', e ) - offset.left;\n\t\t\t\tshared.offsetY = getCoord( 'pageY', e ) - offset.top;\n\t\t\t\tshared.clientX = getCoord( 'clientX', e );\n\t\t\t\tshared.clientY = getCoord( 'clientY', e );\n\n\t\t\t\t// limiting area of shared.mirror movement, get initial coordinates\n\t\t\t\tif ( o.boundingBox ) {\n\t\t\t\t\tshared.offsetXr = getCoord( 'pageX', e ) - offset.right;\n\t\t\t\t\tshared.offsetYb = getCoord( 'pageY', e ) - offset.bottom;\n\t\t\t\t}\n\n\t\t\t\te.preventDefault();\n\n\t\t\t\trenderMirrorImage();\n\t\t\t\taddClass( shared.item, o.classes.transit );\n\t\t\t\t// initial position\n\t\t\t\tshared.mirror.style.left = shared.clientX - shared.offsetX + 'px';\n\t\t\t\tshared.mirror.style.top = shared.clientY - shared.offsetY + 'px';\n\n\t\t\t\tdrag( e );\n\t\t\t}\n\n\t\t\tfunction movements( remove ) {\n\n\t\t\t\tvar op = remove ? 'off' : 'on';\n\t\t\t\tregEvent( _docElm, op, 'selectstart', preventGrabbed ); // IE8\n\t\t\t\tregEvent( _docElm, op, 'click', preventGrabbed );\n\t\t\t\tregEvent( _docElm, op, 'touchmove', preventGrabbed ); // fixes touch devices scrolling while drag\n\t\t\t}\n\n\t\t\tfunction canStart( item ) {\n\t\t\t\tif ( drake.dragging && shared.mirror ) {\n\t\t\t\t\treturn; // already dragging\n\t\t\t\t}\n\n\t\t\t\tvar handle = item;\n\t\t\t\twhile ( getParent( item ) && !isContainer( getParent( item ) ) ) {\n\t\t\t\t\t// break loop if user tries to drag item which is considered invalid handle\n\t\t\t\t\tif ( o.invalid( item, handle ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\titem = getParent( item ); // drag target should be immediate child of container\n\t\t\t\t\tif ( !item ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar source = getParent( item );\n\t\t\t\tif ( !source ||\n\t\t\t\t\to.invalid( item, handle ) || !o.moves( item, source, handle, nextEl( item ) ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\titem: item,\n\t\t\t\t\tsource: source\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tfunction start( context ) {\n\t\t\t\tshared.sourceItem = shared.item = context.item;\n\t\t\t\tshared.source = context.source;\n\t\t\t\tshared.initialSibling = shared.currentSibling = nextEl( context.item );\n\n\t\t\t\tif ( g( o.copy, [ context.item, context.source ] ) ) {\n\t\t\t\t\t// http://api.jquery.com/clone/#clone-withDataAndEvents-deepWithDataAndEvents\n\t\t\t\t\tshared.item = angular.element( context.item ).clone( o.copy === 'events', o.copy === 'events' )[0];\n\t\t\t\t\tshared.copy = o.copy;\n\t\t\t\t\tif ( o.scope ) {\n\t\t\t\t\t\to.scope.$emit( o.eventNames.dragularcloned, shared.item, context.item );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tshared.copy = false;\n\t\t\t\t}\n\n\t\t\t\t// prepare models operations\n\t\t\t\tvar containerIndex = getContainers( o ).indexOf( context.source );\n\t\t\t\tshared.sourceModel = getContainersModel( o )[ containerIndex ];\n\n\t\t\t\tshared.sourceFilteredModel = o.containersFilteredModel[ containerIndex ];\n\t\t\t\tshared.initialIndex = domIndexOf( context.item, context.source );\n\n\t\t\t\tdrake.dragging = true;\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\to.scope.$emit( o.eventNames.dragulardrag, shared.sourceItem, shared.source );\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tfunction manualStart( item ) {\n\t\t\t\tvar context = canStart( item );\n\t\t\t\tif ( context ) {\n\t\t\t\t\tshared.grabbed = context;\n\t\t\t\t\teventualMovements();\n\t\t\t\t\t//start(context);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction renderMirrorImage() {\n\t\t\t\tif ( shared.mirror ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar rect = shared.sourceItem.getBoundingClientRect();\n\t\t\t\tshared.mirror = shared.sourceItem.cloneNode( true );\n\t\t\t\tshared.mirrorWidth = rect.width;\n\t\t\t\tshared.mirrorHeight = rect.height;\n\t\t\t\tshared.mirror.style.width = getRectWidth( rect ) + 'px';\n\t\t\t\tshared.mirror.style.height = getRectHeight( rect ) + 'px';\n\t\t\t\taddClass( shared.mirror, o.classes.mirror );\n\t\t\t\to.mirrorContainer.appendChild( shared.mirror );\n\t\t\t\tregEvent( _docElm, 'on', 'mousemove', drag );\n\t\t\t\taddClass( _doc.body, o.classes.unselectable );\n\t\t\t\tregEvent( shared.mirror, 'on', 'wheel', scrollContainer );\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\to.scope.$emit( o.eventNames.dragularcloned, shared.mirror, shared.sourceItem );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction end() {\n\t\t\t\tif ( !drake.dragging || !shared.item ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdrop( shared.item, getParent( shared.item ) );\n\t\t\t}\n\n\t\t\tfunction ungrab() {\n\t\t\t\tshared.grabbed = false;\n\t\t\t\teventualMovements( 'remove' );\n\t\t\t\tmovements( 'remove' );\n\t\t\t}\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Drag stage: ------------------------------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction drag( e ) { // watch performance!! - function is running each mousemove!\n\t\t\t\tif ( !shared.mirror ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( e.originalEvent ) {\n\t\t\t\t\te = e.originalEvent; // jQuery environment\n\t\t\t\t}\n\n\t\t\t\t// update coordinates\n\t\t\t\tshared.clientX = getCoord( 'clientX', e );\n\t\t\t\tshared.clientY = getCoord( 'clientY', e );\n\n\t\t\t\t// count mirror coordinates\n\t\t\t\tvar x = shared.clientX - shared.offsetX,\n\t\t\t\t\ty = shared.clientY - shared.offsetY,\n\t\t\t\t\tpageX,\n\t\t\t\t\tpageY,\n\t\t\t\t\toffsetBox;\n\n\t\t\t\t// fill extra properties if boundingBox is used\n\t\t\t\tif ( o.boundingBox ) {\n\t\t\t\t\tpageX = getCoord( 'pageX', e );\n\t\t\t\t\tpageY = getCoord( 'pageY', e );\n\t\t\t\t\toffsetBox = getOffset( o.boundingBox );\n\t\t\t\t}\n\n\t\t\t\tif ( !o.lockY ) {\n\t\t\t\t\tif ( !o.boundingBox || (pageX > offsetBox.left + shared.offsetX && pageX < offsetBox.right + shared.offsetXr) ) {\n\t\t\t\t\t\tshared.mirror.style.left = x + 'px';\n\t\t\t\t\t} else if ( o.boundingBox ) { // check again in case user scrolled the view\n\t\t\t\t\t\tif ( pageX < offsetBox.left + shared.offsetX ) {\n\t\t\t\t\t\t\tshared.mirror.style.left = shared.clientX - (pageX - offsetBox.left) + 'px';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tshared.mirror.style.left = shared.clientX - shared.mirrorWidth - (pageX - offsetBox.right) + 'px';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( !o.lockX ) {\n\t\t\t\t\tif ( !o.boundingBox || (pageY > offsetBox.top + shared.offsetY && pageY < offsetBox.bottom + shared.offsetYb) ) {\n\t\t\t\t\t\tshared.mirror.style.top = y + 'px';\n\t\t\t\t\t} else if ( o.boundingBox ) { // check again in case user scrolled the view\n\t\t\t\t\t\tif ( pageY < offsetBox.top + shared.offsetY ) {\n\t\t\t\t\t\t\tshared.mirror.style.top = shared.clientY - (pageY - offsetBox.top) + 'px';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tshared.mirror.style.top = shared.clientY - shared.mirrorHeight - (pageY - offsetBox.bottom) + 'px';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar elementBehindCursor = getElementBehindPoint( shared.mirror, shared.clientX, shared.clientY ),\n\t\t\t\t\tdropTarget = findDropTarget( elementBehindCursor, shared.clientX, shared.clientY ),\n\t\t\t\t\tchanged = dropTarget !== shared.lastDropTarget;\n\n\t\t\t\tif ( elementBehindCursor !== shared.lastElementBehindCursor ) {\n\t\t\t\t\tfireEvent( elementBehindCursor, shared.dragOverEvents.dragularenter, !!dropTarget );\n\t\t\t\t\tif ( shared.lastElementBehindCursor ) {\n\t\t\t\t\t\tfireEvent( shared.lastElementBehindCursor, shared.dragOverEvents.dragularleave, elementBehindCursor );\n\t\t\t\t\t}\n\t\t\t\t\tshared.lastElementBehindCursor = elementBehindCursor;\n\t\t\t\t}\n\n\t\t\t\tif ( changed ) {\n\t\t\t\t\tif ( shared.lastDropTarget ) {\n\t\t\t\t\t\tmoved( 'out' );\n\t\t\t\t\t}\n\t\t\t\t\tshared.lastDropTarget = dropTarget;\n\t\t\t\t\tmoved( 'over' );\n\t\t\t\t}\n\n\t\t\t\t// do not copy in same container\n\t\t\t\tif ( dropTarget === shared.source && shared.copy && !g( o.copySortSource ) ) {\n\t\t\t\t\tif ( getParent( shared.item ) ) {\n\t\t\t\t\t\tshared.item.parentNode.removeChild( shared.item );\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar reference,\n\t\t\t\t\timmediate = getImmediateChild( dropTarget, elementBehindCursor );\n\n\t\t\t\tif ( immediate !== null ) {\n\t\t\t\t\treference = getReference( dropTarget, immediate, shared.clientX, shared.clientY );\n\t\t\t\t} else if ( g( o.revertOnSpill ) === true && !shared.copy ) {\n\t\t\t\t\t// the case that mirror is not over valid target and reverting is on and copy is off\n\t\t\t\t\treference = shared.initialSibling;\n\t\t\t\t\tdropTarget = shared.source;\n\t\t\t\t} else {\n\t\t\t\t\t// the case that mirror is not over valid target and removing is on or copy is on\n\t\t\t\t\tif ( shared.copy && getParent( shared.item ) ) {\n\t\t\t\t\t\t// remove item or copy of item\n\t\t\t\t\t\tshared.item.parentNode.removeChild( shared.item );\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( (reference === null && changed) ||\n\t\t\t\t\treference !== shared.item &&\n\t\t\t\t\treference !== nextEl( shared.item ) &&\n\t\t\t\t\treference !== shared.currentSibling ) {\n\t\t\t\t\t// moving item/copy to new container from previous one\n\t\t\t\t\tshared.currentSibling = reference;\n\n\t\t\t\t\tdropTarget.insertBefore( shared.item, reference ); // if reference is null item is inserted at the end\n\n\t\t\t\t\tif ( o.scope ) {\n\t\t\t\t\t\to.scope.$emit( o.eventNames.dragularshadow, shared.item, dropTarget, e );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction moved( type ) {\n\t\t\t\t\tif ( o.scope ) {\n\t\t\t\t\t\tnotify( o.scope );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( shared.targetCtx && shared.targetCtx.o.scope && shared.targetCtx.o.scope !== o.scope ) {\n\t\t\t\t\t\tnotify( shared.targetCtx.o.scope );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( g( o.removeOnSpill ) === true ) {\n\t\t\t\t\t\ttype === 'over' ? spillOver() : spillOut();\n\t\t\t\t\t}\t\n\n\t\t\t\t\tfunction notify( scope ){\n\t\t\t\t\t\tscope.$emit( o.eventNames[ 'dragular' + type ], shared.item, shared.lastDropTarget, shared.source, e );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// find valid drop container\n\t\t\tfunction findDropTarget( elementBehindCursor, clientX, clientY ) { // watch performance!! - running each move!\n\t\t\t\tvar target = elementBehindCursor,\n\t\t\t\t\ttargetCtx = null;\n\n\t\t\t\twhile ( target && !accepted() ) {\n\t\t\t\t\ttarget = getParent( target );\n\t\t\t\t}\n\n\t\t\t\t// bugfix #148 model not updated on spill\n\t\t\t\t// added target condition to fix #161\n\t\t\t\tif ( target && targetCtx ){\n\t\t\t\t\tshared.targetCtx = targetCtx;\n\t\t\t\t}\n\n\t\t\t\treturn target;\n\n\t\t\t\tfunction accepted() {\n\n\t\t\t\t\tif ( !isContainer( target ) ) { // is not droppable?\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar immediate = getImmediateChild( target, elementBehindCursor ),\n\t\t\t\t\t\treference = getReference( target, immediate, clientX, clientY ),\n\t\t\t\t\t\tinitial = isInitialPlacement( target, reference ),\n\t\t\t\t\t\ti = o.nameSpace.length,\n\t\t\t\t\t\tnameSpace;\n\n\t\t\t\t\twhile ( i-- ) { // for each namespace\n\t\t\t\t\t\tnameSpace = o.nameSpace[ i ];\n\t\t\t\t\t\tif ( shared.containers[ nameSpace ].indexOf( target ) !== -1 ) {\n\t\t\t\t\t\t\ttargetCtx = getTargetCtx( nameSpace );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// shared.target must be actual (used for scroll functionality)\n\t\t\t\t\tshared.target = target;\n\n\t\t\t\t\tif ( initial ) {\n\n\t\t\t\t\t\treturn true; // accepts = true;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// try to find target in default set of containers\n\t\t\t\t\t\tif ( !targetCtx ) {\n\t\t\t\t\t\t\ttargetCtx = getTargetCtx( 'dragularCommon' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if found and containersModel is dynamic, retrieve model\n\t\t\t\t\t\tif ( targetCtx && _isFunction( targetCtx.o.containersModel ) ) {\n\t\t\t\t\t\t\t// fix targetCtx.m(odel) for dynamic containersModel\n\t\t\t\t\t\t\ttargetCtx.m = getContainersModel( targetCtx.o )[ getContainers( targetCtx.o ).indexOf( target ) ];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( targetCtx && // target container is defined via service or directive\n\t\t\t\t\t\t\ttargetCtx.o.accepts && !targetCtx.o.accepts( shared.item, target, shared.source, reference, shared.sourceModel, shared.initialIndex ) ) {\n\n\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\t} else if ( o.isContainer && // target container is recognized via o.isContainer\n\t\t\t\t\t\t\to.isContainerAccepts && !o.isContainerAccepts( shared.item, target, shared.source, reference, shared.sourceModel, shared.initialIndex ) ) {\n\n\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn !o.canBeAccepted || o.canBeAccepted( shared.item, target, shared.source, reference, shared.sourceModel, shared.initialIndex );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tfunction getTargetCtx( nameSpace ) {\n\t\t\t\t\treturn shared.containersCtx[ nameSpace ] && shared.containersCtx[ nameSpace ][ shared.containers[ nameSpace ].indexOf( target ) ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction spillOver() {\n\t\t\t\trmClass( shared.item, o.classes.hide );\n\t\t\t}\n\n\t\t\tfunction spillOut() {\n\t\t\t\tif ( drake.dragging ) {\n\t\t\t\t\taddClass( shared.item, o.classes.hide );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// is item currently placed in original container and original position?\n\t\t\tfunction isInitialPlacement( target, s ) { // watch performance - running each move several times!\n\t\t\t\tvar sibling = s !== undefined ? s : (shared.mirror ? shared.currentSibling : nextEl( shared.item ));\n\t\t\t\treturn target === shared.source && sibling === shared.initialSibling;\n\t\t\t}\n\n\t\t\tfunction getImmediateChild( dropTarget, target ) { // watch performance - running each move several times!\n\t\t\t\tvar immediate = target;\n\t\t\t\twhile ( immediate !== dropTarget && getParent( immediate ) !== dropTarget ) {\n\t\t\t\t\timmediate = getParent( immediate );\n\t\t\t\t}\n\t\t\t\tif ( immediate === _docElm ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn immediate;\n\t\t\t}\n\n\t\t\tfunction getReference( dropTarget, target, x, y ) { // watch performance - running each move several times!\n\t\t\t\tvar horizontal = o.direction === 'horizontal';\n\t\t\t\treturn target !== dropTarget ? inside() : outside();\n\n\t\t\t\tfunction outside() { // slower, but able to figure out any position\n\t\t\t\t\tvar len = dropTarget.children.length,\n\t\t\t\t\t\ti, el, rect;\n\t\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\t\tel = dropTarget.children[ i ];\n\t\t\t\t\t\trect = el.getBoundingClientRect();\n\t\t\t\t\t\tif ( horizontal && rect.left > x ) {\n\t\t\t\t\t\t\treturn el;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !horizontal && rect.top > y ) {\n\t\t\t\t\t\t\treturn el;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tfunction inside() { // faster, but only available if dropped inside a child element\n\t\t\t\t\tvar rect = target.getBoundingClientRect();\n\t\t\t\t\tif ( horizontal ) {\n\t\t\t\t\t\treturn resolve( x > rect.left + getRectWidth( rect ) / 2 );\n\t\t\t\t\t}\n\t\t\t\t\treturn resolve( y > rect.top + getRectHeight( rect ) / 2 );\n\t\t\t\t}\n\n\t\t\t\tfunction resolve( after ) {\n\t\t\t\t\treturn after ? nextEl( target ) : target;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction getElementBehindPoint( point, x, y ) { // watch performance!! - function is running each mousemove!\n\t\t\t\tvar p = point || {},\n\t\t\t\t\tstate = p.className,\n\t\t\t\t\tel;\n\t\t\t\tp.className += ' ' + o.classes.hide;\n\t\t\t\tel = _doc.elementFromPoint( x, y );\n\t\t\t\tp.className = state;\n\t\t\t\treturn el;\n\t\t\t}\n\n\t\t\tfunction isContainer( el ) {\n\n\t\t\t\tif ( !el ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar i = o.nameSpace.length;\n\t\t\t\twhile ( i-- ) {\n\n\t\t\t\t\tif ( shared.containers[ o.nameSpace[ i ] ].indexOf( el ) !== -1 ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( o.isContainer( el ) ) {\n\n\t\t\t\t\tshared.tempModel = o.isContainerModel( el );\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\n\t\t\t\t\tshared.tempModel = null;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tfunction getContainers( opt ) {\n\n\t\t\t\treturn _getContainers( 'containers', opt );\n\t\t\t}\n\n\t\t\tfunction getContainersModel( opt ) {\n\n\t\t\t\treturn _getContainers( 'containersModel', opt, true );\n\t\t\t}\n\n\t\t\tfunction _getContainers( containersType, opt, to2d ) {\n\n\t\t\t\treturn _isFunction( opt[ containersType ] ) ? sanitizeContainers(\n\t\t\t\t\topt[ containersType ](\n\t\t\t\t\t\t(opt === o ? drake : null),\n\t\t\t\t\t\tshared\n\t\t\t\t\t),\n\t\t\t\t\tto2d,\n\t\t\t\t\topt.scope\n\t\t\t\t) : opt[ containersType ];\n\t\t\t}\n\n\t\t\tfunction cancel( revert ) {\n\t\t\t\tif ( !drake.dragging ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar reverts = arguments.length > 0 ? revert : g( o.revertOnSpill ),\n\t\t\t\t\tparent = getParent( shared.item );\n\n\t\t\t\tvar initial = isInitialPlacement( parent );\n\t\t\t\tif ( !initial && !shared.copy && reverts ) {\n\t\t\t\t\tshared.source.insertBefore( shared.item, shared.initialSibling );\n\t\t\t\t}\n\t\t\t\tif ( shared.sourceModel && !shared.copy && !reverts ) {\n\t\t\t\t\tdrop( shared.item, parent );\n\t\t\t\t} else if ( o.scope ) {\n\t\t\t\t\tif ( initial || reverts ) {\n\t\t\t\t\t\to.scope.$emit( o.eventNames.dragularcancel, shared.item, shared.source, shared.sourceModel, shared.initialIndex );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( !shared.sourceModel || shared.copy || reverts || initial ) {\n\t\t\t\t\tcleanup();\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Release stage: ------------------------------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction release( e ) {\n\n\t\t\t\tungrab();\n\t\t\t\tif ( !drake.dragging ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( e.originalEvent ) {\n\t\t\t\t\te = e.originalEvent; // jQuery enviroment\n\t\t\t\t}\n\n\t\t\t\tshared.clientX = getCoord( 'clientX', e );\n\t\t\t\tshared.clientY = getCoord( 'clientY', e );\n\n\t\t\t\tvar elementBehindCursor = getElementBehindPoint( shared.mirror, shared.clientX, shared.clientY ),\n\t\t\t\t\tdropTarget = findDropTarget( elementBehindCursor, shared.clientX, shared.clientY );\n\n\t\t\t\tif ( dropTarget && ((shared.copy && g( o.copySortSource )) || (!shared.copy || dropTarget !== shared.source)) ) {\n\t\t\t\t\t// found valid target and (is not copy case or target is not initial container)\n\t\t\t\t\tdrop( shared.item, dropTarget );\n\t\t\t\t} else if ( g( o.removeOnSpill ) ) {\n\t\t\t\t\tremove();\n\t\t\t\t} else {\n\t\t\t\t\tcancel();\n\t\t\t\t}\n\n\t\t\t\t// after release there is no container hovered\n\t\t\t\tshared.target = null;\n\n\t\t\t\tif ( shared.lastElementBehindCursor ) {\n\t\t\t\t\tfireEvent( shared.lastElementBehindCursor, shared.dragOverEvents.dragularrelease, elementBehindCursor );\n\t\t\t\t}\n\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\to.scope.$emit( o.eventNames.dragularrelease, shared.item, shared.source, e );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction drop( item, target ) {\n\t\t\t\tif ( !item ) { // https://github.com/luckylooke/dragular/issues/102\n\t\t\t\t\tcleanup();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar sourceItem = shared.sourceItem,\n\t\t\t\t\tcurrentSibling = shared.currentSibling,\n\t\t\t\t\tdropIndex = domIndexOf( item, target );\n\n\t\t\t\tif ( shared.copy && target === shared.source && getParent( item ) && g( o.copySortSource ) ) {\n\t\t\t\t\titem.parentNode.removeChild( shared.sourceItem );\n\t\t\t\t}\n\n\t\t\t\tif ( shared.sourceModel && !isInitialPlacement( target ) ) {\n\t\t\t\t\tif ( shared.targetCtx && shared.targetCtx.fm ) { // target has filtered model\n\t\t\t\t\t\t// convert index from index-in-filteredModel to index-in-model\n\t\t\t\t\t\tdropIndex = shared.targetCtx.m.indexOf( shared.targetCtx.fm[ dropIndex ] );\n\t\t\t\t\t}\n\t\t\t\t\tif ( shared.sourceFilteredModel ) { // source has filtered model\n\t\t\t\t\t\t// convert index from index-in-filteredModel to index-in-model\n\t\t\t\t\t\tshared.initialIndex = shared.sourceModel.indexOf( shared.sourceFilteredModel[ shared.initialIndex ] );\n\t\t\t\t\t}\n\t\t\t\t\t$rootScope.$applyAsync( function applyDrop() {\n\t\t\t\t\t\tif ( !shared.sourceModel ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( target === shared.source ) {\n\t\t\t\t\t\t\tshared.sourceModel.splice( dropIndex, 0, shared.sourceModel.splice( shared.initialIndex, 1 )[ 0 ] );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tshared.dropElmModel = shared.copy && !o.dontCopyModel ? angular.copy( shared.sourceModel[ shared.initialIndex ] ) : shared.sourceModel[ shared.initialIndex ];\n\n\t\t\t\t\t\t\tif ( !shared.tempModel ) {\n\t\t\t\t\t\t\t\tshared.targetModel = ( shared.targetCtx && shared.targetCtx.m ) || shared.sourceModel;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tshared.targetModel = shared.tempModel;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\titem.parentNode.removeChild( item ); // element must be removed for ngRepeat to apply correctly\n\n\t\t\t\t\t\t\tif ( !shared.copy ) {\n\t\t\t\t\t\t\t\tshared.sourceModel.splice( shared.initialIndex, 1 );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( shared.targetModel ) {\n\t\t\t\t\t\t\t\tshared.targetModel.splice( dropIndex, 0, shared.dropElmModel );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// removing element, as protection against duplicates, angular ng-repeat will create new item according to model\n\t\t\t\t\t\tif ( getParent( item ) ) {\n\t\t\t\t\t\t\titem.parentNode.removeChild( item );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tafterDrop();\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tafterDrop();\n\t\t\t\t}\n\n\t\t\t\tfunction afterDrop() {\n\n\t\t\t\t\t// in nested containers case, new containers doesnt have registered mousedown\n\t\t\t\t\tgetContainers( o ).forEach( function readdMouseDown( container ) {\n\t\t\t\t\t\tregEvent( container, 'off', 'mousedown', grab );\n\t\t\t\t\t\tregEvent( container, 'on', 'mousedown', grab );\n\t\t\t\t\t} );\n\n\t\t\t\t\tif ( o.compileItemOnDrop ) {\n\t\t\t\t\t\tvar scope = angular.element( target ).scope ? angular.element( target ).scope() : o.scope;\n\t\t\t\t\t\tif ( scope ) {\n\t\t\t\t\t\t\tscope.$applyAsync( function () {\n\t\t\t\t\t\t\t\tvar content = $compile( shared.copy ? sourceItem.cloneNode( true ) : sourceItem )( scope );\n\t\t\t\t\t\t\t\tif ( item.parentNode === target ) {\n\t\t\t\t\t\t\t\t\ttarget.removeChild( item );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttarget.insertBefore( content[ 0 ], currentSibling );\n\t\t\t\t\t\t\t\tcleanup();\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( o.scope ) {\n\t\t\t\t\t\tnotify( o.scope );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( shared.targetCtx && shared.targetCtx.o.scope && shared.targetCtx.o.scope !== o.scope ) {\n\t\t\t\t\t\tnotify( shared.targetCtx.o.scope );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !o.compileItemOnDrop ) {\n\t\t\t\t\t\tcleanup();\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction notify( scope ){\n\t\t\t\t\t\tif ( isInitialPlacement( target ) ) {\n\t\t\t\t\t\t\tscope.$emit( o.eventNames.dragularcancel, item, shared.source, shared.sourceModel, shared.initialIndex );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tscope.$emit( o.eventNames.dragulardrop, item, target, shared.source, shared.sourceModel, shared.initialIndex, shared.targetModel, dropIndex );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction remove() {\n\t\t\t\tif ( !drake.dragging ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar parent = getParent( shared.item );\n\n\t\t\t\tif ( parent ) {\n\t\t\t\t\tparent.removeChild( shared.item );\n\t\t\t\t}\n\n\t\t\t\tif ( shared.sourceModel ) {\n\t\t\t\t\t$rootScope.$applyAsync( function removeModel() {\n\t\t\t\t\t\tshared.sourceModel.splice( shared.initialIndex, 1 );\n\t\t\t\t\t\tcleanup();\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\to.scope.$emit( shared.copy ? o.eventNames.dragularcancel : o.eventNames.dragularremove, shared.item, parent, shared.sourceModel, shared.initialIndex );\n\t\t\t\t}\n\t\t\t\tif ( !shared.sourceModel ) {\n\t\t\t\t\tcleanup();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction cleanup() {\n\t\t\t\tungrab();\n\t\t\t\tremoveMirrorImage();\n\n\t\t\t\tif ( shared.item ) {\n\t\t\t\t\trmClass( shared.item, o.classes.transit );\n\t\t\t\t}\n\n\t\t\t\tdrake.dragging = false;\n\n\t\t\t\tif ( g( o.removeOnSpill ) === true ) {\n\t\t\t\t\tspillOut();\n\t\t\t\t}\n\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\tif ( shared.lastDropTarget ) {\n\t\t\t\t\t\to.scope.$emit( o.eventNames.dragularout, shared.item, shared.lastDropTarget, shared.source );\n\t\t\t\t\t}\n\t\t\t\t\to.scope.$emit( o.eventNames.dragulardragend, shared.item );\n\t\t\t\t}\n\n\t\t\t\tshared.source = shared.item = shared.sourceItem = shared.initialSibling = shared.currentSibling = shared.sourceModel = null;\n\t\t\t\tshared.initialIndex = shared.currentIndex = shared.lastDropTarget = shared.tempModel = shared.targetModel = null;\n\t\t\t\tshared.dropElmModel = shared.targetCtx = shared.copy = shared.moveX = shared.moveY = null;\n\t\t\t}\n\n\t\t\tfunction destroy() {\n\n\t\t\t\tregisterEvents( true );\n\t\t\t\tremoveContainers( o.containers );\n\t\t\t\trelease( {} );\n\t\t\t}\n\n\t\t\tfunction removeContainers( containers ) {\n\n\t\t\t\t$rootScope.$applyAsync( function applyDestroyed() {\n\n\t\t\t\t\tcontainers = _isArray( containers ) ? containers : makeArray( containers );\n\t\t\t\t\tcontainers.forEach( function forEachContainer( container ) {\n\n\t\t\t\t\t\tangular.forEach( o.nameSpace, function forEachNs( nameSpace ) {\n\n\t\t\t\t\t\t\tvar index;\n\t\t\t\t\t\t\tindex = shared.containers[ nameSpace ].indexOf( container );\n\t\t\t\t\t\t\tshared.containers[ nameSpace ].splice( index, 1 );\n\t\t\t\t\t\t\tshared.containersCtx[ nameSpace ].splice( index, 1 );\n\n\t\t\t\t\t\t\tif ( -1 < (index = initialContainers.indexOf( container )))\n\t\t\t\t\t\t\t\tinitialContainers.splice( index, 1 );\n\t\t\t\t\t\t} );\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tfunction addContainers( containers ) {\n\n\t\t\t\tcontainers = _isArray( containers ) ? containers : makeArray( containers );\n\t\t\t\tcontainers.forEach( function forEachContainer( container, i ) {\n\n\t\t\t\t\tangular.forEach( o.nameSpace, function forEachNs( nameSpace ) {\n\n\t\t\t\t\t\tshared.containers[ nameSpace ].push( container );\n\t\t\t\t\t\tshared.containersCtx[ nameSpace ].push({\n\t\t\t\t\t\t\to: o,\n\t\t\t\t\t\t\tm: getContainersModel( o )[ i ], // can be undefined\n\t\t\t\t\t\t\tfm: o.containersFilteredModel[ i ] // can be undefined\n\t\t\t\t\t\t});\n\t\t\t\t\t\tinitialContainers.push( container );\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tfunction scrollContainer( e ) {\n\t\t\t\tif ( shared.target ) {\n\t\t\t\t\tif ( e.originalEvent ) {\n\t\t\t\t\t\te = e.originalEvent; // jQuery enviroment\n\t\t\t\t\t}\n\t\t\t\t\tvar before = shared.target.scrollTop;\n\t\t\t\t\tshared.target.scrollTop += e.deltaY;\n\t\t\t\t\t// block scroll of the document when container can be scrolled\n\t\t\t\t\tif ( before !== shared.target.scrollTop ) {\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction removeMirrorImage() {\n\t\t\t\tif ( shared.mirror ) {\n\t\t\t\t\trmClass( _doc.body, o.classes.unselectable );\n\t\t\t\t\tregEvent( _docElm, 'off', 'mousemove', drag );\n\t\t\t\t\tregEvent( shared.mirror, 'off', 'wheel', scrollContainer );\n\t\t\t\t\tif ( getParent( shared.mirror ) ) {\n\t\t\t\t\t\tshared.mirror.parentNode.removeChild( shared.mirror );\n\t\t\t\t\t}\n\t\t\t\t\tshared.mirror = null;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Other fns: -------------------------------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction depSanitize( containersModel ) {\n\t\t\t\tconsole.warn( 'Deprecated method drake.sanitizeContainersModel! Will be removed in next major release! Please use sanitizeContainers instead.' );\n\t\t\t\tsanitizeContainers( containersModel, true, o.scope );\n\t\t\t}\n\n\t\t} // end of service\n\n\t\t/****************************************************************************************************************************/\n\t\t/****************************************************************************************************************************/\n\t\t/****************************************************************************************************************************/\n\n\t\t// HELPERS FUNCTIONS:\n\n\t\tfunction sanitizeContainers( containers, to2d, scope ) {\n\n\t\t\tif ( _isFunction( containers ) ) {\n\n\t\t\t\treturn containers;\n\t\t\t}\n\t\t\telse if ( _isArray( containers ) ) {\n\n\t\t\t\tif ( to2d ) {\n\t\t\t\t\t// |-------- is 2D array? -----------|\n\t\t\t\t\treturn _isArray( containers[ 0 ] ) ? containers : [ containers ];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn containers;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( typeof containers === 'string' && scope ) {\n\n\t\t\t\tvar evaluated = scope.$eval( containers );\n\n\t\t\t\tif ( _isFunction( evaluated ) ) {\n\t\t\t\t\treturn evaluated;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\treturn scope.$eval( containers );\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( containers ) {\n\n\t\t\t\treturn makeArray( containers );\n\t\t\t}\n\n\t\t\treturn [];\n\t\t}\n\n\t\tfunction regEvent( el, op, type, fn ) {\n\t\t\tvar touch = {\n\t\t\t\t\tmouseup: 'touchend',\n\t\t\t\t\tmousedown: 'touchstart',\n\t\t\t\t\tmousemove: 'touchmove'\n\t\t\t\t},\n\t\t\t\tpointers = {\n\t\t\t\t\tmouseup: 'pointerup',\n\t\t\t\t\tmousedown: 'pointerdown',\n\t\t\t\t\tmousemove: 'pointermove'\n\t\t\t\t},\n\t\t\t\tmicrosoft = {\n\t\t\t\t\tmouseup: 'MSPointerUp',\n\t\t\t\t\tmousedown: 'MSPointerDown',\n\t\t\t\t\tmousemove: 'MSPointerMove'\n\t\t\t\t},\n\t\t\t\t$el = angular.element( el );\n\n\t\t\tif ( el.addEventListener ) {\n\n\t\t\t\tvar opConvert = { on: 'addEventListener', off: 'removeEventListener' };\n\t\t\t\tel[ opConvert[ op ] ]( type, fn, { passive: false } );\n\t\t\t\tel[ opConvert[ op ] ]( touch[ type ], fn, { passive: false } );\n\n\t\t\t} else {\n\n\t\t\t\tif ( typeof navigator !== 'undefined' && navigator.pointerEnabled && pointers[ type ] ) {\n\t\t\t\t\t$el[ op ]( pointers[ type ], fn );\n\t\t\t\t} else if ( typeof navigator !== 'undefined' && navigator.msPointerEnabled && microsoft[ type ] ) {\n\t\t\t\t\t$el[ op ]( microsoft[ type ], fn );\n\t\t\t\t} else if ( touch[ type ] ) {\n\t\t\t\t\t$el[ op ]( touch[ type ], fn );\n\t\t\t\t}\n\t\t\t\t$el[ op ]( type, fn );\n\n\t\t\t}\n\t\t}\n\n\t\tfunction never() {\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction always() {\n\t\t\treturn true;\n\t\t}\n\n\t\t// make array from array-like objects or from single element (based on bevacqua/atoa)\n\t\tfunction makeArray( all, startIndex ) {\n\t\t\tif ( _isArray( all ) ) {\n\t\t\t\treturn all;\n\t\t\t}\n\t\t\tif ( all.length ) { // is array-like\n\t\t\t\treturn Array.prototype.slice.call( all, startIndex ); // convert to vanilla js array\n\t\t\t} else { // is one element\n\t\t\t\treturn [ all ];\n\t\t\t}\n\t\t}\n\n\t\tfunction whichMouseButton( e ) {\n\t\t\tif ( e.touches ) {\n\t\t\t\treturn e.touches.length;\n\t\t\t}\n\t\t\tif ( e.originalEvent && e.originalEvent.touches ) {\n\t\t\t\treturn e.originalEvent.touches.length;\n\t\t\t}\n\t\t\tif ( e.which !== void 0 && e.which !== 0 ) {\n\t\t\t\treturn e.which;\n\t\t\t} // github.com/bevacqua/dragula/issues/261\n\t\t\tif ( e.buttons !== undefined ) {\n\t\t\t\treturn e.buttons;\n\t\t\t}\n\t\t\tvar button = e.button;\n\t\t\tif ( button !== undefined ) { // see github.com/jquery/jquery/blob/99e8ff1baa7ae341e94bb89c3e84570c7c3ad9ea/src/event.js#L573-L575\n\t\t\t\treturn button & 1 ? 1 : button & 2 ? 3 : (button & 4 ? 2 : 0);\n\t\t\t}\n\t\t}\n\n\t\tfunction preventGrabbed( e ) {\n\t\t\tif ( e.originalEvent ) {\n\t\t\t\te = e.originalEvent; // jQuery enviroment\n\t\t\t}\n\t\t\tif ( shared.grabbed ) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tfunction getScroll( scrollProp, offsetProp ) {\n\t\t\tif ( typeof window[ offsetProp ] !== 'undefined' ) {\n\t\t\t\treturn window[ offsetProp ];\n\t\t\t}\n\t\t\tif ( _docElm.clientHeight ) {\n\t\t\t\treturn _docElm[ scrollProp ];\n\t\t\t}\n\t\t\treturn _doc.body[ scrollProp ];\n\t\t}\n\n\t\tfunction getOffset( el ) { // watch performance!! - function is running each mousemove!\n\t\t\tvar rect = el.getBoundingClientRect(),\n\t\t\t\tscrollTop = getScroll( 'scrollTop', 'pageYOffset' ),\n\t\t\t\tscrollLeft = getScroll( 'scrollLeft', 'pageXOffset' );\n\t\t\treturn {\n\t\t\t\tleft: rect.left + scrollLeft,\n\t\t\t\tright: rect.right + scrollLeft,\n\t\t\t\ttop: rect.top + scrollTop,\n\t\t\t\tbottom: rect.bottom + scrollTop\n\t\t\t};\n\t\t}\n\n\t\tfunction getRectWidth( rect ) {\n\t\t\treturn rect.width || (rect.right - rect.left);\n\t\t}\n\n\t\tfunction getRectHeight( rect ) {\n\t\t\treturn rect.height || (rect.bottom - rect.top);\n\t\t}\n\n\t\tfunction getEmptyArray() {\n\t\t\treturn [];\n\t\t}\n\n\t\tfunction nextEl( el ) {\n\t\t\tif ( !el ) { // https://github.com/luckylooke/dragular/issues/102\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn el.nextElementSibling || manually();\n\n\t\t\tfunction manually() {\n\t\t\t\tvar sibling = el;\n\t\t\t\tdo {\n\t\t\t\t\tsibling = sibling.nextSibling;\n\t\t\t\t} while ( sibling && sibling.nodeType !== 1 );\n\t\t\t\treturn sibling;\n\t\t\t}\n\t\t}\n\n\t\t//Cannot use angular.isElement because we need to check plain dom element, no jQlite wrapped\n\t\tfunction isElement( obj ) {\n\t\t\treturn (\n\t\t\t\ttypeof HTMLElement === 'object' ? obj instanceof HTMLElement : //DOM2\n\t\t\t\t\tobj && typeof obj === 'object' && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === 'string'\n\t\t\t);\n\t\t}\n\n\t\tfunction lookupClass( className ) {\n\t\t\tvar cached = shared.classesCache[ className ];\n\t\t\tif ( cached ) {\n\t\t\t\tcached.lastIndex = 0;\n\t\t\t} else {\n\t\t\t\tshared.classesCache[ className ] = cached = new RegExp( '(?:^|\\\\s)' + className + '(?:\\\\s|$)', 'g' );\n\t\t\t}\n\t\t\treturn cached;\n\t\t}\n\n\t\tfunction addClass( el, className ) {\n\t\t\tvar current = el.className;\n\t\t\tif ( !current.length ) {\n\t\t\t\tel.className = className;\n\t\t\t} else if ( !lookupClass( className ).test( current ) ) {\n\t\t\t\tel.className += ' ' + className;\n\t\t\t}\n\t\t}\n\n\t\tfunction rmClass( el, className ) {\n\t\t\tel.className = el.className.replace( lookupClass( className ), ' ' ).trim();\n\t\t}\n\n\t\tfunction getEventHost( e ) {\n\t\t\t// on touchend event, we have to use `e.changedTouches`\n\t\t\t// see http://stackoverflow.com/questions/7192563/touchend-event-properties\n\t\t\t// see https://github.com/bevacqua/dragula/issues/34\n\t\t\tif ( e.targetTouches && e.targetTouches.length ) {\n\t\t\t\treturn e.targetTouches[ 0 ];\n\t\t\t}\n\t\t\tif ( e.changedTouches && e.changedTouches.length ) {\n\t\t\t\treturn e.changedTouches[ 0 ];\n\t\t\t}\n\t\t\treturn e;\n\t\t}\n\n\t\tfunction getCoord( coord, e ) { // watch performance - running each move several times!\n\t\t\tvar host = getEventHost( e );\n\t\t\tvar missMap = {\n\t\t\t\tpageX: 'clientX', // IE8\n\t\t\t\tpageY: 'clientY' // IE8\n\t\t\t};\n\t\t\tif ( coord in missMap && !(coord in host) && missMap[ coord ] in host ) {\n\t\t\t\tcoord = missMap[ coord ];\n\t\t\t}\n\n\t\t\t// Adding support for touch events, as they are not functional in the original\n\t\t\tif ( !host.type || host.type.indexOf( 'touch' ) < 0 ) {\n\t\t\t\treturn host[ coord ];\n\t\t\t} else {\n\t\t\t\tif ( host.type.indexOf( 'end' ) === -1 ) {\n\t\t\t\t\t// No clientX or clientY in a touch event\n\t\t\t\t\treturn host.originalEvent.touches[ 0 ][ coord.replace( 'client', 'page' ) ];\n\t\t\t\t}\n\t\t\t\t// Nothing should happen for touchend\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfunction getParent( el ) { // watch performance!! - function is running each mousemove!\n\t\t\treturn el.parentNode === document ? null : el.parentNode;\n\t\t}\n\n\t\tfunction isInput( el ) {\n\t\t\treturn el.tagName === 'INPUT' || el.tagName === 'TEXTAREA' || el.tagName === 'SELECT' || isEditable( el );\n\t\t}\n\n\t\tfunction isEditable( el ) {\n\t\t\tif ( !el ) {\n\t\t\t\treturn false;\n\t\t\t} // no parents were editable\n\t\t\tif ( el.contentEditable === 'false' ) {\n\t\t\t\treturn false;\n\t\t\t} // stop the lookup\n\t\t\tif ( el.contentEditable === 'true' ) {\n\t\t\t\treturn true;\n\t\t\t} // found a contentEditable element in the chain\n\t\t\treturn isEditable( getParent( el ) ); // contentEditable is set to 'inherit'\n\t\t}\n\n\t\tfunction domIndexOf( child, parent ) {\n\t\t\treturn Array.prototype.indexOf.call( angular.element( parent ).children(), child );\n\t\t}\n\n\t\tfunction fireEvent( target, e, extra ) { // watch performance!! - function is running each mousemove!\n\t\t\tif ( !target ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tshared.extra = extra;\n\t\t\tif ( target.dispatchEvent ) {\n\t\t\t\ttarget.dispatchEvent( e );\n\t\t\t} else {\n\t\t\t\ttarget.fireEvent( 'on' + e.eventType, e );\n\t\t\t}\n\t\t}\n\n\t\tfunction getBool( prop, args, context ) {\n\t\t\tif ( _isFunction( prop ) ) {\n\t\t\t\treturn !!prop.apply( context || this, args || shared );\n\t\t\t} else {\n\t\t\t\treturn !!prop;\n\t\t\t}\n\t\t}\n\n\t};\n\n\tdragularService.$inject = [ '$rootScope', '$compile' ];\n\n\tmodule.exports = dragularService;\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar examplesRouter = function ($stateProvider, $urlRouterProvider) {\n\t $urlRouterProvider.otherwise('/home');\n\n\t var timer,\n\t ctrl = function routerCtrl($state, $stateParams, $timeout) {\n\t // go to install notes by default\n\t if (!$stateParams.link) {\n\t timer = $timeout(function timer() {\n\t $state.go('docs.detail', {\n\t link: 'docsInstall'\n\t });\n\t },0);\n\t }else{\n\t $timeout.cancel(timer);\n\t }\n\t };\n\n\t ctrl.$inject = ['$state', '$stateParams', '$timeout'];\n\n\t $stateProvider\n\t .state('home', {\n\t url: '/home',\n\t templateUrl: 'partials/partial-home.html'\n\t })\n\t .state('docs', {\n\t url: '/docs',\n\t templateUrl: 'partials/partial-docs.html',\n\t controller: ctrl\n\t })\n\t .state('docs.detail', {\n\t url: '/:link',\n\t templateUrl: function($stateParams) {\n\t return $stateParams.link + '/' + $stateParams.link + '.html';\n\t },\n\t controller: ctrl\n\t })\n\t .state('contribute', {\n\t url: '/contribute',\n\t templateUrl: 'partials/partial-contribute.html'\n\t });\n\t};\n\n\texamplesRouter.$inject = ['$stateProvider', '$urlRouterProvider'];\n\n\tmodule.exports = examplesRouter;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar BasicCtrl = function ($element, dragularService) {\n\t dragularService.cleanEnviroment();\n\t dragularService('.containerVertical');\n\t};\n\n\tBasicCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = BasicCtrl;\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\tvar BasicModelCtrl = function ($scope, $element, dragularService) {\n\t $scope.items1 = [{\n\t content: 'Move me, but you can only drop me in one of these containers.'\n\t }, {\n\t content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n\t }, {\n\t content: 'Item 3'\n\t }, {\n\t content: 'Item 4'\n\t }];\n\t $scope.items2 = [{\n\t content: 'Item 5'\n\t }, {\n\t content: 'Item 6'\n\t }, {\n\t content: 'Item 7'\n\t }, {\n\t content: 'Item 8'\n\t }];\n\t var containers = $element.children().eq(0).children();\n\t dragularService.cleanEnviroment();\n\t // var drake = dragularService([containers[0],containers[1]],{\n\t // dragularService([containers[0]],{\n\t dragularService([containers[0], containers[1]],{\n\t containersModel: [$scope.items1, $scope.items2],\n\t // canBeAccepted: function () {\n\t // return false;\n\t // },\n\t // accepts: function () {\n\t // return false;\n\t // },\n\t // isContainer: function (el) {\n\t // return el.id == 'test';\n\t // },\n\t // isContainerModel: function () {\n\t // return $scope.items2;\n\t // }\n\t // scope: $scope\n\t });\n\n\t\t// $scope.$on('dragularcloned', myFn('cloned'));\n\t\t// $scope.$on('dragulardrag', myFn('drag'));\n\t\t// $scope.$on('dragularcancel', myFn('cancel'));\n\t\t// $scope.$on('dragulardrop', myFn('drop'));\n\t\t// $scope.$on('dragularremove', myFn('remove'));\n\t\t// $scope.$on('dragulardragend', myFn('dragend'));\n\t\t// $scope.$on('dragularshadow', myFn('shadow'));\n\t\t//\n\t\t// function myFn(eventName) {\n\t\t// \treturn function() {\n\t\t// \t\tconsole.log(eventName, arguments, drake);\n\t\t// \t};\n\t\t// }\n\n\t};\n\n\tBasicModelCtrl.$inject = ['$scope', '$element', 'dragularService'];\n\n\tmodule.exports = BasicModelCtrl;\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar BoundingBoxCtrl = function ($element, dragularService) {\n\t var boundingBox = $element[0];\n\t dragularService.cleanEnviroment();\n\n\t dragularService($element.children(), {\n\t boundingBox: boundingBox\n\t });\n\t};\n\n\tBoundingBoxCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = BoundingBoxCtrl;\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar BoundingBoxLockXCtrl = function ($element, dragularService) {\n\t var boundingBox = $element.children().children()[0];\n\t dragularService.cleanEnviroment();\n\t dragularService(boundingBox, {\n\t boundingBox: boundingBox,\n\t lockX: true\n\t });\n\t};\n\n\tBoundingBoxLockXCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = BoundingBoxLockXCtrl;\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar BoundingBoxLockYCtrl = function ($element, dragularService) {\n\t var boundingBox = $element.children().children()[0];\n\t dragularService.cleanEnviroment();\n\t dragularService(boundingBox, {\n\t boundingBox: boundingBox,\n\t lockY: true\n\t });\n\t};\n\n\tBoundingBoxLockYCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = BoundingBoxLockYCtrl;\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar CopyCtrl = function ($element, dragularService) {\n\t dragularService.cleanEnviroment();\n\t dragularService($element.children(), {\n\t copy: true\n\t });\n\t};\n\n\tCopyCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = CopyCtrl;\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar CopyModelCtrl = function ($scope, $element, dragularService) {\n\t $scope.items1 = [{\n\t content: 'Move me, and make copy on drop.'\n\t }, {\n\t content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n\t }, {\n\t content: 'Item 3'\n\t }, {\n\t content: 'Item 4'\n\t }];\n\t $scope.items2 = [{\n\t content: 'Item 5'\n\t }, {\n\t content: 'Item 6'\n\t }, {\n\t content: 'Item 7'\n\t }, {\n\t content: 'Item 8'\n\t }];\n\t var containers = $element.children().eq(0).children();\n\t dragularService.cleanEnviroment();\n\t dragularService([containers[0],containers[1]],{\n\t containersModel: [$scope.items1, $scope.items2],\n\t copy: true\n\t });\n\t};\n\n\tCopyModelCtrl.$inject = ['$scope', '$element', 'dragularService'];\n\n\tmodule.exports = CopyModelCtrl;\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar CustomClassesCtrl = function ($element, dragularService) {\n\t dragularService.cleanEnviroment();\n\t dragularService($element.children(), {\n\t classes: {\n\t mirror: 'custom-green-mirror'\n\t }\n\t });\n\t};\n\n\tCustomClassesCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = CustomClassesCtrl;\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar DifferentOptionsModelCtrl = function ($scope, $element, dragularService) {\n\t $scope.items1 = [{\n\t content: 'Move me, but you can only drop me in one of these containers.'\n\t }, {\n\t content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n\t }, {\n\t content: 'Item 3'\n\t }, {\n\t content: 'Item 4'\n\t }];\n\t $scope.items2 = [{\n\t content: 'Item 5'\n\t }, {\n\t content: 'Item 6'\n\t }, {\n\t content: 'Item 7'\n\t }, {\n\t content: 'Item 8'\n\t }];\n\n\t var containerLeft = document.querySelector('#containerLeft'),\n\t containerRight = document.querySelector('#containerRight');\n\n\t function accepts(el, target, source) {\n\t // left->right || in same container\n\t if (source === containerLeft || source === target) {\n\t return true;\n\t }\n\t }\n\n\t dragularService.cleanEnviroment();\n\t dragularService([containerLeft], {\n\t containersModel: [$scope.items1],\n\t copy: true,\n\t copySortSource: true,\n\t //move only from left to right\n\t accepts: accepts\n\t });\n\n\t dragularService([containerRight], {\n\t containersModel: [$scope.items2],\n\t removeOnSpill: true,\n\t //move only from left to right\n\t accepts: accepts\n\t });\n\n\t};\n\n\tDifferentOptionsModelCtrl.$inject = ['$scope', '$element', 'dragularService'];\n\n\tmodule.exports = DifferentOptionsModelCtrl;\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar DirectiveCtrl = function ($scope) {\n\t $scope.dragularOptions = {\n\t classes: {\n\t mirror: 'custom-green-mirror'\n\t },\n\t nameSpace: 'same' // just connecting left and right container\n\t };\n\t};\n\n\tDirectiveCtrl.$inject = ['$scope'];\n\n\tmodule.exports = DirectiveCtrl;\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar DirectiveModelCtrl = function ($scope) {\n\t $scope.items1 = [{\n\t content: 'Move me, and make copy on drop.'\n\t }, {\n\t content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n\t }, {\n\t content: 'Item 3'\n\t }, {\n\t content: 'Item 4'\n\t }];\n\t $scope.items2 = [{\n\t content: 'Item 5'\n\t }, {\n\t content: 'Item 6'\n\t }, {\n\t content: 'Item 7'\n\t }, {\n\t content: 'Item 8'\n\t }];\n\t $scope.dragularOptions = {\n\t containersModel: $scope.items1,\n\t classes: {\n\t mirror: 'custom-green-mirror'\n\t },\n\t nameSpace: 'common' // just connecting left and right container\n\t };\n\t};\n\n\tDirectiveModelCtrl.$inject = ['$scope'];\n\n\tmodule.exports = DirectiveModelCtrl;\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports) {\n\n\t/* global angular */\n\t'use strict';\n\n\tvar DragOverEventsCtrl = function ($element, dragularService) {\n\t dragularService.cleanEnviroment();\n\t dragularService([$element.children()[0], $element.children()[2]], {\n\t nameSpace: 'apples'\n\t });\n\t dragularService([$element.children()[1], $element.children()[3]], {\n\t nameSpace: 'oranges'\n\t });\n\n\t // containers events handling\n\t function registerEvents(el) {\n\t el.on('dragularenter', function(e) {\n\t if (el[0] === e.target) { // filter bubbled\n\t el.addClass(dragularService.shared.extra ? 'gu-over-accept' : 'gu-over-decline');\n\t }\n\t });\n\t el.on('dragularleave dragularrelease', function(e) {\n\t if ((el[0] === e.target && // filter bubbled\n\t dragularService.shared.extra && // extra on dragleave contains element the drag is leaving to\n\t dragularService.shared.extra.parentElement !== e.target) || // is that element child of this container?\n\t e.type === 'dragularrelease') {\n\t el.removeClass('gu-over-accept');\n\t el.removeClass('gu-over-decline');\n\t }\n\t });\n\t }\n\n\t angular.forEach($element.children(), function forEachChild(el) {\n\t registerEvents(angular.element(el));\n\t });\n\n\t // notContainer events handling\n\t var notContainer = angular.element(document.getElementsByClassName('notContainer'));\n\t notContainer.on('dragularenter', function() {\n\t notContainer.addClass('gu-over');\n\t });\n\t notContainer.on('dragularleave dragularrelease', function() {\n\t notContainer.removeClass('gu-over');\n\t });\n\t};\n\n\tDragOverEventsCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = DragOverEventsCtrl;\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar EventsCtrl = function ($scope, $element, dragularService, $timeout) {\n\t dragularService.cleanEnviroment();\n\t \n\t var drake = dragularService($element.children(), {\n\t scope: $scope\n\t });\n\t $scope.$on('dragulardrag', function(e, el) {\n\t e.stopPropagation();\n\t el.className = el.className.replace(' ex-moved', '');\n\t });\n\t $scope.$on('dragulardrop', function(e, el) {\n\t e.stopPropagation();\n\t $timeout(function() {\n\t el.className += ' ex-moved';\n\t }, 0);\n\t });\n\n\t $scope.$on('dragularcloned', myFn('cloned in EventsCtrl'));\n\t $scope.$on('dragulardrag', myFn('drag in EventsCtrl'));\n\t $scope.$on('dragularcancel', myFn('cancel in EventsCtrl'));\n\t $scope.$on('dragulardrop', myFn('drop in EventsCtrl'));\n\t $scope.$on('dragularremove', myFn('remove in EventsCtrl'));\n\t $scope.$on('dragulardragend', myFn('dragend in EventsCtrl'));\n\t $scope.$on('dragularshadow', myFn('shadow in EventsCtrl'));\n\n\t function myFn(eventName) {\n\t return function() {\n\t console.log(eventName, arguments, drake);\n\t };\n\t }\n\t};\n\n\tvar Events2Ctrl = function ($scope, $element, dragularService, $timeout) {\n\t var drake = dragularService($element.children(), {\n\t scope: $scope\n\t });\n\t $scope.$on('dragulardrag', function(e, el) {\n\t e.stopPropagation();\n\t el.className = el.className.replace(' ex-moved', '');\n\t });\n\t $scope.$on('dragulardrop', function(e, el) {\n\t e.stopPropagation();\n\t $timeout(function() {\n\t el.className += ' ex-moved';\n\t }, 0);\n\t });\n\n\t $scope.$on('dragularcloned', myFn('cloned in Events2Ctrl'));\n\t $scope.$on('dragulardrag', myFn('drag in Events2Ctrl'));\n\t $scope.$on('dragularcancel', myFn('cancel in Events2Ctrl'));\n\t $scope.$on('dragulardrop', myFn('drop in Events2Ctrl'));\n\t $scope.$on('dragularremove', myFn('remove in Events2Ctrl'));\n\t $scope.$on('dragulardragend', myFn('dragend in Events2Ctrl'));\n\t $scope.$on('dragularshadow', myFn('shadow in Events2Ctrl'));\n\n\t function myFn(eventName) {\n\t return function() {\n\t console.log(eventName, arguments, drake);\n\t };\n\t }\n\t};\n\n\tEventsCtrl.$inject = ['$scope', '$element', 'dragularService', '$timeout'];\n\tEvents2Ctrl.$inject = ['$scope', '$element', 'dragularService', '$timeout'];\n\n\tmodule.exports = [EventsCtrl, Events2Ctrl];\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar HandleCtrl = function ($element, dragularService) {\n\t dragularService.cleanEnviroment();\n\t\tdragularService($element.children(), {\n\t moves: function(el, container, handle) {\n\t return handle.classList.contains('handle');\n\t }\n\t });\n\t};\n\n\tHandleCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = HandleCtrl;\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar IsContainerModelCtrl = function ($scope, $element, dragularService) {\n\t $scope.items1 = [{\n\t content: 'Move me, but you can only drop me in one of these containers.'\n\t }, {\n\t content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n\t }, {\n\t content: 'Item 3'\n\t }, {\n\t content: 'Item 4'\n\t }];\n\t $scope.cartModel = [];\n\n\t var containerLeft = document.querySelector('#containerLeft');\n\n\t dragularService.cleanEnviroment();\n\t dragularService([containerLeft], {\n\t containersModel: [$scope.items1],\n\t copy: true,\n\t isContainer: function isContainer (el) {\n\t return el.id === 'cart';\n\t },\n\t isContainerModel: function getModel (){\n\t return $scope.cartModel;\n\t }\n\t });\n\n\t $scope.removeItem = function removeItem() {\n\t var index = $scope.cartModel.indexOf(this.item);\n\t $scope.cartModel.splice(index, 1);\n\t };\n\t};\n\n\tIsContainerModelCtrl.$inject = ['$scope', '$element', 'dragularService'];\n\n\tmodule.exports = IsContainerModelCtrl;\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar NameSpacesCtrl = function ($element, dragularService) {\n\t dragularService.cleanEnviroment();\n\t dragularService([$element.children()[0], $element.children()[2]], {\n\t nameSpace: 'apples'\n\t });\n\t dragularService($element.children()[1], {\n\t nameSpace: 'oranges'\n\t });\n\t dragularService($element.children()[3], { // mixed\n\t nameSpace: ['oranges', 'apples']\n\t });\n\t};\n\n\tNameSpacesCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = NameSpacesCtrl;\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar NestedNgRepeatCtrl = function ($timeout, $scope, $element, dragularService) {\n\t $timeout(function() { // timeount due to ngRepeat to be ready\n\t dragularService.cleanEnviroment();\n\t dragularService($element, {\n\t nameSpace: 'rows',\n\t moves: function rowOnly (el, container, handle) {\n\t return handle.classList.contains('row-handle');\n\t }\n\t });\n\n\t dragularService($element.children(), {\n\t nameSpace: 'cells',\n\t moves: function excludeHandle (el, container, handle) {\n\t return !handle.classList.contains('row-handle');\n\t }\n\t });\n\t }, 0);\n\t $scope.items = [{\n\t items: [{\n\t content: 'Item a1'\n\t }, {\n\t content: 'Item a2'\n\t }, {\n\t content: 'Item a3'\n\t }, {\n\t content: 'Item a4'\n\t }]\n\t }, {\n\t items: [{\n\t content: 'Item b1'\n\t }, {\n\t content: 'Item b2'\n\t }, {\n\t content: 'Item b3'\n\t }, {\n\t content: 'Item b4'\n\t }]\n\t }, {\n\t items: [{\n\t content: 'Item c1'\n\t }, {\n\t content: 'Item c2'\n\t }, {\n\t content: 'Item c3'\n\t }, {\n\t content: 'Item c4'\n\t }]\n\t }];\n\t};\n\n\tNestedNgRepeatCtrl.$inject = ['$timeout', '$scope', '$element', 'dragularService'];\n\n\tmodule.exports = NestedNgRepeatCtrl;\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar NestedNgRepeatWithModelCtrl = function ($timeout, $scope, $element, dragularService) {\n\t $timeout(function() { // timeount due to nested ngRepeat to be ready\n\t var container = $element.children().eq(0).children(),\n\t parentContainers = container.children(),\n\t nestedContainers = [];\n\n\t dragularService.cleanEnviroment();\n\t dragularService(container, {\n\t moves: function(el, container, handle) {\n\t return handle.classList.contains('row-handle');\n\t },\n\t containersModel: $scope.items,\n\t nameSpace: 'rows'\n\t });\n\n\t // collect nested contianers\n\t for (var i = 0; i < parentContainers.length; i++) {\n\t nestedContainers.push(parentContainers.eq(i).children()[1]);\n\t }\n\n\t dragularService(nestedContainers, {\n\t moves: function(el, container, handle) {\n\t return !handle.classList.contains('row-handle');\n\t },\n\t containersModel: (function getNestedContainersModel(){\n\t var parent = $scope.items,\n\t containersModel = [];\n\t for (var i = 0; i < parent.length; i++) {\n\t containersModel.push(parent[i].items);\n\t }\n\t return containersModel;\n\t })(),\n\t nameSpace: 'cells'\n\t });\n\t }, 0);\n\t $scope.items = [{\n\t items: [{\n\t content: 'Item a1'\n\t }, {\n\t content: 'Item a2'\n\t }, {\n\t content: 'Item a3'\n\t }, {\n\t content: 'Item a4'\n\t }]\n\t }, {\n\t items: [{\n\t content: 'Item b1'\n\t }, {\n\t content: 'Item b2'\n\t }, {\n\t content: 'Item b3'\n\t }, {\n\t content: 'Item b4'\n\t }]\n\t }, {\n\t items: [{\n\t content: 'Item c1'\n\t }, {\n\t content: 'Item c2'\n\t }, {\n\t content: 'Item c3'\n\t }, {\n\t content: 'Item c4'\n\t }]\n\t }];\n\t};\n\n\tNestedNgRepeatWithModelCtrl.$inject = ['$timeout', '$scope', '$element', 'dragularService'];\n\n\tmodule.exports = NestedNgRepeatWithModelCtrl;\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar NgRepeatCtrl = function ($scope, $element, dragularService) {\n\t dragularService.cleanEnviroment();\n\t dragularService($element.children());\n\t $scope.items = [{\n\t content: 'Try to add or remove some elements (click on +- buttons), you will see that it is not problem for dragular.'\n\t }, {\n\t content: 'Item 2'\n\t }, {\n\t content: 'Item 3'\n\t }, {\n\t content: 'Item 4'\n\t }];\n\t $scope.addItem = function addItem() {\n\t var index = $scope.items.indexOf(this.item) + 1;\n\t $scope.items.splice(index, 0, {\n\t content: this.item.content + '-copy'\n\t });\n\t };\n\t $scope.removeItem = function removeItem() {\n\t var index = $scope.items.indexOf(this.item);\n\t $scope.items.splice(index, 1);\n\t };\n\t};\n\n\tNgRepeatCtrl.$inject = ['$scope', '$element', 'dragularService'];\n\n\tmodule.exports = NgRepeatCtrl;\n\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar NgRepeatFilteredWithModelCtrl = function ($scope, $element, dragularService, $filter) {\n\t $scope.items1 = [{\n\t content: 'Move me, but you can only drop me in one of these containers.'\n\t }, {\n\t content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n\t }, {\n\t content: 'Apple 3'\n\t }, {\n\t content: 'Orange 4'\n\t }, {\n\t content: 'Orange 5'\n\t }, {\n\t content: 'Apple 6'\n\t }, {\n\t content: 'Apple 7'\n\t }, {\n\t content: 'Apple 8'\n\t }];\n\t $scope.items2 = [{\n\t content: 'Apple 9'\n\t }, {\n\t content: 'Orange 10'\n\t }, {\n\t content: 'Orange 11'\n\t }, {\n\t content: 'Apple 12'\n\t }, {\n\t content: 'Orange 13'\n\t }, {\n\t content: 'Apple 14'\n\t }];\n\t $scope.filter1query = 'Orange';\n\t $scope.filter2query = 'Orange';\n\t $scope.filteredModel1 = [];\n\t $scope.filteredModel2 = [];\n\t $scope.getFilteredModel = function (filteredModel, items, filterQuery) {\n\t filteredModel.length = 0;\n\t /*\n\t * Following one-liner is same like:\n\t * var filteredModelTemp = $filter('filter')(items, filterQuery);\n\t * angular.forEach(filteredModelTemp, function(item){\n\t * filteredModel.push(item);\n\t * });\n\t * Or like:\n\t * var filteredModelTemp = $filter('filter')(items, filterQuery);\n\t * for(var i; i < filteredModelTemp.length; i++){\n\t * filteredModel.push(filteredModelTemp[i]);\n\t * }\n\t *\n\t * You cannot just assign filtered array to filteredModel like this:\n\t * filteredModel = $filter('filter')(items, filterQuery);\n\t * Because you would replace the array object you provide to dragular with new one.\n\t * So dragular will continue to use the one it was provided on init.\n\t * Hopefully I make it clear. :)\n\t */\n\t [].push.apply(filteredModel, $filter('filter')(items, filterQuery));\n\n\t // Example with orderBy filter:\n\t // var tmp = [];\n\t // [].push.apply(tmp, $filter('filter')(items, filterQuery));\n\t // [].push.apply(filteredModel, $filter('orderBy')(tmp, '+content'));\n\n\t return filteredModel;\n\t };\n\t var containers = $element.children().eq(1).children();\n\t dragularService.cleanEnviroment();\n\t dragularService([containers[0],containers[1]],{\n\t containersModel: [$scope.items1, $scope.items2],\n\t containersFilteredModel: [$scope.filteredModel1, $scope.filteredModel2]\n\t });\n\t};\n\n\tNgRepeatFilteredWithModelCtrl.$inject = ['$scope', '$element', 'dragularService', '$filter'];\n\n\tmodule.exports = NgRepeatFilteredWithModelCtrl;\n\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar NgRepeatWithModelCtrl = function ($scope, $element, dragularService) {\n\t $scope.items = [{\n\t content: 'Try to add or remove some elements (click on +- buttons), you will see that it is not problem for dragular.'\n\t }, {\n\t content: 'Item 2'\n\t }, {\n\t content: 'Item 3'\n\t }, {\n\t content: 'Item 4'\n\t }];\n\t dragularService.cleanEnviroment();\n\t dragularService($element.children().eq(0).children(), {containersModel: $scope.items});\n\t $scope.addItem = function addItem() {\n\t var index = $scope.items.indexOf(this.item) + 1;\n\t $scope.items.splice(index, 0, {\n\t content: this.item.content + '-copy'\n\t });\n\t };\n\t $scope.removeItem = function removeItem() {\n\t var index = $scope.items.indexOf(this.item);\n\t $scope.items.splice(index, 1);\n\t };\n\t};\n\n\tNgRepeatWithModelCtrl.$inject = ['$scope', '$element', 'dragularService'];\n\n\tmodule.exports = NgRepeatWithModelCtrl;\n\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar RemoveOnSpillCtrl = function ($element, dragularService) {\n\t dragularService.cleanEnviroment();\n\t\tdragularService($element.children(), {\n\t removeOnSpill: true\n\t });\n\t};\n\n\tRemoveOnSpillCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = RemoveOnSpillCtrl;\n\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar RemoveOnSpillWithModelCtrl = function ($scope, $element, dragularService) {\n\t $scope.items1 = [{\n\t content: 'Move me, but you can only drop me in containers.'\n\t }, {\n\t content: 'If you try to drop me somewhere other than containers, I\\'ll die a fiery death.'\n\t }, {\n\t content: 'Item 3'\n\t }, {\n\t content: 'Item 4'\n\t }];\n\t $scope.items2 = [{\n\t content: 'You can drop me in the left container.'\n\t }, {\n\t content: 'Item 6'\n\t }, {\n\t content: 'Item 7'\n\t }, {\n\t content: 'Item 8'\n\t }];\n\t var containers = $element.children().eq(0).children();\n\t dragularService.cleanEnviroment();\n\t dragularService([containers[0], containers[1]], {\n\t containersModel: [$scope.items1, $scope.items2],\n\t removeOnSpill: true\n\t });\n\t};\n\n\tRemoveOnSpillWithModelCtrl.$inject = ['$scope', '$element', 'dragularService'];\n\n\tmodule.exports = RemoveOnSpillWithModelCtrl;\n\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar RevertOnSpillCtrl = function ($element, dragularService) {\n\t dragularService.cleanEnviroment();\n\t dragularService($element.children(), {\n\t revertOnSpill: true\n\t });\n\t};\n\n\tRevertOnSpillCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = RevertOnSpillCtrl;\n\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports) {\n\n\t/* global angular */\n\t'use strict';\n\n\tvar ScrollingDragCtrl = function ($interval, $element, dragularService) {\n\t var timer,\n\t leftScrollContainer = document.getElementById('leftScroll'),\n\t rightScrollContainer = document.getElementById('rightScroll'),\n\t leftTopBar = document.getElementById('leftTopBar'),\n\t leftBottomBar = document.getElementById('leftBottomBar'),\n\t rightTopBar = document.getElementById('rightTopBar'),\n\t rightBottomBar = document.getElementById('rightBottomBar');\n\n\t dragularService.cleanEnviroment();\n\t dragularService([leftScrollContainer, rightScrollContainer]);\n\n\t registerEvents(leftTopBar, leftScrollContainer, -5);\n\t registerEvents(leftBottomBar, leftScrollContainer, 5);\n\t registerEvents(rightTopBar, rightScrollContainer, -5);\n\t registerEvents(rightBottomBar, rightScrollContainer, 5);\n\n\t function registerEvents(bar, container, inc, speed) {\n\t if (!speed) {\n\t speed = 20;\n\t }\n\t angular.element(bar).on('dragularenter', function() {\n\t container.scrollTop += inc;\n\t timer = $interval(function moveScroll() {\n\t container.scrollTop += inc;\n\t }, speed);\n\t });\n\t angular.element(bar).on('dragularleave dragularrelease', function() {\n\t $interval.cancel(timer);\n\t });\n\t }\n\t};\n\n\tScrollingDragCtrl.$inject = ['$interval', '$element', 'dragularService'];\n\n\tmodule.exports = ScrollingDragCtrl;\n\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports) {\n\n\t/* global angular */\n\t'use strict';\n\n\tNestedRepeatsWithCustomDirective.$inject = ['dragularService', '$element', '$scope', '$timeout'];\n\n\tangular.module('examplesApp')\n\t\t.directive('questionDirective', QuestionsDirective)\n\t\t.controller('QuestionsController', QuestionsController);\n\n\tmodule.exports = NestedRepeatsWithCustomDirective;\n\n\n\n\tfunction NestedRepeatsWithCustomDirective( dragularService, $element, $scope, $timeout) {\n\n\t\tdragularService.cleanEnviroment();\n\n\t\t$scope.items = [\n\t\t\t{\n\t\t\t\tquestions:[\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text1',\n\t\t\t\t\t\tpoints: 1\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text2',\n\t\t\t\t\t\tpoints: 2\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text3',\n\t\t\t\t\t\tpoints: 3\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\torder: 1,\n\t\t\t\tname: 'x',\n\t\t\t\tage: '1'\n\t\t\t},\n\t\t\t{\n\t\t\t\tquestions:[\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text1',\n\t\t\t\t\t\tpoints: 1\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text2',\n\t\t\t\t\t\tpoints: 2\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text3',\n\t\t\t\t\t\tpoints: 3\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\torder: 2,\n\t\t\t\tname: 'y',\n\t\t\t\tage: '2'\n\t\t\t}, {\n\t\t\t\tquestions:[\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text1',\n\t\t\t\t\t\tpoints: 1\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text2',\n\t\t\t\t\t\tpoints: 2\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text3',\n\t\t\t\t\t\tpoints: 3\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\torder: 3,\n\t\t\t\tname: 'z',\n\t\t\t\tage: '3'\n\t\t\t},\n\t\t\t{\n\t\t\t\tquestions:[\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text1',\n\t\t\t\t\t\tpoints: 1\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text2',\n\t\t\t\t\t\tpoints: 2\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text3',\n\t\t\t\t\t\tpoints: 3\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\torder: 1,\n\t\t\t\tname: 'x',\n\t\t\t\tage: '4'\n\t\t\t}, {\n\t\t\t\tquestions:[\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text1',\n\t\t\t\t\t\tpoints: 1\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text2',\n\t\t\t\t\t\tpoints: 2\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text3',\n\t\t\t\t\t\tpoints: 3\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\torder: 2,\n\t\t\t\tname: 'y',\n\t\t\t\tage: '5'\n\t\t\t}, {\n\t\t\t\tquestions:[\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text1',\n\t\t\t\t\t\tpoints: 1\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text2',\n\t\t\t\t\t\tpoints: 2\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text3',\n\t\t\t\t\t\tpoints: 3\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\torder: 3,\n\t\t\t\tname: 'z',\n\t\t\t\tage: '6'\n\t\t\t}];\n\n\t\t// timeout due to document not ready, jsfiddle settings issue?\n\t\t$timeout(function() {\n\n\t\t\tdragularService('#items', {\n\t\t\t\tcontainersModel: 'items',\n\t\t\t\tscope: $scope,\n\t\t\t\tmoves: function itemsOnly (el, container, handle) {\n\t\t\t\t\treturn handle.classList.contains('item');\n\t\t\t\t},\n\t\t\t\tnameSpace:'items'\n\t\t\t});\n\n\t\t\t$scope.$on('dragulardrop', function(){\n\t\t\t\t$scope.items.forEach(function(item, index){\n\t\t\t\t\titem.order = index + 1;\n\t\t\t\t});\n\t\t\t});\n\n\t\t});\n\n\t}\n\n\tfunction QuestionsDirective() {\n\t\treturn {\n\t\t\trestrict : 'E',\n\t\t\ttemplate : '
{{subitem.points}}. {{subitem.text}}
',\n\t\t\tcontroller : 'QuestionsController',\n\t\t\tscope : {\n\t\t\t\tquestion: '='\n\t\t\t}\n\t\t};\n\t}\n\n\tfunction QuestionsController($scope, dragularService, $element) {\n\n\t\tdragularService( $element.children('.all-data'), {\n\t\t\tcontainersModel: 'question',\n\t\t\tscope: $scope,\n\t\t\tnameSpace: 'subitem',\n\t\t\tmoves: function subItemsOnly (el, container, handle) {\n\t\t\t\treturn handle.classList.contains('subitem');\n\t\t\t}\n\t\t});\n\n\t\t$scope.$on('dragulardrop', function(){\n\t\t\t$scope.question.forEach(function(item, index){\n\t\t\t\titem.points = index + 1;\n\t\t\t});\n\t\t});\n\t}\n\n\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports) {\n\n\t'use strict'; module.exports = angular.module(\"templates\", []).run([\"$templateCache\", function($templateCache) {$templateCache.put(\"docsInstall/docsInstall.html\",\"

Install

\\n

download dragular.js and dragular.css from dist folder

\\n

OR clone git

\\n
\\ngit clone http://github.com/luckylooke/dragular.git\\n
\\n

OR use npm

\\n
\\n[sudo] npm install dragular\\n
\\n

OR use bower

\\n
\\nbower install dragular\\n
\\n

AND include files into your project

\\n
\\n<link href=\\'styles/dragular.css\\' rel=\\'stylesheet\\' type=\\'text/css\\' />\\n<script src=\\'scripts/dragular.js\\'></script>\\n
\\n

AND put dragularModule into dependency array

\\n
\\nvar app = angular.module(\\'myApp\\', [\\'dragularModule\\', \\'otherDependencies\\']);\\n
\\n

DONE :)

\\n\");\n\t$templateCache.put(\"exampleBasic/exampleBasic.html\",\"
\\n

Basic

\\n \\n
\\n
\\n
Move me, but you can only drop me in one of these containers.
\\n
If you try to drop me somewhere other than these containers, I\\'ll just come back.
\\n
Item 3.
\\n
Item 6.
\\n
\\n
\\n
You can drop me in the left container, otherwise I\\'ll stay here.
\\n
Try to click me, dragular distinguish drag from click
\\n
Item 5.
\\n
\\n
\\n
\\n        \\n// JS\\n  controller(\\'Basic\\', [\\'$element\\', \\'dragularService\\', function TodoCtrl($element, dragularService) {\\n    dragularService(\\'.containerVertical\\');\\n  }])\\n        \\n        \\n// CSS\\n.clickedClass {\\n  background-color: orange !important;\\n}\\n        \\n        \\n<!-- HTML -->\\n  <div class=\\'wrapper\\' ng-controller="Basic">\\n    <div class=\\'containerVertical\\'>\\n        <div>Move me, but you can only drop me in one of these containers.</div>\\n        <div>If you try to drop me somewhere other than these containers, I\\'ll just come back.</div>\\n        <div>Item 3.</div>\\n        <div>Item 6.</div>\\n    </div>\\n    <div class=\\'containerVertical\\'>\\n        <div>You can drop me in the left container, otherwise I\\'ll stay here.</div>\\n        <div ng-click=\\\"clicked = !clicked\\\" ng-class=\\\"clicked && \\'clickedClass\\'\\\">Try to click me, dragular distinguish drag from click</div>\\n        <div>Item 5.</div>\\n    </div>\\n</div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleBasicWithModel/exampleBasicWithModel.html\",\"
\\n

Basic - with model

\\n \\n
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
\\n
\\n
Items1:\\n          
{{items1 | json}}
\\n
\\n
\\n
Items2:\\n          
{{items2 | json}}
\\n
\\n
\\n
\\n
\\n        \\n// JS\\n  controller(\\'BasicModel\\', [\\'$scope\\', \\'$element\\', \\'dragularService\\', function TodoCtrl($scope, $element, dragularService) {\\n    $scope.items1 = [{\\n      content: \\'Move me, but you can only drop me in one of these containers.\\'\\n    }, {\\n      content: \\'If you try to drop me somewhere other than these containers, I\\\\\\'ll just come back.\\'\\n    }, {\\n      content: \\'Item 3\\'\\n    }, {\\n      content: \\'Item 4\\'\\n    }];\\n    $scope.items2 = [{\\n      content: \\'Item 5\\'\\n    }, {\\n      content: \\'Item 6\\'\\n    }, {\\n      content: \\'Item 7\\'\\n    }, {\\n      content: \\'Item 8\\'\\n    }];\\n    var containers = $element.children().children();\\n    dragularService([containers[0],containers[1]],{\\n      containersModel: [$scope.items1, $scope.items2]\\n    });\\n  }])\\n        \\n        \\n<!-- HTML -->\\n<div class=\\'wrapper\\' ng-controller="Basic">\\n    <div class=\\'tableRow\\'>\\n        <div class=\\'containerVertical\\'>\\n            <div ng-repeat="item in items1">{{item.content}}</div>\\n        </div>\\n        <div class=\\'containerVertical\\'>\\n            <div ng-repeat="item in items2">{{item.content}}</div>\\n        </div>\\n    </div>\\n    <div class="tableRow">\\n        <div class="container">\\n            <div>Items1:\\n                <br/>{{items1 | json}}</div>\\n        </div>\\n        <div class="container">\\n            <div>Items2:\\n                <br/>{{items2 | json}}</div>\\n        </div>\\n    </div>\\n</div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleBoundingBox/exampleBoundingBox.html\",\"
\\n

BoundingBox

\\n \\n
\\n
\\n
This items cannot cross its example element, just try it your selves.
\\n
Item 2.
\\n
Item 3.
\\n
Item 6.
\\n
\\n
\\n
This items cannot cross its example element, just try it your selves.
\\n
Item 4.
\\n
Item 5.
\\n
\\n
\\n
\\n        \\n  dragularService([$element.children(), {\\n    boundingBox: $element\\n  });\\n        \\n      
\\n
\");\n\t$templateCache.put(\"exampleBoundingBoxLockY/exampleBoundingBoxLockY.html\",\"
\\n

BoundingBox and LockY

\\n \\n
\\n
\\n
\\n
Items are locked in Y axis movement and cannot cross its closest parent div.boundingBox, just try it your selves.
\\n
item 2
\\n
item 3
\\n
item 4
\\n
item 5
\\n
item 6
\\n
\\n
\\n
\\n
\\n        \\n  dragularService([$element.children()[0].children(), {\\n    boundingBox: $element.children()[0],\\n    lockY: true\\n  });\\n        \\n      
\\n
\");\n\t$templateCache.put(\"exampleBoundingBoxLockX/exampleBoundingBoxLockX.html\",\"
\\n

BoundingBox and lockX

\\n \\n
\\n
\\n
\\n
Items are locked in X axis movement and cannot cross its closest parent div.boundingBox, just try it your selves.
\\n
item 2
\\n
item 3
\\n
item 4
\\n
\\n
\\n
\\n
\\n        \\n  dragularService([$element.children()[0].children(), {\\n    boundingBox: $element.children()[0],\\n    lockX: true\\n  });\\n        \\n      
\\n
\");\n\t$templateCache.put(\"exampleCopy/exampleCopy.html\",\"
\\n

Copy

\\n \\n
\\n
\\n
Move me, and make copy on drop.
\\n
If you try to drop me somewhere other than these containers, I\\'ll just come back.
\\n
\\n
\\n
You can drop me in the left container, otherwise I\\'ll stay here.
\\n
\\n
\\n
\\n        \\n// JS\\n  controller(\\'Copy\\', [\\'$element\\', \\'dragularService\\', function TodoCtrl($element, dragularService) {\\n    dragularService($element.children(), {\\n      copy: true\\n    });\\n  }])\\n        \\n        \\n<!-- HTML -->\\n<div class=\\'wrapper\\' ng-controller="Copy" ng-hide="globals.showModelExamples">\\n    <div id=\\'left2\\' class=\\'containerVertical\\'>\\n      <div>Move me, and make copy on drop.</div>\\n      <div>If you try to drop me somewhere other than these containers, I\\'ll just come back.</div>\\n    </div>\\n    <div id=\\'right2\\' class=\\'containerVertical\\'>\\n      <div>You can drop me in the left container, otherwise I\\'ll stay here.</div>\\n    </div>\\n  </div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleCopyWithModel/exampleCopyWithModel.html\",\"
\\n

Copy - with model

\\n \\n
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
\\n
\\n
Items1:\\n
\\n            {{ items1 | json }}\\n          
\\n
\\n
\\n
\\n
Items2:\\n
\\n            {{ items2 | json }}\\n          
\\n
\\n
\\n
\\n
\\n
\\n        \\n// JS\\n  controller(\\'CopyModel\\', [\\'$scope\\', \\'$element\\', \\'dragularService\\', function TodoCtrl($scope, $element, dragularService) {\\n    $scope.items1 = [{\\n      content: \\'Move me, and make copy on drop.\\'\\n    }, {\\n      content: \\'If you try to drop me somewhere other than these containers, I\\\\\\'ll just come back.\\'\\n    }, {\\n      content: \\'Item 3\\'\\n    }, {\\n      content: \\'Item 4\\'\\n    }];\\n    $scope.items2 = [{\\n      content: \\'Item 5\\'\\n    }, {\\n      content: \\'Item 6\\'\\n    }, {\\n      content: \\'Item 7\\'\\n    }, {\\n      content: \\'Item 8\\'\\n    }];\\n    var containers = $element.children().children();\\n    dragularService([containers[0],containers[1]],{\\n      containersModel: [$scope.items1, $scope.items2],\\n      copy: true\\n    });\\n  }])\\n        \\n        \\n<!-- HTML -->\\n<div class=\\'wrapper\\' ng-controller="CopyModel" ng-show="globals.showModelExamples">\\n    <div class=\\'tableRow\\'>\\n      <div class=\\'containerVertical\\'>\\n        <div ng-repeat="item in items1">{{item.content}}</div>\\n      </div>\\n      <div class=\\'containerVertical\\'>\\n        <div ng-repeat="item in items2">{{item.content}}</div>\\n      </div>\\n    </div>\\n    <div class="tableRow">\\n      <div class="container">\\n        <div>Items1:\\n          <br/>{{items1 | json}}</div>\\n      </div>\\n      <div class="container">\\n        <div>Items2:\\n          <br/>{{items2 | json}}</div>\\n      </div>\\n    </div>\\n  </div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleCustomClasses/exampleCustomClasses.html\",\"
\\n

Custom classes

\\n \\n
\\n
\\n
Move me, but you can only drop me in one of these containers.
\\n
If you try to drop me somewhere other than these containers, I\\'ll just come back.
\\n
Item 3.
\\n
Item 6.
\\n
\\n
\\n
You can drop me in the left container, otherwise I\\'ll stay here.
\\n
Item 4.
\\n
Item 5.
\\n
\\n
\\n
\\n        \\n  dragularService([document.getElementById(left), document.getElementById(right)], { classes: {\\n    mirror: \\'custom-green-mirror\\'\\n  } });\\n\\n  // Default classes are:\\n  option.classes = {\\n    mirror: \\'gu-mirror\\',\\n    hide: \\'gu-hide\\',\\n    unselectable: \\'gu-unselectable\\',\\n    transit: \\'gu-transit\\',\\n    overActive: \\'gu-over-active\\',\\n    overAccepts: \\'gu-over-accept\\',\\n    overDeclines: \\'gu-over-decline\\'\\n  };\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleDifferentOptionsWithModel/exampleDifferentOptionsWithModel.html\",\"
\\n

Different options - with model

\\n \\n
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
\\n
\\n
Items1:\\n          
{{items1 | json}}
\\n
\\n
\\n
Items2:\\n          
{{items2 | json}}
\\n
\\n
\\n
\\n
\\n        \\n// JS\\n  .controller(\\'DifferentOptionsModel\\', [\\'$scope\\', \\'$element\\', \\'dragularService\\', function TodoCtrl($scope, $element, dragularService) {\\n    $scope.items1 = [{\\n      content: \\'Move me, but you can only drop me in one of these containers.\\'\\n    }, {\\n      content: \\'If you try to drop me somewhere other than these containers, I\\\\\\'ll just come back.\\'\\n    }, {\\n      content: \\'Item 3\\'\\n    }, {\\n      content: \\'Item 4\\'\\n    }];\\n    $scope.items2 = [{\\n      content: \\'Item 5\\'\\n    }, {\\n      content: \\'Item 6\\'\\n    }, {\\n      content: \\'Item 7\\'\\n    }, {\\n      content: \\'Item 8\\'\\n    }];\\n\\n    var containerLeft = document.querySelector(\\'#containerLeft\\'),\\n      containerRight = document.querySelector(\\'#containerRight\\');\\n\\n    function accepts(el, target, source) {\\n      if (source === containerLeft || source === target) {\\n        return true;\\n      }\\n    }\\n\\n    dragularService([containerLeft], {\\n      containersModel: [$scope.items1],\\n      copy: true,\\n      //move only from left to right  \\n      accepts: accepts\\n    });\\n\\n    dragularService([containerRight], {\\n      containersModel: [$scope.items2],\\n      removeOnSpill: true,\\n      //move only from left to right  \\n      accepts: accepts\\n    });\\n\\n  }])\\n        \\n        \\n<!-- HTML -->\\n<div class=\\'wrapper\\' ng-controller="DifferentOptionsModel">\\n    <div class=\\'tableRow\\'>\\n      <div id="containerLeft" class=\\'containerVertical\\'>\\n        <div ng-repeat="item in items1">{{item.content}}</div>\\n      </div>\\n      <div id="containerRight" class=\\'containerVertical\\'>\\n        <div ng-repeat="item in items2">{{item.content}}</div>\\n      </div>\\n    </div>\\n    <div class="tableRow">\\n      <div class=\\'containerVertical\\'>\\n        <pre>Items1:\\n          <br/>{{items1 | json}}</pre>\\n      </div>\\n      <div class=\\'containerVertical\\'>\\n        <pre>Items2:\\n          <br/>{{items2 | json}}</pre>\\n      </div>\\n    </div>\\n  </div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleDirective/exampleDirective.html\",\"
\\n

Directive

\\n \\n
\\n
\\n
Move me, but you can only drop me in one of these containers.
\\n
If you try to drop me somewhere other than these containers, I\\'ll just come back.
\\n
Item 3.
\\n
Item 6.
\\n
\\n
\\n
You can drop me in the left container, otherwise I\\'ll stay here.
\\n
Item 4.
\\n
Item 5.
\\n
\\n
\\n
\\n        \\n// JS\\n  controller(\\'Directive\\', [\\'$scope\\', \\'dragularService\\', function TodoCtrl($scope) {\\n    $scope.dragularOptions = {\\n      classes: {\\n        mirror: \\'custom-green-mirror\\'\\n      },\\n      nameSpace: \\'common\\' // just connecting left and right container\\n    };\\n  }])\\n        \\n        \\n<!-- HTML -->\\n<div class=\\'wrapper\\' ng-controller="Directive">\\n    <div class=\\'containerVertical\\' dragular="dragularOptions">\\n      <div>Move me, but you can only drop me in one of these containers.</div>\\n      <div>If you try to drop me somewhere other than these containers, I\\'ll just come back.</div>\\n      <div>Item 3.</div>\\n      <div>Item 6.</div>\\n    </div>\\n    <div class=\\'containerVertical\\' dragular=\\'{"classes":{"mirror":"custom-green-mirror"},"nameSpace":"same"}\\'>\\n      <div>You can drop me in the left container, otherwise I\\'ll stay here.</div>\\n      <div>Item 4.</div>\\n      <div>Item 5.</div>\\n    </div>\\n  </div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleDirectiveWithModel/exampleDirectiveWithModel.html\",\"
\\n

Directive - with model

\\n \\n
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
\\n
\\n
Items1:\\n
{{items1 | json}}
\\n
\\n
\\n
Items2:\\n
{{items2 | json}}
\\n
\\n
\\n
\\n
\\n       \\n        \\n// JS\\n  controller(\\'DirectiveModel\\', [\\'$scope\\', function TodoCtrl($scope) {\\n    $scope.items1 = [{\\n      content: \\'Move me, and make copy on drop.\\'\\n    }, {\\n      content: \\'If you try to drop me somewhere other than these containers, I\\\\\\'ll just come back.\\'\\n    }, {\\n      content: \\'Item 3\\'\\n    }, {\\n      content: \\'Item 4\\'\\n    }];\\n    $scope.items2 = [{\\n      content: \\'Item 5\\'\\n    }, {\\n      content: \\'Item 6\\'\\n    }, {\\n      content: \\'Item 7\\'\\n    }, {\\n      content: \\'Item 8\\'\\n    }];\\n    $scope.dragularOptions = {\\n      containersModel: $scope.items1,\\n      classes: {\\n        mirror: \\'custom-green-mirror\\'\\n      },\\n      nameSpace: \\'common\\' // just connecting left and right container\\n    };\\n  }])\\n        \\n        \\n<!-- HTML -->\\n <div class=\\'wrapper\\' ng-controller="DirectiveModel">\\n  <div class=\\'containerVertical\\' dragular="dragularOptions">\\n    <div ng-repeat="item in items1">{{item.content}}</div>\\n  </div>\\n  <div class=\\'containerVertical\\' dragular=\\'{"containersModel":"items2","classes":{"mirror":"custom-green-mirror"},"nameSpace":"common"}\\'>\\n    <div ng-repeat="item in items2">{{item.content}}</div>\\n  </div>\\n</div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleDragOverEvents/exampleDragOverEvents.html\",\"
\\n

Drag-over events

\\n

You can interact with dragging element by litening to dragOver events. Usually you want to containers show wheather they accepts element or not, but you can use it anywhere. DragOver events are: dragenter, dragleave and dragrelease. On dragOver events dragularService reveals several useful properties.

\\n\\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
dragularService.shared.itemitem beeing dragged (it is copy of item if copy is enabled via options)
dragularService.shared.sourcesource container item is dragged from
dragularService.shared.sourceModelsource container model representation if model was porvided
dragularService.shared.initialIndexoriginal index of item, can be used to get item model from sourceModel
dragularService.shared.extracontains accepting information (boolean) on dragenter, element drag is leaving to on dragleave and element behind the cursor on dragrelease
\\n
\\n\\n

Try to drag over the not-container too.

\\n
\\n
\\n
apples and oranges cannot be mixed
\\n
apple 2
\\n
apple 3
\\n
apple 4
\\n
\\n
\\n
orange 1
\\n
orange 2
\\n
orange 3
\\n
orange 4
\\n
\\n
\\n
apple 5
\\n
apple 6
\\n
apple 7
\\n
apple 8
\\n
\\n
\\n
orange 5
\\n
orange 6
\\n
orange 7
\\n
orange 8
\\n
\\n
\\n
Test active class on NOT container.
\\n\\n
\\n    \\n<!-- HTML -->\\n  <div class=\\'wrapper\\' ng-controller="DragOverEvents">\\n    <div class=\\'container width25\\'>\\n      <div>apples and oranges cannot be mixed</div>\\n      <div>apple 2</div>\\n      ...\\n    </div>\\n    <div class=\\'container width25\\'>\\n      <div>orange 1</div>\\n      <div>orange 2</div>\\n      ...\\n    </div>\\n    <div class=\\'container width25\\'>\\n      <div>apple 5</div>\\n      <div>apple 6</div>\\n      ...\\n    </div>\\n    <div class=\\'container width25\\'>\\n      <div>orange 5</div>\\n      <div>orange 6</div>\\n      ...\\n    </div>\\n  </div>\\n  <div class="notContainer"> Test active class on NOT container.</div>\\n    \\n  
\\n\\n
\\n    \\n  // CSS\\n  \\n.notContainer.gu-over {\\n  background-color: yellow;\\n}\\n\\n.containerVertical.gu-over-accept {\\n  background-color: green;\\n}\\n\\n.containerVertical.gu-over-decline {\\n  background-color: red;\\n}\\n    \\n  
\\n\\n
\\n    \\n  // JS\\n  controller(\\'DragOverEvents\\', [\\'$element\\', \\'dragularService\\', function TodoCtrl($element, dragularService) {\\n    dragularService.cleanEnviroment();\\n    dragularService([$element.children()[0], $element.children()[2]], {\\n      nameSpace: \\'apples\\'\\n    });\\n    dragularService([$element.children()[1], $element.children()[3]], {\\n      nameSpace: \\'oranges\\'\\n    });\\n\\n    // containers events handling\\n    function registerEvents(el) {\\n      el.on(\\'dragularenter\\', function(e) {\\n        if (el[0] === e.target) { // filter bubbled\\n          el.addClass(dragularService.shared.extra ? \\'gu-over-accept\\' : \\'gu-over-decline\\');\\n        }\\n      });\\n      el.on(\\'dragularleave dragularrelease\\', function(e) {\\n        if ((el[0] === e.target && // filter bubbled\\n          dragularService.shared.extra && // extra on dragleave contains element the drag is leaving to\\n          dragularService.shared.extra.parentElement !== e.target) // is that element child of this container?\\n          || e.type === \\'dragularrelease\\') {\\n          el.removeClass(\\'gu-over-accept\\');\\n          el.removeClass(\\'gu-over-decline\\');\\n        }\\n      });\\n    }\\n\\n    angular.forEach($element.children(), function forEachChild(el) {\\n      registerEvents(angular.element(el));\\n    });\\n\\n    // notContainer events handling\\n    var notContainer = angular.element(document.getElementsByClassName(\\'notContainer\\'));\\n    notContainer.on(\\'dragularenter\\', function() {\\n      notContainer.addClass(\\'gu-over\\');\\n    });\\n    notContainer.on(\\'dragularleave dragularrelease\\', function() {\\n      notContainer.removeClass(\\'gu-over\\');\\n    });\\n  }])\\n    \\n  
\\n
\\n\");\n\t$templateCache.put(\"exampleEvents/exampleEvents.html\",\"
\\n

Events

\\n

Events affecting more than on cotrollers are emitted on both scopes if provided.

\\n

EventsCtrl

\\n
\\n
\\n
Move me, but you can only drop me in one of these containers.
\\n
If you try to drop me somewhere other than these containers, I\\'ll just come back.
\\n
Item 3.
\\n
Item 6.
\\n
\\n
\\n
You can drop me in the left container, otherwise I\\'ll stay here.
\\n
Item 4.
\\n
Item 5.
\\n
\\n
\\n
\\n

Events2Ctrl

\\n
\\n
\\n
Move me, but you can only drop me in one of these containers.
\\n
If you try to drop me somewhere other than these containers, I\\'ll just come back.
\\n
Item 3.
\\n
Item 6.
\\n
\\n
\\n
You can drop me in the left container, otherwise I\\'ll stay here.
\\n
Item 4.
\\n
Item 5.
\\n
\\n
\\n
\\n        \\nvar EventsCtrl = function ($scope, $element, dragularService, $timeout) {\\n  \\n  var drake = dragularService($element.children(), {\\n    scope: $scope\\n  });\\n  $scope.$on(\\'dragulardrag\\', function(e, el) {\\n    e.stopPropagation();\\n    el.className = el.className.replace(\\' ex-moved\\', \\'\\');\\n  });\\n  $scope.$on(\\'dragulardrop\\', function(e, el) {\\n    e.stopPropagation();\\n    $timeout(function() {\\n      el.className += \\' ex-moved\\';\\n    }, 0);\\n  });\\n\\n  $scope.$on(\\'dragularcloned\\', myFn(\\'cloned in EventsCtrl\\'));\\n  $scope.$on(\\'dragulardrag\\', myFn(\\'drag in EventsCtrl\\'));\\n  $scope.$on(\\'dragularcancel\\', myFn(\\'cancel in EventsCtrl\\'));\\n  $scope.$on(\\'dragulardrop\\', myFn(\\'drop in EventsCtrl\\'));\\n  $scope.$on(\\'dragularremove\\', myFn(\\'remove in EventsCtrl\\'));\\n  $scope.$on(\\'dragulardragend\\', myFn(\\'dragend in EventsCtrl\\'));\\n  $scope.$on(\\'dragularshadow\\', myFn(\\'shadow in EventsCtrl\\'));\\n\\n  function myFn(eventName) {\\n    return function() {\\n      console.log(eventName, arguments, drake);\\n    };\\n  }\\n};\\n\\nvar Events2Ctrl = function ($scope, $element, dragularService, $timeout) {\\n  var drake = dragularService($element.children(), {\\n    scope: $scope\\n  });\\n  $scope.$on(\\'dragulardrag\\', function(e, el) {\\n    e.stopPropagation();\\n    el.className = el.className.replace(\\' ex-moved\\', \\'\\');\\n  });\\n  $scope.$on(\\'dragulardrop\\', function(e, el) {\\n    e.stopPropagation();\\n    $timeout(function() {\\n      el.className += \\' ex-moved\\';\\n    }, 0);\\n  });\\n\\n  $scope.$on(\\'dragularcloned\\', myFn(\\'cloned in Events2Ctrl\\'));\\n  $scope.$on(\\'dragulardrag\\', myFn(\\'drag in Events2Ctrl\\'));\\n  $scope.$on(\\'dragularcancel\\', myFn(\\'cancel in Events2Ctrl\\'));\\n  $scope.$on(\\'dragulardrop\\', myFn(\\'drop in Events2Ctrl\\'));\\n  $scope.$on(\\'dragularremove\\', myFn(\\'remove in Events2Ctrl\\'));\\n  $scope.$on(\\'dragulardragend\\', myFn(\\'dragend in Events2Ctrl\\'));\\n  $scope.$on(\\'dragularshadow\\', myFn(\\'shadow in Events2Ctrl\\'));\\n\\n  function myFn(eventName) {\\n    return function() {\\n      console.log(eventName, arguments, drake);\\n    };\\n  }\\n};\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleHandle/exampleHandle.html\",\"
\\n

Handle

\\n \\n
\\n
\\n
+Move me, but you can use the plus sign to drag me around.
\\n
\\n
\\n
\\n
\\n
\\n        \\n  dragularService([document.getElementById(left), document.getElementById(right)], {\\n    moves: function (el, container, handle) {\\n      return handle.className === \\'handle\\';\\n    }\\n  });\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleIsContainerWithModel/exampleIsContainerWithModel.html\",\"
\\n

isContainer - with model

\\n \\n
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
{{item.content}}\\n
\\n
\\n
\\n
\\n
\\n
Items1:\\n          
{{items1 | json}}
\\n
\\n
\\n
Cart:\\n          
{{cartModel | json}}
\\n
\\n
\\n
\\n
\\n        \\n// JS\\n  .controller(\\'IsContainerModel\\', [\\'$scope\\', \\'$element\\', \\'dragularService\\', function TodoCtrl($scope, $element, dragularService) {\\n    $scope.items1 = [{\\n      content: \\'Move me, but you can only drop me in one of these containers.\\'\\n    }, {\\n      content: \\'If you try to drop me somewhere other than these containers, I\\\\\\'ll just come back.\\'\\n    }, {\\n      content: \\'Item 3\\'\\n    }, {\\n      content: \\'Item 4\\'\\n    }];\\n    $scope.cartModel = [];\\n\\n    var containerLeft = document.querySelector(\\'#containerLeft\\');\\n\\n    dragularService.cleanEnviroment();\\n    dragularService([containerLeft], {\\n      containersModel: [$scope.items1],\\n      copy: true,\\n      isContainer: function isContainer (el) {\\n        return el.id === \\'cart\\';\\n      },\\n      isContainerModel: function getModel (){\\n        return $scope.cartModel;\\n      }\\n    });\\n\\n    $scope.removeItem = function removeItem() {\\n      var index = $scope.cartModel.indexOf(this.item);\\n      $scope.cartModel.splice(index, 1);\\n    };\\n\\n  }])\\n        \\n        \\n<!-- HTML -->\\n <div class=\\'wrapper\\' ng-controller="IsContainerModel">\\n    <div class=\\'tableRow\\'>\\n      <div id="containerLeft" class=\\'containerVertical\\'>\\n        <div ng-repeat="item in items1">{{item.content}}</div>\\n      </div>\\n      <div id="cart" class=\\'containerVertical\\'>\\n        <div class=\\'cursorDefault\\' ng-repeat="item in cartModel">{{item.content}}\\n        <button class=\\'cursorDefault\\' ng-click="removeItem()">x</button></div>\\n      </div>\\n    </div>\\n    <div class="tableRow">\\n      <div class=\\'containerVertical\\'>\\n        <pre>Items1:\\n          <br/>{{items1 | json}}</pre>\\n      </div>\\n      <div class=\\'containerVertical\\'>\\n        <pre>Cart:\\n          <br/>{{cartModel | json}}</pre>\\n      </div>\\n    </div>\\n  </div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleNameSpaces/exampleNameSpaces.html\",\"
\\n

NameSpaces

\\n \\n
\\n
\\n
try to mix oranges and apples
\\n
apple 2
\\n
apple 3
\\n
apple 4
\\n
\\n
\\n
orange 1
\\n
orange 2
\\n
orange 3
\\n
orange 4
\\n
\\n
\\n
apple 5
\\n
apple 6
\\n
apple 7
\\n
apple 8
\\n
\\n
\\n
mixed 1
\\n
mixed 2
\\n
mixed 3
\\n
mixed 4
\\n
\\n
\\n
\\n      \\ndragularService([$element.children()[0], $element.children()[2]], {\\n  nameSpace: \\'apples\\'\\n});\\ndragularService($element.children()[1], {\\n  nameSpace: \\'oranges\\'\\n});\\ndragularService($element.children()[3], { // mixed\\n  nameSpace: [\\'oranges\\', \\'apples\\']\\n});\\n      \\n    
\\n
\");\n\t$templateCache.put(\"exampleNestedNgRepeat/exampleNestedNgRepeat.html\",\"
\\n

Nested ngRepeat

\\n \\n
\\n
\\n
Row {{$index}}
\\n
{{item.content}}
\\n
\\n
\\n
\\n        \\n  // HTML\\n\\n  <div ng-controller="Example15">\\n    <div ng-repeat="item in items" class=\\'exampleRow\\'>\\n      <div class="row-handle">Row {{$index}}</div>\\n      <div ng-repeat="item in item.items" class="exampleCell">{{item.content}}</div>\\n    </div>\\n  </div>\\n        \\n      
\\n
\\n        \\n  // CSS\\n\\n  .exampleRow {\\n    display: flex;\\n    flex-direction: row;\\n  }\\n\\n  .exampleCell {\\n    flex-grow: 1;\\n  }\\n\\n  .exampleRow,\\n  .exampleCell {\\n    margin: 10px;\\n    padding: 10px;\\n    background-color: rgba(0, 0, 0, 0.2);\\n    cursor: move;\\n    cursor: grab;\\n    cursor: -moz-grab;\\n    cursor: -webkit-grab;\\n  }\\n        \\n      
\\n
\\n        \\n  // JS\\n\\n  .controller(\\'NestedNgRepeat\\', [\\'$timeout\\', \\'$scope\\', \\'$element\\', \\'dragularService\\', function NestedNgRepeatCtrl($timeout, $scope, $element, dragularService) {\\n    $timeout(function() { // timeount due to ngRepeat to be ready\\n      dragularService($element, {\\n        nameSpace: \\'rows\\',\\n        moves: function rowOnly (el, container, handle) {\\n          return handle.classList.contains(\\'row-handle\\');\\n        }\\n      });\\n      dragularService($element.children(), {\\n        nameSpace: \\'cells\\',\\n        moves: function excludeHandle (el, container, handle) {\\n          return !handle.classList.contains(\\'row-handle\\');\\n        }\\n      });\\n    }, 0);\\n    $scope.items = [{\\n      items: [{\\n        content: \\'Item a1\\'\\n      }, {\\n        content: \\'Item a2\\'\\n      }, {\\n        content: \\'Item a3\\'\\n      }, {\\n        content: \\'Item a4\\'\\n      }]\\n    }, {\\n      items: [{\\n        content: \\'Item b1\\'\\n      }, {\\n        content: \\'Item b2\\'\\n      }, {\\n        content: \\'Item b3\\'\\n      }, {\\n        content: \\'Item b4\\'\\n      }]\\n    }, {\\n      items: [{\\n        content: \\'Item c1\\'\\n      }, {\\n        content: \\'Item c2\\'\\n      }, {\\n        content: \\'Item c3\\'\\n      }, {\\n        content: \\'Item c4\\'\\n      }]\\n    }];\\n  }])\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleNestedNgRepeatWithModel/exampleNestedNgRepeatWithModel.html\",\"
\\n

Nested ngRepeat - with model

\\n \\n
\\n
\\n
\\n
\\n
Row {{::$index}}
\\n
\\n
{{item.content}}
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n            
Items:\\n
{{items | json}}
\\n
\\n
\\n
\\n
\\n
\\n    \\n<!-- HTML -->\\n<div ng-controller="NestedNgRepeatWithModel">\\n  <div class=\\'containerVertical\\'>\\n    <div ng-repeat="item in items" class=\\'exampleRow\\'>\\n      <div class="row-handle">Row {{::$index}}</div>\\n      <div class="exampleRow exampleCell containerNested">\\n        <div ng-repeat="item in item.items" class="exampleCell">{{item.content}}</div>\\n      </div>\\n    </div>\\n  </div>\\n</div>\\n    \\n  
\\n
\\n    \\n  // CSS\\n\\n  .exampleRow {\\n    display: flex;\\n    flex-direction: row;\\n  }\\n\\n  .exampleCell {\\n    flex-grow: 1;\\n  }\\n\\n  .exampleRow,\\n  .exampleCell {\\n    margin: 10px;\\n    padding: 10px;\\n    background-color: rgba(0, 0, 0, 0.2);\\n    cursor: move;\\n    cursor: grab;\\n    cursor: -moz-grab;\\n    cursor: -webkit-grab;\\n  }\\n    \\n  
\\n
\\n    \\n  // JS\\n.controller(\\'NestedNgRepeatWithModel\\', [\\'$timeout\\', \\'$scope\\', \\'$element\\', \\'dragularService\\', function NestedNgRepeatWithModelCtrl($timeout, $scope, $element, dragularService) {\\n    $timeout(function() { // timeount due to nested ngRepeat to be ready\\n      var container = $element.children().eq(0).children(),\\n        parentContainers = container.children(),\\n        nestedContainers = [];\\n\\n      dragularService(container, {\\n        moves: function(el, container, handle) {\\n          return handle.classList.contains(\\'row-handle\\');\\n        },\\n        containersModel: $scope.items,\\n        nameSpace: \\'rows\\'\\n      });\\n\\n      // collect nested contianers\\n      for (var i = 0; i < parentContainers.length; i++) {\\n        nestedContainers.push(parentContainers.eq(i).children()[1]);\\n      }\\n\\n      dragularService(nestedContainers, {\\n        moves: function(el, container, handle) {\\n          return !handle.classList.contains(\\'row-handle\\');\\n        },\\n        containersModel: (function getNestedContainersModel(){\\n          var parent = $scope.items,\\n            containersModel = [];\\n          for (var i = 0; i < parent.length; i++) {\\n            containersModel.push(parent[i].items);\\n          }\\n          return containersModel;\\n        })(),\\n        nameSpace: \\'cells\\'\\n      });\\n    }, 0);\\n    $scope.items = [{\\n      items: [{\\n        content: \\'Item a1\\'\\n      }, {\\n        content: \\'Item a2\\'\\n      }, {\\n        content: \\'Item a3\\'\\n      }, {\\n        content: \\'Item a4\\'\\n      }]\\n    }, {\\n      items: [{\\n        content: \\'Item b1\\'\\n      }, {\\n        content: \\'Item b2\\'\\n      }, {\\n        content: \\'Item b3\\'\\n      }, {\\n        content: \\'Item b4\\'\\n      }]\\n    }, {\\n      items: [{\\n        content: \\'Item c1\\'\\n      }, {\\n        content: \\'Item c2\\'\\n      }, {\\n        content: \\'Item c3\\'\\n      }, {\\n        content: \\'Item c4\\'\\n      }]\\n    }];\\n  }])\\n    \\n  
\\n
\\n\");\n\t$templateCache.put(\"exampleNestedRepeatsWithCustomDirective/exampleNestedRepeatsWithCustomDirective.html\",\"
\\n
\\n
\\n {{item.order}}: ({{item.name}} + {{item.age}})\\n
\\n \\n \\n
\\n
\\n
\\n
\\n\");\n\t$templateCache.put(\"exampleNgRepeat/exampleNgRepeat.html\",\"
\\n

ngRepeat

\\n \\n
\\n
\\n
\\n {{item.content}}\\n
\\n
\\n
\\n
\\n        \\n  // HTML:\\n  <div class=\\'containerVertical\\'>\\n    <div ng-repeat="item in items">\\n      {{item.content}}\\n    </div>\\n  </div>\\n\\n  // JS:\\n  dragularService($element.children());\\n  $scope.items = [{\\n    content: \\'Try to add or remove some elements (click on +- buttons), you will see that it is not problem for dragular.\\'\\n  },{\\n    content: \\'Item 2\\'\\n  },{\\n    content: \\'Item 3\\'\\n  },{\\n    content: \\'Item 4\\'\\n  }];\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleNgRepeatFilteredWithModel/exampleNgRepeatFilteredWithModel.html\",\"
\\n

Filtered ngRepeat - with model

\\n

Move stuff between these two filtered containers. You can play with filter inputs to see that everything goes right.\\n
\\n Please notify the getFilteredModel function, it is necessery for not replacing the initial array object with new filtered one!

\\n
\\n
\\n
\\n \\n
\\n
\\n \\n
\\n
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
\\n
\\n
Items1:\\n          
{{items1 | json}}
\\n
\\n
\\n
Items2:\\n          
{{items2 | json}}
\\n
\\n
\\n
\\n
\\n        \\n// JS\\n  .controller(\\'NgRepeatFilteredWithModel\\', [\\'$scope\\', \\'$element\\', \\'dragularService\\', \\'$filter\\', function TodoCtrl($scope, $element, dragularService, $filter) {\\n    $scope.items1 = [{\\n      content: \\'Move me, but you can only drop me in one of these containers.\\'\\n    }, {\\n      content: \\'If you try to drop me somewhere other than these containers, I\\\\\\'ll just come back.\\'\\n    }, {\\n      content: \\'Apple 3\\'\\n    }, {\\n      content: \\'Orange 4\\'\\n    }, {\\n      content: \\'Orange 5\\'\\n    }, {\\n      content: \\'Apple 6\\'\\n    }, {\\n      content: \\'Apple 7\\'\\n    }, {\\n      content: \\'Apple 8\\'\\n    }];\\n    $scope.items2 = [{\\n      content: \\'Apple 9\\'\\n    }, {\\n      content: \\'Orange 10\\'\\n    }, {\\n      content: \\'Orange 11\\'\\n    }, {\\n      content: \\'Apple 12\\'\\n    }, {\\n      content: \\'Orange 13\\'\\n    }, {\\n      content: \\'Apple 14\\'\\n    }];\\n    $scope.filter1query = \\'Orange\\';\\n    $scope.filter2query = \\'Orange\\';\\n    $scope.filteredModel1 = [];\\n    $scope.filteredModel2 = [];\\n    $scope.getFilteredModel = function (filteredModel, items, filterQuery) {\\n      filteredModel.length = 0;\\n      /*\\n      * Following one-liner is same like:\\n      *   var filteredModelTemp = $filter(\\'filter\\')(items, filterQuery);\\n      *   angular.forEach(filteredModelTemp, function(item){\\n      *     filteredModel.push(item);\\n      *   });\\n      * Or like:\\n      *   var filteredModelTemp = $filter(\\'filter\\')(items, filterQuery);\\n      *   for(var i; i < filteredModelTemp.length; i++){\\n      *     filteredModel.push(filteredModelTemp[i]);\\n      *   }\\n      *\\n      * You cannot just assign filtered array to filteredModel like this:\\n      *   filteredModel = $filter(\\'filter\\')(items, filterQuery);\\n      * Because you would replace the array object you provide to dragular with new one.\\n      * So dragular will continue to use the one it was provided on init.\\n      * Hopefully I make it clear. :)\\n       */\\n      [].push.apply(filteredModel, $filter(\\'filter\\')(items, filterQuery));\\n      return filteredModel;\\n    };\\n    var containers = $element.children().eq(1).children();\\n    dragularService.cleanEnviroment();\\n    dragularService([containers[0],containers[1]],{\\n      containersModel: [$scope.items1, $scope.items2],\\n      containersFilteredModel: [$scope.filteredModel1, $scope.filteredModel2]\\n    });\\n  }]);\\n\\n        \\n        \\n<!-- HTML -->\\n  <div class=\\'wrapper\\' ng-controller="NgRepeatFilteredWithModel">\\n    <div class="tableRow">\\n      <div class=\\'containerVertical\\'>\\n        <input ng-model="filter1query" style="margin:10px 10px">\\n      </div>\\n      <div class=\\'containerVertical\\'>\\n        <input ng-model="filter2query" style="margin:10px 10px">\\n      </div>\\n    </div>\\n    <div class=\\'tableRow\\'>\\n      <div class=\\'containerVertical\\'>\\n        <div ng-repeat="item in getFilteredModel(filteredModel1, items1, filter1query)">{{item.content}}</div>\\n      </div>\\n      <div class=\\'containerVertical\\'>\\n        <div ng-repeat="item in getFilteredModel(filteredModel2, items2, filter2query)">{{item.content}}</div>\\n      </div>\\n    </div>\\n    <div class="tableRow">\\n      <div class=\\'containerVertical\\'>\\n        <pre>Items1:\\n          <br/>{{items1 | json}}</pre>\\n      </div>\\n      <div class=\\'containerVertical\\'>\\n        <pre>Items2:\\n          <br/>{{items2 | json}}</pre>\\n      </div>\\n    </div>\\n  </div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleNgRepeatWithModel/exampleNgRepeatWithModel.html\",\"
\\n

ngRepeat - with model

\\n \\n
\\n
\\n
\\n
\\n {{item.content}}\\n \\n \\n
\\n
\\n
\\n
\\n
\\n
Items:\\n
{{items | json}}
\\n
\\n
\\n
\\n
\\n    \\n  // HTML:\\n   <div class=\\'wrapper\\' ng-controller="NgRepeatWithModel">\\n      <div class=\\'containerVertical\\'>\\n        <div ng-repeat="item in items">\\n          {{item.content}}\\n          <button class=\\'cursorDefault\\' ng-click="addItem()">+</button>\\n          <button class=\\'cursorDefault\\' ng-click="removeItem()">x</button>\\n        </div>\\n    </div>\\n  </div>\\n    \\n  
\\n
\\n    \\n  // JS:\\n  controller(\\'NgRepeatWithModel\\', [\\'$scope\\', \\'$element\\', \\'dragularService\\', function TodoCtrl($scope, $element, dragularService) {\\n    $scope.items = [{\\n      content: \\'Try to add or remove some elements (click on +- buttons), you will see that it is not problem for dragular.\\'\\n    }, {\\n      content: \\'Item 2\\'\\n    }, {\\n      content: \\'Item 3\\'\\n    }, {\\n      content: \\'Item 4\\'\\n    }];\\n    dragularService($element.children().eq(0).children(), {containersModel: $scope.items});\\n    $scope.addItem = function addItem() {\\n      var index = $scope.items.indexOf(this.item) + 1;\\n      $scope.items.splice(index, 0, {\\n        content: this.item.content + \\'-copy\\'\\n      });\\n    };\\n    $scope.removeItem = function removeItem() {\\n      var index = $scope.items.indexOf(this.item);\\n      $scope.items.splice(index, 1);\\n    };\\n  }])\\n    \\n  
\\n
\\n\");\n\t$templateCache.put(\"exampleRemoveOnSpill/exampleRemoveOnSpill.html\",\"
\\n

Remove on spill

\\n \\n
\\n
\\n
Move me, but you can only drop me in containers.
\\n
If you try to drop me somewhere other than containers, I\\'ll die a fiery death.
\\n
Item 3.
\\n
Item 6.
\\n
Item 4.
\\n
Item 5.
\\n
\\n
\\n
You can drop me in the left container.
\\n
Item 4.
\\n
Item 5.
\\n
\\n
\\n
\\n        \\n  dragularService([document.getElementById(single)], { removeOnSpill: true });\\n        \\n      
\\n
\");\n\t$templateCache.put(\"exampleRemoveOnSpillWithModel/exampleRemoveOnSpillWithModel.html\",\"
\\n

Remove on spill - with model

\\n \\n
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
\\n
\\n
Items1:\\n          
{{items1 | json}}
\\n
\\n
\\n
Items2:\\n          
{{items2 | json}}
\\n
\\n
\\n
\\n
\\n        \\n// JS\\n  .controller(\\'RemoveOnSpillWithModel\\', [\\'$scope\\', \\'$element\\', \\'dragularService\\', function TodoCtrl($scope, $element, dragularService) {\\n    $scope.items1 = [{\\n      content: \\'Move me, but you can only drop me in containers.\\'\\n    }, {\\n      content: \\'If you try to drop me somewhere other than containers, I\\\\\\'ll die a fiery death.\\'\\n    }, {\\n      content: \\'Item 3\\'\\n    }, {\\n      content: \\'Item 4\\'\\n    }];\\n    $scope.items2 = [{\\n      content: \\'You can drop me in the left container.\\'\\n    }, {\\n      content: \\'Item 6\\'\\n    }, {\\n      content: \\'Item 7\\'\\n    }, {\\n      content: \\'Item 8\\'\\n    }];\\n    var containers = $element.children().eq(0).children();\\n    dragularService.cleanEnviroment();\\n    dragularService([containers[0],containers[1]],{\\n      containersModel: [$scope.items1, $scope.items2],\\n      removeOnSpill: true\\n    });\\n  }])\\n        \\n        \\n<!-- HTML -->\\n<div class=\\'wrapper\\' ng-controller="Basic">\\n    <div class=\\'tableRow\\'>\\n        <div class=\\'containerVertical\\'>\\n            <div ng-repeat="item in items1">{{item.content}}</div>\\n        </div>\\n        <div class=\\'containerVertical\\'>\\n            <div ng-repeat="item in items2">{{item.content}}</div>\\n        </div>\\n    </div>\\n    <div class="tableRow">\\n        <div class="container">\\n            <div>Items1:\\n                <br/>{{items1 | json}}</div>\\n        </div>\\n        <div class="container">\\n            <div>Items2:\\n                <br/>{{items2 | json}}</div>\\n        </div>\\n    </div>\\n</div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleRevertOnSpill/exampleRevertOnSpill.html\",\"
\\n

Revert on spill

\\n \\n
\\n
\\n
Move me, but you can only drop me in one of these containers.
\\n
If you try to drop me somewhere other than these containers, I\\'ll just come back.
\\n
Item 3.
\\n
Item 6.
\\n
\\n
\\n
You can drop me in the left container, otherwise I\\'ll stay here.
\\n
Item 4.
\\n
Item 5.
\\n
\\n
\\n
\\n        \\n  dragularService([document.getElementById(left), document.getElementById(right)], { revertOnSpill: true });\\n        \\n      
\\n
\");\n\t$templateCache.put(\"exampleScrollingDrag/exampleScrollingDrag.html\",\"
\\n

Scrolling drag

\\n \\n
\\n
\\n
up
\\n
\\n
Item 1.
\\n
Item 2.
\\n
Item 3.
\\n
Item 4.
\\n
Item 5.
\\n
Item 6.
\\n
Item 7.
\\n
Item 9.
\\n
Item 10.
\\n
Item 11.
\\n
Item 12.
\\n
Item 13.
\\n
\\n
down
\\n
\\n
\\n
\\n
\\n
Item 1.
\\n
Item 2.
\\n
Item 3.
\\n
Item 4.
\\n
Item 5.
\\n
Item 6.
\\n
Item 7.
\\n
Item 9.
\\n
Item 10.
\\n
Item 11.
\\n
Item 12.
\\n
Item 13.
\\n
\\n
\\n
\\n
\\n
\\n        \\n// JS\\ncontroller(\\'ScrollingDrag\\', [\\'$interval\\', \\'$element\\', \\'dragularService\\', function TodoCtrl($interval, $element, dragularService) {\\n\\n\\n    var timer,\\n      leftScrollContainer = document.getElementById(\\'leftScroll\\'),\\n      rightScrollContainer = document.getElementById(\\'rightScroll\\'),\\n      leftTopBar = document.getElementById(\\'leftTopBar\\'),\\n      leftBottomBar = document.getElementById(\\'leftBottomBar\\'),\\n      rightTopBar = document.getElementById(\\'rightTopBar\\'),\\n      rightBottomBar = document.getElementById(\\'rightBottomBar\\');\\n\\n    dragularService.cleanEnviroment();\\n    dragularService([leftScrollContainer, rightScrollContainer]);\\n\\n    registerEvents(leftTopBar, leftScrollContainer, -5);\\n    registerEvents(leftBottomBar, leftScrollContainer, 5);\\n    registerEvents(rightTopBar, rightScrollContainer, -5);\\n    registerEvents(rightBottomBar, rightScrollContainer, 5);\\n\\n    function registerEvents(bar, container, inc, speed) {\\n      if (!speed) {\\n        speed = 20;\\n      }\\n      angular.element(bar).on(\\'dragularenter\\', function() {\\n        container.scrollTop += inc;\\n        timer = $interval(function moveScroll() {\\n          container.scrollTop += inc;\\n        }, speed);\\n      });\\n      angular.element(bar).on(\\'dragularleave dragularrelease\\', function() {\\n        $interval.cancel(timer);\\n      });\\n    }\\n  }])\\n        \\n      
\\n
\\n        \\n<!-- HTML -->\\n<div ng-controller="ScrollingDrag">\\n    <div class="containerVertical scrollingDrag">\\n      <div class="scrollBar" id="leftTopBar">up</div>\\n      <div id="leftScroll" class="scrollingDragInner">\\n        <div>Item 1</div>\\n        <div>Item 2</div>\\n            ...\\n      </div>\\n      <div class="scrollBar" id="leftBottomBar">down</div>\\n    </div>\\n    <div class="containerVertical scrollingDrag">\\n      <div class="scrollBar" id="rightTopBar">up</div>\\n      <div id="rightScroll" class="scrollingDragInner">\\n        <div>Item 1</div>\\n        <div>Item 2</div>\\n            ...\\n      </div>\\n      <div class="scrollBar" id="rightBottomBar">down</div>\\n    </div>\\n  </div>\\n        \\n      
\\n
\\n        \\n// CSS\\n.scrollingDrag {\\n  width: 45%;\\n  display: inline-block;\\n}\\n\\n.scrollingDragInner {\\n  max-height: 200px;\\n  overflow-y: auto;\\n}\\n\\n#rightTopBar,\\n#rightBottomBar {\\n  background: transparent;\\n  position: relative;\\n  height: 20px;\\n}\\n\\n#rightTopBar {\\n  top: 10px;\\n}\\n\\n#rightBottomBar {\\n  bottom: 10px;\\n}\\n\\ndiv.scrollBar {\\n  background: yellow;\\n  text-align: center;\\n  padding: 1px;\\n}\\n\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"partials/partial-contribute.html\",\"
\\n
\\n
\\n \\n
\\n
\\n
\\n\");\n\t$templateCache.put(\"partials/partial-docs.html\",\"
\\n
\\n
\\n \\n
\\n \\n
\\n

\\n \\n

\\n \\n
\\n
\\n \\n
\\n \\n
\\n\");\n\t$templateCache.put(\"partials/partial-home.html\",\"
\\n
\\n \\n
\\n
\\n

DRAGULAR

\\n

Angular drag&drop based on dragula.

\\n

Live examples in docs

\\n
\\n
\\n
\\n

Browser support includes every sane browser and **IE7+**. _(Granted you polyfill the functional `Array` methods in ES5)_

\\n

Inspiration

\\n

I am working on huge angular project and I am using several drag&drop libraries in it, one for UI, one for lists, etc.. I want to use one full-featured drag&drop library for whole project. As I could not find any suitable, I decided to create one. I have choosen great library dragula by Nicolas Bevacqua as my starting point, make it more angular and started to put features in it! If you wish light-weight angular version of dragula, there is official angular version of dragula.

\\n

Actual version 4.4.6 is based on dragula 3.6.3 and tested with angular 1.5.5.

\\n

Differences of dragular (against dragula)

\\n
    \\n
  • replaced dragula crossvent with angulars event binding
  • \\n
  • replaced dragula contra.emitter with $scope.$emit if scope provided in options (options.scope)
  • \\n
  • provided as service or directive dragular where options can be passed via atribute dragular
  • \\n
  • automatic direction if not provided in options, instead of default vertical
  • \\n
  • accepting arraylike objects as containers array (jQuery, jQlite collections etc..)
  • \\n
  • accepting custom classes via option.classes
  • \\n
  • namespaced containers groups available via option.nameSpace (containers in same nameSpace cooperate)
  • \\n
  • boundingBox (dragging element can me moved only in specific area)
  • \\n
  • lockX/Y (dragging element can me moved only in specific direction)
  • \\n
  • DOM can be synced with scope model
  • \\n
  • support css selectors to define containers
  • \\n
  • added syntax highlighter to example codes
  • \\n
  • etc..
  • \\n
\\n

Todo

\\n
    \\n
  • improve docs
  • \\n
\\n

Features

\\n
    \\n
  • provided as service and also as directive
  • \\n
  • Super easy to set up
  • \\n
  • No bloated dependencies
  • \\n
  • Figures out sort order on its own
  • \\n
  • A shadow where the item would be dropped offers visual feedback
  • \\n
  • Touch events!
  • \\n
\\n

For installation, usage and examples go to docs

\\n
\\n
\\n \\n
\\n \\n
\\n \\n
\\n\");\n\t$templateCache.put(\"partials/autogenerated/contribute.html\",\"

How to contribute

\\n

It's important to us that you feel you can contribute towards the evolution of Dragular. This can take many forms: from helping to fix bugs or improve the docs, to adding in new features to the source. This guide should help you in making that process as smooth as possible.

\\n

Before contributing, please read the code of conduct.

\\n

Reporting issues

\\n

GitHub Issues is the place to report bugs you may have found in either the core library or any of the examples that are part of the repository. When submitting a bug please do the following:

\\n

1. Search for existing issues. Your bug may have already been fixed or addressed in a development branch version of Dragular, so be sure to search the issues first before putting in a duplicate issue.

\\n

2. Not sure if it's a bug?. Then please ask via issues and tag it [question].

\\n

3. Create an isolated and reproducible test case. If you are reporting a bug, make sure you also have a minimal, runnable, code example that reproduces the problem you have.

\\n

4. Include a live example. After narrowing your code down to only the problem areas, make use of Codepen, jsBin, or a link to your live site so that we can view a live example of the problem. (you can start by forking this codepen)

\\n

5. Share as much information as possible. Include browser version affected, your OS, version of the library, steps to reproduce, etc. "X isn't working!!!1!" will probably just be closed.

\\n

Dev vs. Master

\\n

The dev branch of Dragular is our 'current working' version. It is always ahead of the master branch in terms of features and fixes. However it's also bleeding-edge and experimental and we cannot and do not guarantee it will compile or work for you. Very often we have to break things for a few days while we rebuild and patch. So by all means please export the dev branch and contribute towards it, indeed that is where all Pull Requests should be sent, but do so understanding the API may change beneath you.

\\n

Making Changes

\\n

To take advantage of our npm build script and jshint config it will be easiest for you if you have node.js installed locally.

\\n

You can download node.js from nodejs.org.

\\n

After that you can clone the repository and run npm i inside the cloned folder. This will install dependencies necessary for building the project. For development workflow automation dragular uses gulp >= 3.9.0. Before starting development, make sure that gulp is installed on your machine globally: npm i -g gulp.

\\n

Developing

\\n

There are several gulp tasks that are used for generating different builds:

\\n
    \\n
  • gulp dev - Serves files with BrowserSync server, watches & automatically refreshes connected browsers on changes, generates non-minified but concatenated styles & scripts from the dragular source.
  • \\n
  • gulp dev:docs - Does exactly the same as gulp dev, except it works with the documentation source.
  • \\n
  • gulp build - Concatenates and minifies dragular source files.
  • \\n
  • gulp build:docs - Concatenates and minifies documentation source files.
  • \\n
\\n

Linting

\\n
    \\n
  • gulp lint & gulp lint:docs - Lint JavaScript files.
  • \\n
\\n

Making a pull request

\\n

Once that is ready, make your changes and submit a Pull Request:

\\n
    \\n
  • Send Pull Requests to the dev branch. All Pull Requests must be sent to the dev branch, master is the latest release and PRs to that branch will be closed.

    \\n
  • \\n
  • Ensure changes are jshint validated. Our JSHint configuration file is provided in the repository and you should check against it before submitting.

    \\n
  • \\n
  • Only commit relevant changes. Don't include changes that are not directly relevant to the fix you are making. The more focused a PR is, the faster it will get attention and be merged. Extra files changing only whitespace or trash files will likely get your PR closed.

    \\n
  • \\n
\\n

Dependencies for building from source and running tests:

\\n

Coding style preferences are not contributions

\\n

If your PR is doing little more than changing the Dragular source code into a format / coding style that you prefer then we will automatically close it. All PRs must adhere to the coding style already set-out across the lines of code in Dragular. Your personal preferences for how things should "look" or be structured do not apply here, sorry. PRs should fix bugs, fix documentation or add features. No changes for the sake of change.

\\n

I don't really like git / node.js, but I can fix this bug

\\n

That is fine too. While Pull Requests are the best thing in the world for us, they are not the only way to help. You're welcome to post fixes to our forum or even just email them to us. All we ask is that you still adhere to the guidelines presented here re: JSHint, etc.

\\n\");}]);\n\n/***/ })\n/******/ ])\n});\n;"]} \ No newline at end of file +{"version":3,"sources":["examples.js"],"names":["root","factory","exports","module","define","amd","a","i","this","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","dragular","angular","examplesRouter","BasicCtrl","BasicModelCtrl","BoundingBoxCtrl","BoundingBoxLockXCtrl","BoundingBoxLockYCtrl","CopyCtrl","CopyModelCtrl","CustomClassesCtrl","DifferentOptionsModelCtrl","DirectiveCtrl","DirectiveModelCtrl","DragOverEventsCtrl","EventsCtrl","HandleCtrl","IsContainerModelCtrl","NameSpacesCtrl","NestedNgRepeatCtrl","NestedNgRepeatWithModelCtrl","NgRepeatCtrl","NgRepeatFilteredWithModelCtrl","NgRepeatWithModelCtrl","RemoveOnSpillCtrl","RemoveOnSpillWithModelCtrl","RevertOnSpillCtrl","ScrollingDragCtrl","NestedRepeatsWithCustomDirective","config","controller","$scope","examplesList","template","link","title","highlightCode","document","getElementsByTagName","length","codeBlocks","hljs","highlightBlock","rowOffcanvas","toggleSidebar","element","getElementById","toggleClass","dragularDirective","dragularService","directive","restrict","iElm","iAttrs","tryJson","json","JSON","parse","e","options","$eval","dragularModel","containersModel","scope","dragularNameSpace","nameSpace","split","dragularOnInit","onInit","$inject","shared","classesCache","containersCtx","containers","mirror","source","item","copy","sourceItem","sourceModel","sourceFilteredModel","target","targetCtx","targetModel","lastDropTarget","offsetX","offsetY","moveX","moveY","offsetXr","offsetYb","clientX","clientY","mirrorWidth","mirrorHeight","initialSibling","currentSibling","initialIndex","currentIndex","tempModel","dragOverEvents","lastElementBehindCursor","grabbed","$rootScope","$compile","service","arg0","arg1","processServiceArguments","arguments","_isArray","isElement","initialContainers","querySelectorAll","o","copyOptions","extendOptions","tmp","extend","defaultOptions","classes","defaultClasses","eventNames","defaultEventNames","processOptionsObject","boundingBox","sanitizeContainers","containersFilteredModel","forEach","cont","len","getContainers","Error","indexOf","push","getContainersModel","fm","registerEvents","remove","op","regEvent","_docElm","release","container","grab","name","eventName","_doc","createEvent","initEvent","createEventObject","eventType","whichMouseButton","metaKey","ctrlKey","context","canStart","eventualMovements","type","isInput","focus","preventDefault","startBecauseMouseMoved","drake","dragging","originalEvent","g","ignoreInputTextSelection","getCoord","elementBehindCursor","elementFromPoint","movements","end","start","direction","getParent","parent","parentNode","parentHeight","offsetHeight","parentWidth","offsetWidth","childHeight","clientHeight","childWidth","clientWidth","offset","getOffset","left","top","right","bottom","renderMirrorImage","addClass","transit","style","drag","preventGrabbed","handle","isContainer","invalid","moves","nextEl","clone","$emit","dragularcloned","containerIndex","domIndexOf","dragulardrag","manualStart","rect","getBoundingClientRect","cloneNode","width","height","getRectWidth","getRectHeight","mirrorContainer","appendChild","body","unselectable","scrollContainer","drop","ungrab","moved","notify","removeOnSpill","spillOver","spillOut","pageX","pageY","offsetBox","x","y","lockY","lockX","getElementBehindPoint","dropTarget","findDropTarget","changed","fireEvent","dragularenter","dragularleave","copySortSource","removeChild","reference","immediate","getImmediateChild","getReference","revertOnSpill","insertBefore","dragularshadow","accepted","initial","isInitialPlacement","getTargetCtx","_isFunction","accepts","isContainerAccepts","canBeAccepted","rmClass","hide","s","sibling","undefined","outside","el","children","horizontal","inside","resolve","after","point","state","className","isContainerModel","opt","_getContainers","containersType","to2d","cancel","revert","reverts","dragularcancel","cleanup","dragularrelease","afterDrop","dragulardrop","dropIndex","compileItemOnDrop","$applyAsync","content","splice","dropElmModel","dontCopyModel","dragularremove","removeMirrorImage","dragularout","dragulardragend","destroy","removeContainers","makeArray","index","addContainers","before","scrollTop","deltaY","stopPropagation","depSanitize","getBool","dragularover","never","getEmptyArray","always","sanitizeContainersModel","evaluated","fn","touch","mouseup","mousedown","mousemove","pointers","microsoft","$el","addEventListener","opConvert","on","off","passive","navigator","pointerEnabled","msPointerEnabled","all","startIndex","Array","prototype","slice","touches","which","buttons","button","getScroll","scrollProp","offsetProp","window","scrollLeft","manually","nextSibling","nodeType","nextElementSibling","obj","HTMLElement","nodeName","lookupClass","cached","lastIndex","RegExp","current","test","replace","trim","getEventHost","targetTouches","changedTouches","coord","host","missMap","tagName","isEditable","contentEditable","child","extra","dispatchEvent","prop","args","apply","documentElement","isArray","isFunction","cleanEnviroment","$stateProvider","$urlRouterProvider","otherwise","timer","ctrl","$state","$stateParams","$timeout","go","url","templateUrl","$element","items1","items2","eq","containerLeft","querySelector","containerRight","dragularOptions","parentElement","removeClass","notContainer","getElementsByClassName","myFn","$on","Events2Ctrl","classList","contains","cartModel","removeItem","items","parentContainers","nestedContainers","addItem","$filter","filter1query","filter2query","filteredModel1","filteredModel2","getFilteredModel","filteredModel","filterQuery","$interval","bar","inc","speed","leftScrollContainer","rightScrollContainer","leftTopBar","leftBottomBar","rightTopBar","rightBottomBar","questions","text","points","order","age","QuestionsDirective","question","QuestionsController","run","$templateCache","put"],"mappings":"CAAA,SAA2CA,EAAMC,GAChD,GAAsB,gBAAZC,UAA0C,gBAAXC,QACxCA,OAAOD,QAAUD,QACb,IAAqB,kBAAXG,SAAyBA,OAAOC,IAC9CD,UAAWH,OACP,CACJ,GAAIK,GAAIL,GACR,KAAI,GAAIM,KAAKD,IAAuB,gBAAZJ,SAAuBA,QAAUF,GAAMO,GAAKD,EAAEC,KAErEC,KAAM,WACT,MAAgB,UAAUC,GAKhB,QAASC,GAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,MAAOC,GAAiBD,GAAUT,OAGnC,IAAIC,GAASS,EAAiBD,IAC7BT,WACAW,GAAIF,EACJG,QAAQ,EAUT,OANAL,GAAQE,GAAUI,KAAKZ,EAAOD,QAASC,EAAQA,EAAOD,QAASQ,GAG/DP,EAAOW,QAAS,EAGTX,EAAOD,QAvBf,GAAIU,KAqCJ,OATAF,GAAoBM,EAAIP,EAGxBC,EAAoBO,EAAIL,EAGxBF,EAAoBQ,EAAI,GAGjBR,EAAoB,KAK/B,SAAUP,EAAQD,EAASQ,GAGhC,YAIA,IAAIS,GAAWT,EAAoB,EAEnCU,SACEjB,OAAO,eAAgBgB,EAAU,YAAa,aAEhD,IAAIE,GAAiBX,EAAoB,GACrCY,EAAYZ,EAAoB,GAChCa,EAAiBb,EAAoB,GACrCc,EAAkBd,EAAoB,GACtC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C,IAAI,yDAAyD,slEAC5ED,EAAeC,IAAI,yEAAyE,q/JAC5FD,EAAeC,IAAI,iDAAiD,8kCACpED,EAAeC,IAAI,mEAAmE,ujFACtFD,EAAeC,IAAI,iDAAiD,osCACpED,EAAeC,IAAI,iDAAiD,+3IACpED,EAAeC,IAAI,mCAAmC;AACtDD,EAAeC,IAAI,6BAA6B,syBAChDD,EAAeC,IAAI,6BAA6B,yuGAChDD,EAAeC,IAAI,yCAAyC","file":"examples.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse {\n\t\tvar a = factory();\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n\n\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* global angular, hljs */\n\t'use strict';\n\n\t// var angular = require('angular');\n\n\tvar dragular = __webpack_require__(1);\n\n\tangular\n\t\t.module('examplesApp', [dragular, 'templates', 'ui.router']);\n\n\tvar examplesRouter = __webpack_require__(4);\n\tvar BasicCtrl = __webpack_require__(5);\n\tvar BasicModelCtrl = __webpack_require__(6);\n\tvar BoundingBoxCtrl = __webpack_require__(7);\n\tvar BoundingBoxLockXCtrl = __webpack_require__(8);\n\tvar BoundingBoxLockYCtrl = __webpack_require__(9);\n\tvar CopyCtrl = __webpack_require__(10);\n\tvar CopyModelCtrl = __webpack_require__(11);\n\tvar CustomClassesCtrl = __webpack_require__(12);\n\tvar DifferentOptionsModelCtrl = __webpack_require__(13);\n\tvar DirectiveCtrl = __webpack_require__(14);\n\tvar DirectiveModelCtrl = __webpack_require__(15);\n\tvar DragOverEventsCtrl = __webpack_require__(16);\n\tvar EventsCtrl = __webpack_require__(17);\n\tvar HandleCtrl = __webpack_require__(18);\n\tvar IsContainerModelCtrl = __webpack_require__(19);\n\tvar NameSpacesCtrl = __webpack_require__(20);\n\tvar NestedNgRepeatCtrl = __webpack_require__(21);\n\tvar NestedNgRepeatWithModelCtrl = __webpack_require__(22);\n\tvar NgRepeatCtrl = __webpack_require__(23);\n\tvar NgRepeatFilteredWithModelCtrl = __webpack_require__(24);\n\tvar NgRepeatWithModelCtrl = __webpack_require__(25);\n\tvar RemoveOnSpillCtrl = __webpack_require__(26);\n\tvar RemoveOnSpillWithModelCtrl = __webpack_require__(27);\n\tvar RevertOnSpillCtrl = __webpack_require__(28);\n\tvar ScrollingDragCtrl = __webpack_require__(29);\n\tvar NestedRepeatsWithCustomDirective = __webpack_require__(30);\n\t__webpack_require__(31);\n\n\t/**\n\t * Module Example App\n\t *\n\t * DEMO app for dragular https://github.com/luckylooke/dragular\n\t */\n\n\tangular\n\t .module('examplesApp')\n\t .config(examplesRouter)\n\t .controller('Basic', BasicCtrl)\n\t .controller('BasicModel', BasicModelCtrl)\n\t .controller('BoundingBox', BoundingBoxCtrl)\n\t .controller('BoundingBoxLockX', BoundingBoxLockXCtrl)\n\t .controller('BoundingBoxLockY', BoundingBoxLockYCtrl)\n\t .controller('Copy', CopyCtrl)\n\t .controller('CopyModel', CopyModelCtrl)\n\t .controller('CustomClasses', CustomClassesCtrl)\n\t .controller('DifferentOptionsModel', DifferentOptionsModelCtrl)\n\t .controller('Directive', DirectiveCtrl)\n\t .controller('DirectiveModel', DirectiveModelCtrl)\n\t .controller('DragOverEvents', DragOverEventsCtrl)\n\t .controller('Events', EventsCtrl[0])\n\t .controller('Events2', EventsCtrl[1])\n\t .controller('Handle', HandleCtrl)\n\t .controller('IsContainerModel', IsContainerModelCtrl)\n\t .controller('NameSpaces', NameSpacesCtrl)\n\t .controller('NestedNgRepeat', NestedNgRepeatCtrl)\n\t .controller('NestedNgRepeatWithModel', NestedNgRepeatWithModelCtrl)\n\t .controller('NgRepeat', NgRepeatCtrl)\n\t .controller('NgRepeatFilteredWithModel', NgRepeatFilteredWithModelCtrl)\n\t .controller('NgRepeatWithModel', NgRepeatWithModelCtrl)\n\t .controller('RemoveOnSpill', RemoveOnSpillCtrl)\n\t .controller('RemoveOnSpillWithModel', RemoveOnSpillWithModelCtrl)\n\t .controller('RevertOnSpill', RevertOnSpillCtrl)\n\t .controller('ScrollingDrag', ScrollingDragCtrl)\n\t .controller('NestedRepeatsWithCustomDirective', NestedRepeatsWithCustomDirective)\n\t .controller('ExAppCtrl', ['$scope', function($scope) {\n\t $scope.examplesList = [{\n\t template: 'docsInstall/docsInstall.html',\n\t link: 'docsInstall',\n\t title: 'Installation'\n\t },{\n\t template: 'exampleBasic/exampleBasic.html',\n\t link: 'exampleBasic',\n\t title: 'Basic'\n\t },{\n\t template: 'exampleBasicWithModel/exampleBasicWithModel.html',\n\t link: 'exampleBasicWithModel',\n\t title: 'Basic - with model'\n\t },{\n\t template: 'exampleDifferentOptionsWithModel/exampleDifferentOptionsWithModel.html',\n\t link: 'exampleDifferentOptionsWithModel',\n\t title: 'Different options - with model'\n\t }, {\n\t template: 'exampleDirective/exampleDirective.html',\n\t link: 'exampleDirective',\n\t title: 'Directive'\n\t }, {\n\t template: 'exampleDirectiveWithModel/exampleDirectiveWithModel.html',\n\t link: 'exampleDirectiveWithModel',\n\t title: 'Directive - with model'\n\t }, {\n\t template: 'exampleEvents/exampleEvents.html',\n\t link: 'exampleEvents',\n\t title: 'Events'\n\t }, {\n\t template: 'exampleRemoveOnSpill/exampleRemoveOnSpill.html',\n\t link: 'exampleRemoveOnSpill',\n\t title: 'Remove on spill'\n\t }, {\n\t template: 'exampleRemoveOnSpillWithModel/exampleRemoveOnSpillWithModel.html',\n\t link: 'exampleRemoveOnSpillWithModel',\n\t title: 'Remove on spill - with model'\n\t }, {\n\t template: 'exampleRevertOnSpill/exampleRevertOnSpill.html',\n\t link: 'exampleRevertOnSpill',\n\t title: 'Revert on spill'\n\t }, {\n\t template: 'exampleCopy/exampleCopy.html',\n\t link: 'exampleCopy',\n\t title: 'Copy'\n\t }, {\n\t template: 'exampleCopyWithModel/exampleCopyWithModel.html',\n\t link: 'exampleCopyWithModel',\n\t title: 'Copy - with model'\n\t }, {\n\t template: 'exampleHandle/exampleHandle.html',\n\t link: 'exampleHandle',\n\t title: 'Handle'\n\t }, {\n\t template: 'exampleIsContainerWithModel/exampleIsContainerWithModel.html',\n\t link: 'exampleIsContainerWithModel',\n\t title: 'isContainer - with model'\n\t }, {\n\t template: 'exampleCustomClasses/exampleCustomClasses.html',\n\t link: 'exampleCustomClasses',\n\t title: 'Custom classes'\n\t }, {\n\t template: 'exampleNameSpaces/exampleNameSpaces.html',\n\t link: 'exampleNameSpaces',\n\t title: 'NameSpaces'\n\t }, {\n\t template: 'exampleDragOverEvents/exampleDragOverEvents.html',\n\t link: 'exampleDragOverEvents',\n\t title: 'Drag-over events'\n\t }, {\n\t template: 'exampleBoundingBox/exampleBoundingBox.html',\n\t link: 'exampleBoundingBox',\n\t title: 'BoundingBox'\n\t }, {\n\t template: 'exampleBoundingBoxLockX/exampleBoundingBoxLockX.html',\n\t link: 'exampleBoundingBoxLockX',\n\t title: 'BoundingBox + LockX'\n\t }, {\n\t template: 'exampleBoundingBoxLockY/exampleBoundingBoxLockY.html',\n\t link: 'exampleBoundingBoxLockY',\n\t title: 'BoundingBox + LockY'\n\t }, {\n\t template: 'exampleNgRepeat/exampleNgRepeat.html',\n\t link: 'exampleNgRepeat',\n\t title: 'ngRepeat'\n\t }, {\n\t template: 'exampleNgRepeatWithModel/exampleNgRepeatWithModel.html',\n\t link: 'exampleNgRepeatWithModel',\n\t title: 'ngRepeat - with model'\n\t }, {\n\t template: 'exampleNgRepeatFilteredWithModel/exampleNgRepeatFilteredWithModel.html',\n\t link: 'exampleNgRepeatFilteredWithModel',\n\t title: 'Filtered ngRepeat - with model'\n\t }, {\n\t template: 'exampleNestedNgRepeat/exampleNestedNgRepeat.html',\n\t link: 'exampleNestedNgRepeat',\n\t title: 'Nested ngRepead'\n\t }, {\n\t template: 'exampleNestedNgRepeatWithModel/exampleNestedNgRepeatWithModel.html',\n\t link: 'exampleNestedNgRepeatWithModel',\n\t title: 'Nested ngRepead - with model'\n\t }, {\n\t template: 'exampleScrollingDrag/exampleScrollingDrag.html',\n\t link: 'exampleScrollingDrag',\n\t title: 'Scrolling drag'\n\t }, {\n\t template: 'exampleSNestedRepeatsWithCustomDirective/exampleNestedRepeatsWithCustomDirective.html',\n\t link: 'exampleNestedRepeatsWithCustomDirective',\n\t title: 'Nested repeats with custom directive'\n\t }];\n\n\t $scope.highlightCode = function () {\n\t if(document.getElementsByTagName('code').length){\n\t var codeBlocks = document.getElementsByTagName('code');\n\t for (var i = codeBlocks.length - 1; i >= 0; i--) {\n\t hljs.highlightBlock(codeBlocks[i]);\n\t }\n\t }\n\t };\n\n\t var rowOffcanvas;\n\t $scope.toggleSidebar = function toggleSidebar () {\n\t if(!rowOffcanvas){\n\t rowOffcanvas = angular.element(document.getElementById('rowOffcanvas'));\n\t }\n\t rowOffcanvas.toggleClass('active');\n\t };\n\n\t }]);\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* global angular */\n\t'use strict';\n\tvar dragularDirective = __webpack_require__( 2 );\n\tvar dragularService = __webpack_require__( 3 );\n\n\t/**\n\t * Dragular 4.5.0 by Luckylooke https://github.com/luckylooke/dragular\n\t * Angular version of dragula https://github.com/bevacqua/dragula\n\t */\n\tmodule.exports = 'dragularModule';\n\n\tangular\n\t\t.module( 'dragularModule', [] )\n\t\t.factory( 'dragularService', dragularService )\n\t\t.directive( 'dragular', dragularDirective );\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\t/**\n\t * dragular Directive by Luckylooke https://github.com/luckylooke/dragular\n\t * Angular version of dragula https://github.com/bevacqua/dragula\n\t */\n\n\tvar dragular = function ( dragularService ) {\n\t\treturn {\n\t\t\trestrict: 'A',\n\t\t\tlink: function ( $scope, iElm, iAttrs ) {\n\n\t\t\t\tvar options = $scope.$eval( iAttrs.dragular ) || tryJson( iAttrs.dragular ) || {};\n\n\t\t\t\tfunction tryJson( json ) {\n\t\t\t\t\ttry { // I dont like try catch solutions but I havent find sattisfying way of chcecking json validity.\n\t\t\t\t\t\treturn JSON.parse( json );\n\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( iAttrs.dragularModel ) {\n\t\t\t\t\toptions.containersModel = iAttrs.dragularModel;\n\t\t\t\t\tif ( !options.scope ){\n\t\t\t\t\t\toptions.scope = $scope;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( iAttrs.dragularNameSpace ) {\n\t\t\t\t\toptions.nameSpace = iAttrs.dragularNameSpace.split( ' ' );\n\t\t\t\t}\n\n\t\t\t\tif ( iAttrs.dragularOnInit ) {\n\t\t\t\t\toptions.onInit = $scope.$eval( iAttrs.dragularOnInit );\n\t\t\t\t}\n\n\t\t\t\tdragularService( iElm[ 0 ], options );\n\t\t\t}\n\t\t};\n\t};\n\n\tdragular.$inject = [ 'dragularService' ];\n\n\tmodule.exports = dragular;\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n\t/* global angular */\n\t'use strict';\n\n\t/**\n\t * dragular Service by Luckylooke https://github.com/luckylooke/dragular\n\t * Angular version of dragula https://github.com/bevacqua/dragula\n\t */\n\n\tvar shared = { // sahred object between all service instances\n\t\tclassesCache: {}, // classes lookup cache\n\t\tcontainersCtx: {}, // containers model\n\t\tcontainers: {}, // containers\n\t\tmirror: null, // mirror image\n\t\tsource: null, // source container\n\t\titem: null, // item being dragged\n\t\tcopy: null, // copy flag\n\t\tsourceItem: null, // item originaly dragged if copy is enabled\n\t\tsourceModel: null, // source container model\n\t\tsourceFilteredModel: null, // source container filtered model if relevant\n\t\ttarget: null, // droppable container under drag item\n\t\ttargetCtx: null, // target container context\n\t\ttargetModel: null, // target container model\n\t\tlastDropTarget: null, // last container item was over\n\t\toffsetX: null, // reference x\n\t\toffsetY: null, // reference y\n\t\tmoveX: null, // reference move x\n\t\tmoveY: null, // reference move y\n\t\toffsetXr: null, // reference x right for boundingBox feature\n\t\toffsetYb: null, // reference y bottom for boundingBox feature\n\t\tclientX: null, // cache client x, init at grab, update at drag\n\t\tclientY: null, // cache client y, init at grab, update at drag\n\t\tmirrorWidth: null, // mirror width for boundingBox feature\n\t\tmirrorHeight: null, // mirror height for boundingBox feature\n\t\tinitialSibling: null, // reference sibling when grabbed\n\t\tcurrentSibling: null, // reference sibling now\n\t\tinitialIndex: null, // reference model index when grabbed\n\t\tcurrentIndex: null, // reference model index now\n\t\ttempModel: null, // if o.isContainer is used, model can be provided as well, it is temporary saved here during drags\n\t\tdragOverEvents: {}, // drag over events fired on element behind cursor\n\t\tlastElementBehindCursor: null, // last element behind cursor\n\t\tgrabbed: null // holds mousedown context until first mousemove\n\t};\n\n\tvar dragularService = function ( $rootScope, $compile ) {\n\n\t\t// abbreviations\n\t\tvar _doc = document,\n\t\t\t_docElm = _doc.documentElement,\n\t\t\t_isArray = Array.isArray,\n\t\t\t_isFunction = angular.isFunction;\n\n\t\t// clean common/shared objects\n\t\tservice.cleanEnviroment = function cleanEnviroment() {\n\t\t\tshared.classesCache = {};\n\t\t\tshared.containersCtx = {};\n\t\t\tshared.containers = {};\n\t\t\tshared.mirror = undefined;\n\t\t};\n\n\t\tservice.shared = shared;\n\n\t\treturn service;\n\n\t\t// service definition\n\t\tfunction service( arg0, arg1 ) {\n\n\t\t\t// console.log('dragularService arg0, arg1', arg0, arg1);\n\n\t\t\tvar initialContainers = arg0 || [],\n\t\t\t\toptions = arg1 || {},\n\t\t\t\to, // shorthand for options\n\t\t\t\tg = getBool, // shorthand for getBool\n\n\t\t\t\t// defaults\n\t\t\t\tdefaultClasses = {\n\t\t\t\t\tmirror: 'gu-mirror',\n\t\t\t\t\thide: 'gu-hide',\n\t\t\t\t\tunselectable: 'gu-unselectable',\n\t\t\t\t\ttransit: 'gu-transit'\n\t\t\t\t},\n\t\t\t\tdefaultEventNames = {\n\t\t\t\t\t// drag-over DOM events\n\t\t\t\t\tdragularenter: 'dragularenter',\n\t\t\t\t\tdragularleave: 'dragularleave',\n\t\t\t\t\tdragularrelease: 'dragularrelease',\n\t\t\t\t\t// $scope events\n\t\t\t\t\tdragularcloned: 'dragularcloned',\n\t\t\t\t\tdragulardrag: 'dragulardrag',\n\t\t\t\t\tdragularcancel: 'dragularcancel',\n\t\t\t\t\tdragulardrop: 'dragulardrop',\n\t\t\t\t\tdragularremove: 'dragularremove',\n\t\t\t\t\tdragulardragend: 'dragulardragend',\n\t\t\t\t\tdragularshadow: 'dragularshadow',\n\t\t\t\t\tdragularover: 'dragularover',\n\t\t\t\t\tdragularout: 'dragularout'\n\t\t\t\t},\n\t\t\t\tdefaultOptions = { // options with defaults\n\t\t\t\t\tcopyOptions: false, // copy options object when provided\n\t\t\t\t\tclasses: defaultClasses, // classes used by dragular\n\t\t\t\t\teventNames: defaultEventNames, // event names used by dragular\n\t\t\t\t\tcontainers: false, // initial containers provided via options object (are provided via parameter by default)\n\t\t\t\t\tcontainersModel: false, // if provided, model will be synced with DOM\n\t\t\t\t\tcontainersFilteredModel: false, // if provided, dragular will handle filtered model cases\n\t\t\t\t\tisContainer: never, // potential target can be forced to be container by custom logic\n\t\t\t\t\tisContainerModel: getEmptyArray, // if isContainer function is provided, you can provide also respective model\n\t\t\t\t\tisContainerAccepts: always, // if isContainer function is provided, you can provide also respective accept function\n\t\t\t\t\tmoves: always, // can drag start?\n\t\t\t\t\taccepts: always, // can target accept dragged item? (target context used)\n\t\t\t\t\tcanBeAccepted: always, // can be dragged item accepted by target? (source context used)\n\t\t\t\t\tcopy: false, // dragged item will be copy of source? flag or function\n\t\t\t\t\tcopySortSource: false, // enable sorting in source when copying item\n\t\t\t\t\tdontCopyModel: false, // dont make copy of model when coping item (#61)\n\t\t\t\t\tinvalid: never, // target (in)validity function\n\t\t\t\t\trevertOnSpill: false, // item returns to original place\n\t\t\t\t\tremoveOnSpill: false, // item will be removed if not placed into valid target\n\t\t\t\t\tlockX: false, // lock movement into x-axis\n\t\t\t\t\tlockY: false, // lock movement into y-axis\n\t\t\t\t\tboundingBox: false, // lock movement inside this element boundaries\n\t\t\t\t\tmirrorContainer: _doc.body, // element for appending mirror\n\t\t\t\t\tignoreInputTextSelection: true, // text selection in inputs wont be considered as drag\n\t\t\t\t\tcompileItemOnDrop: false,\n\t\t\t\t\tonInit: false // function callback called after dragular initialisation and providing drake as first argument\n\t\t\t\t},\n\n\t\t\t\tdrake = {\n\t\t\t\t\tcontainers: shared.containers, // all containers\n\t\t\t\t\tcontainersCtx: shared.containersCtx, // all contexts to containers\n\t\t\t\t\tsanitizeContainersModel: depSanitize,\n\t\t\t\t\tsanitizeContainers: sanitizeContainers,\n\t\t\t\t\taddContainers: addContainers,\n\t\t\t\t\tremoveContainers: removeContainers,\n\t\t\t\t\tisContainer: isContainer,\n\t\t\t\t\tstart: manualStart,\n\t\t\t\t\tend: end,\n\t\t\t\t\tcancel: cancel,\n\t\t\t\t\tremove: remove,\n\t\t\t\t\tdestroy: destroy,\n\t\t\t\t\tdragging: false\n\t\t\t\t};\n\n\t\t\tprocessServiceArguments(); // both arguments (containers and options) are optional, this function handle this\n\t\t\textendOptions();\n\t\t\tprocessOptionsObject();\n\t\t\tregisterEvents();\n\n\t\t\tif ( o.onInit ) {\n\t\t\t\to.onInit( drake, o );\n\t\t\t}\n\t\t\treturn drake;\n\n\n\t\t\t// Function definitions: ==============================================================================================================\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Dragular service init functions: ---------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction processServiceArguments() {\n\n\t\t\t\tif ( arguments.length === 1 && // if there is only one argument we need to distinguish if it is options object or container(s) reference\n\n\t\t\t\t\t!_isArray( arg0 ) && // array of containers elements\n\t\t\t\t\t!angular.isElement( arg0 ) && // one container element\n\t\t\t\t\t!arg0[ 0 ] && // array-like object with containers elements\n\t\t\t\t\ttypeof arg0 !== 'string' ) { // selector\n\t\t\t\t\t// then arg0 is options object\n\t\t\t\t\toptions = arg0 || {};\n\t\t\t\t\tinitialContainers = []; // containers are not provided on init\n\t\t\t\t}\n\t\t\t\telse if ( typeof arg0 === 'string' ) {\n\n\t\t\t\t\tinitialContainers = document.querySelectorAll( arg0 );\n\t\t\t\t}\n\n\t\t\t\to = options.copyOptions ? angular.copy( options ) : options;\n\t\t\t}\n\n\t\t\tfunction extendOptions() {\n\n\t\t\t\tvar tmp = angular.extend( {}, defaultOptions, o ); // tmp for keeping defaults untouched\n\t\t\t\tangular.extend( o, tmp ); // merge defaults back into options\n\n\t\t\t\tif ( o.classes ) {\n\n\t\t\t\t\ttmp = angular.extend( {}, defaultClasses, o.classes );\n\t\t\t\t\tangular.extend( o.classes, tmp );\n\t\t\t\t}\n\n\t\t\t\tif ( o.eventNames ) {\n\n\t\t\t\t\ttmp = angular.extend( {}, defaultEventNames, o.eventNames );\n\t\t\t\t\tangular.extend( o.eventNames, tmp );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction processOptionsObject() {\n\n\t\t\t\t// bounding box must be pure DOM element, not jQuery wrapper or something else..\n\t\t\t\tif ( !isElement( o.boundingBox ) ) {\n\t\t\t\t\to.boundingBox = false;\n\t\t\t\t}\n\n\t\t\t\t// initial containers provided via options are higher priority then by parameter\n\t\t\t\tif ( o.containers ) {\n\t\t\t\t\tinitialContainers = o.containers;\n\t\t\t\t}\n\n\t\t\t\t// sanitize initialContainers\n\t\t\t\to.containers = sanitizeContainers( initialContainers, false, o.scope );\n\n\t\t\t\t// sanitize o.containersModel\n\t\t\t\to.containersModel = sanitizeContainers( o.containersModel, true, o.scope );\n\n\t\t\t\t// sanitize o.containersFilteredModel\n\t\t\t\tif ( _isArray( o.containersFilteredModel ) ) {\n\t\t\t\t\t// |-------- is 2D array? -----------|\n\t\t\t\t\to.containersFilteredModel = _isArray( o.containersFilteredModel[ 0 ] ) ? o.containersFilteredModel : [ o.containersFilteredModel ];\n\t\t\t\t} else {\n\t\t\t\t\to.containersFilteredModel = [];\n\t\t\t\t}\n\n\t\t\t\t// feed containers groups and optionaly do same for models\n\t\t\t\tif ( !o.nameSpace ) {\n\t\t\t\t\to.nameSpace = [ 'dragularCommon' ];\n\t\t\t\t}\n\n\t\t\t\tif ( !_isArray( o.nameSpace ) ) {\n\t\t\t\t\to.nameSpace = [ o.nameSpace ];\n\t\t\t\t}\n\n\t\t\t\to.nameSpace.forEach( function eachNameSpace( nameSpace ) {\n\n\t\t\t\t\tif ( !shared.containers[ nameSpace ] ) {\n\n\t\t\t\t\t\tshared.containers[ nameSpace ] = [];\n\t\t\t\t\t\tshared.containersCtx[ nameSpace ] = [];\n\t\t\t\t\t}\n\n\t\t\t\t\tvar len = getContainers( o ).length,\n\t\t\t\t\t\tcont;\n\n\t\t\t\t\tfor ( var i = 0; i < len; i++ ) {\n\n\t\t\t\t\t\tcont = getContainers( o )[ i ];\n\n\t\t\t\t\t\tif (!cont) {\n\t\t\t\t\t\t\tthrow new Error( 'Container element must be defined!' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (shared.containers[ nameSpace ].indexOf(cont) !== -1) {\n\t\t\t\t\t\t\tthrow new Error( 'Cannot register container element more than once! Container element: ' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tshared.containers[ nameSpace ].push(cont);\n\t\t\t\t\t\tshared.containersCtx[ nameSpace ].push({\n\t\t\t\t\t\t\to: o,\n\t\t\t\t\t\t\tm: getContainersModel( o )[ i ], // can be undefined\n\t\t\t\t\t\t\tfm: o.containersFilteredModel[ i ] // can be undefined\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tfunction registerEvents( remove ) {\n\t\t\t\tvar op = remove ? 'off' : 'on';\n\t\t\t\tregEvent( _docElm, op, 'mouseup', release );\n\n\t\t\t\tgetContainers( o ).forEach( function addMouseDown( container ) {\n\t\t\t\t\tregEvent( container, 'on', 'mousedown', grab );\n\t\t\t\t} );\n\n\t\t\t\tif ( !remove ) { // create dragular DOM events\n\t\t\t\t\tangular.forEach( [ 'dragularenter', 'dragularleave', 'dragularrelease' ], function prepareDragOverEvents( name ) {\n\t\t\t\t\t\tvar eventName = o.eventNames[ name ];\n\t\t\t\t\t\tif ( !shared.dragOverEvents[ eventName ] ) {\n\t\t\t\t\t\t\tif ( _doc.createEvent ) {\n\t\t\t\t\t\t\t\tshared.dragOverEvents[ eventName ] = _doc.createEvent( 'HTMLEvents' );\n\t\t\t\t\t\t\t\tshared.dragOverEvents[ eventName ].initEvent( eventName, true, true );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tshared.dragOverEvents[ eventName ] = _doc.createEventObject();\n\t\t\t\t\t\t\t\tshared.dragOverEvents[ eventName ].eventType = eventName;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Grab stage: ------------------------------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction grab( e ) {\n\n\t\t\t\t// filter some odd situations\n\t\t\t\tif ( whichMouseButton( e ) !== 1 || e.metaKey || e.ctrlKey ) {\n\t\t\t\t\treturn; // we only care about honest-to-god left clicks and touch events\n\t\t\t\t}\n\n\t\t\t\t// set itial values\n\t\t\t\tshared.moveX = e.clientX;\n\t\t\t\tshared.moveY = e.clientY;\n\n\t\t\t\tvar context = canStart( e.target );\n\t\t\t\tif ( !context || !context.item ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tshared.grabbed = context;\n\t\t\t\teventualMovements();\n\t\t\t\tif ( e.type === 'mousedown' ) {\n\t\t\t\t\tif ( isInput( e.target ) ) { // see also: https://github.com/bevacqua/dragula/issues/208\n\t\t\t\t\t\te.target.focus(); // fixes https://github.com/bevacqua/dragula/issues/176\n\t\t\t\t\t\t// changed from context.item to e.target fixing https://github.com/luckylooke/dragular/issues/87#issuecomment-256865796\n\t\t\t\t\t} else {\n\t\t\t\t\t\te.preventDefault(); // fixes https://github.com/bevacqua/dragula/issues/155\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction eventualMovements( remove ) {\n\n\t\t\t\tvar op = remove ? 'off' : 'on';\n\t\t\t\tregEvent( _docElm, op, 'mousemove', startBecauseMouseMoved );\n\t\t\t}\n\n\t\t\tfunction startBecauseMouseMoved( e ) {\n\n\t\t\t\tif ( !shared.grabbed || drake.dragging ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( e.originalEvent ) {\n\t\t\t\t\te = e.originalEvent; // jQuery enviroment\n\t\t\t\t}\n\n\t\t\t\tif ( whichMouseButton( e ) === 0 ) {\n\t\t\t\t\trelease( {} );\n\t\t\t\t\treturn; // when text is selected on an input and then dragged, mouseup doesn't fire. this is our only hope\n\t\t\t\t}\n\n\t\t\t\t// truthy check fixes dragula-#239, equality fixes dragula-#207\n\t\t\t\tif ( e.clientX && e.clientX === shared.moveX && e.clientY && e.clientY === shared.moveY ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( g( o.ignoreInputTextSelection ) ) {\n\n\t\t\t\t\tvar clientX = getCoord( 'clientX', e ),\n\t\t\t\t\t\tclientY = getCoord( 'clientY', e ),\n\t\t\t\t\t\telementBehindCursor = _doc.elementFromPoint( clientX, clientY );\n\t\t\t\t\tif ( isInput( elementBehindCursor ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar grabbed = shared.grabbed; // calling end() unsets shared.grabbed\n\t\t\t\teventualMovements( 'remove' ); // remove mousemove listener\n\t\t\t\tmovements();\n\t\t\t\tend();\n\t\t\t\tstart( grabbed );\n\n\t\t\t\tif ( !shared.item ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// automaticly detect direction of elements if not set in options\n\t\t\t\tif ( !o.direction && getParent( shared.sourceItem ) ) {\n\t\t\t\t\tvar parent = shared.sourceItem.parentNode,\n\t\t\t\t\t\tparentHeight = parent.offsetHeight,\n\t\t\t\t\t\tparentWidth = parent.offsetWidth,\n\t\t\t\t\t\tchildHeight = shared.sourceItem.clientHeight,\n\t\t\t\t\t\tchildWidth = shared.sourceItem.clientWidth;\n\t\t\t\t\to.direction = parentHeight / childHeight < parentWidth / childWidth ? 'horizontal' : 'vertical';\n\t\t\t\t}\n\n\t\t\t\t// get initial coordinates, used to render shared.mirror for first time\n\t\t\t\tvar offset = getOffset( shared.sourceItem );\n\t\t\t\tshared.offsetX = getCoord( 'pageX', e ) - offset.left;\n\t\t\t\tshared.offsetY = getCoord( 'pageY', e ) - offset.top;\n\t\t\t\tshared.clientX = getCoord( 'clientX', e );\n\t\t\t\tshared.clientY = getCoord( 'clientY', e );\n\n\t\t\t\t// limiting area of shared.mirror movement, get initial coordinates\n\t\t\t\tif ( o.boundingBox ) {\n\t\t\t\t\tshared.offsetXr = getCoord( 'pageX', e ) - offset.right;\n\t\t\t\t\tshared.offsetYb = getCoord( 'pageY', e ) - offset.bottom;\n\t\t\t\t}\n\n\t\t\t\te.preventDefault();\n\n\t\t\t\trenderMirrorImage();\n\t\t\t\taddClass( shared.item, o.classes.transit );\n\t\t\t\t// initial position\n\t\t\t\tshared.mirror.style.left = shared.clientX - shared.offsetX + 'px';\n\t\t\t\tshared.mirror.style.top = shared.clientY - shared.offsetY + 'px';\n\n\t\t\t\tdrag( e );\n\t\t\t}\n\n\t\t\tfunction movements( remove ) {\n\n\t\t\t\tvar op = remove ? 'off' : 'on';\n\t\t\t\tregEvent( _docElm, op, 'selectstart', preventGrabbed ); // IE8\n\t\t\t\tregEvent( _docElm, op, 'click', preventGrabbed );\n\t\t\t\tregEvent( _docElm, op, 'touchmove', preventGrabbed ); // fixes touch devices scrolling while drag\n\t\t\t}\n\n\t\t\tfunction canStart( item ) {\n\t\t\t\tif ( drake.dragging && shared.mirror ) {\n\t\t\t\t\treturn; // already dragging\n\t\t\t\t}\n\n\t\t\t\tvar handle = item;\n\t\t\t\twhile ( getParent( item ) && !isContainer( getParent( item ) ) ) {\n\t\t\t\t\t// break loop if user tries to drag item which is considered invalid handle\n\t\t\t\t\tif ( o.invalid( item, handle ) ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\titem = getParent( item ); // drag target should be immediate child of container\n\t\t\t\t\tif ( !item ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar source = getParent( item );\n\t\t\t\tif ( !source ||\n\t\t\t\t\to.invalid( item, handle ) || !o.moves( item, source, handle, nextEl( item ) ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\titem: item,\n\t\t\t\t\tsource: source\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tfunction start( context ) {\n\t\t\t\tshared.sourceItem = shared.item = context.item;\n\t\t\t\tshared.source = context.source;\n\t\t\t\tshared.initialSibling = shared.currentSibling = nextEl( context.item );\n\n\t\t\t\tif ( g( o.copy, [ context.item, context.source ] ) ) {\n\t\t\t\t\t// http://api.jquery.com/clone/#clone-withDataAndEvents-deepWithDataAndEvents\n\t\t\t\t\tshared.item = angular.element( context.item ).clone( o.copy === 'events', o.copy === 'events' )[0];\n\t\t\t\t\tshared.copy = o.copy;\n\t\t\t\t\tif ( o.scope ) {\n\t\t\t\t\t\to.scope.$emit( o.eventNames.dragularcloned, shared.item, context.item );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tshared.copy = false;\n\t\t\t\t}\n\n\t\t\t\t// prepare models operations\n\t\t\t\tvar containerIndex = getContainers( o ).indexOf( context.source );\n\t\t\t\tshared.sourceModel = getContainersModel( o )[ containerIndex ];\n\n\t\t\t\tshared.sourceFilteredModel = o.containersFilteredModel[ containerIndex ];\n\t\t\t\tshared.initialIndex = domIndexOf( context.item, context.source );\n\n\t\t\t\tdrake.dragging = true;\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\to.scope.$emit( o.eventNames.dragulardrag, shared.sourceItem, shared.source );\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tfunction manualStart( item ) {\n\t\t\t\tvar context = canStart( item );\n\t\t\t\tif ( context ) {\n\t\t\t\t\tshared.grabbed = context;\n\t\t\t\t\teventualMovements();\n\t\t\t\t\t//start(context);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction renderMirrorImage() {\n\t\t\t\tif ( shared.mirror ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar rect = shared.sourceItem.getBoundingClientRect();\n\t\t\t\tshared.mirror = shared.sourceItem.cloneNode( true );\n\t\t\t\tshared.mirrorWidth = rect.width;\n\t\t\t\tshared.mirrorHeight = rect.height;\n\t\t\t\tshared.mirror.style.width = getRectWidth( rect ) + 'px';\n\t\t\t\tshared.mirror.style.height = getRectHeight( rect ) + 'px';\n\t\t\t\taddClass( shared.mirror, o.classes.mirror );\n\t\t\t\to.mirrorContainer.appendChild( shared.mirror );\n\t\t\t\tregEvent( _docElm, 'on', 'mousemove', drag );\n\t\t\t\taddClass( _doc.body, o.classes.unselectable );\n\t\t\t\tregEvent( shared.mirror, 'on', 'wheel', scrollContainer );\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\to.scope.$emit( o.eventNames.dragularcloned, shared.mirror, shared.sourceItem );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction end() {\n\t\t\t\tif ( !drake.dragging || !shared.item ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdrop( shared.item, getParent( shared.item ) );\n\t\t\t}\n\n\t\t\tfunction ungrab() {\n\t\t\t\tshared.grabbed = false;\n\t\t\t\teventualMovements( 'remove' );\n\t\t\t\tmovements( 'remove' );\n\t\t\t}\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Drag stage: ------------------------------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction drag( e ) { // watch performance!! - function is running each mousemove!\n\t\t\t\tif ( !shared.mirror ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( e.originalEvent ) {\n\t\t\t\t\te = e.originalEvent; // jQuery environment\n\t\t\t\t}\n\n\t\t\t\t// update coordinates\n\t\t\t\tshared.clientX = getCoord( 'clientX', e );\n\t\t\t\tshared.clientY = getCoord( 'clientY', e );\n\n\t\t\t\t// count mirror coordinates\n\t\t\t\tvar x = shared.clientX - shared.offsetX,\n\t\t\t\t\ty = shared.clientY - shared.offsetY,\n\t\t\t\t\tpageX,\n\t\t\t\t\tpageY,\n\t\t\t\t\toffsetBox;\n\n\t\t\t\t// fill extra properties if boundingBox is used\n\t\t\t\tif ( o.boundingBox ) {\n\t\t\t\t\tpageX = getCoord( 'pageX', e );\n\t\t\t\t\tpageY = getCoord( 'pageY', e );\n\t\t\t\t\toffsetBox = getOffset( o.boundingBox );\n\t\t\t\t}\n\n\t\t\t\tif ( !o.lockY ) {\n\t\t\t\t\tif ( !o.boundingBox || (pageX > offsetBox.left + shared.offsetX && pageX < offsetBox.right + shared.offsetXr) ) {\n\t\t\t\t\t\tshared.mirror.style.left = x + 'px';\n\t\t\t\t\t} else if ( o.boundingBox ) { // check again in case user scrolled the view\n\t\t\t\t\t\tif ( pageX < offsetBox.left + shared.offsetX ) {\n\t\t\t\t\t\t\tshared.mirror.style.left = shared.clientX - (pageX - offsetBox.left) + 'px';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tshared.mirror.style.left = shared.clientX - shared.mirrorWidth - (pageX - offsetBox.right) + 'px';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( !o.lockX ) {\n\t\t\t\t\tif ( !o.boundingBox || (pageY > offsetBox.top + shared.offsetY && pageY < offsetBox.bottom + shared.offsetYb) ) {\n\t\t\t\t\t\tshared.mirror.style.top = y + 'px';\n\t\t\t\t\t} else if ( o.boundingBox ) { // check again in case user scrolled the view\n\t\t\t\t\t\tif ( pageY < offsetBox.top + shared.offsetY ) {\n\t\t\t\t\t\t\tshared.mirror.style.top = shared.clientY - (pageY - offsetBox.top) + 'px';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tshared.mirror.style.top = shared.clientY - shared.mirrorHeight - (pageY - offsetBox.bottom) + 'px';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar elementBehindCursor = getElementBehindPoint( shared.mirror, shared.clientX, shared.clientY ),\n\t\t\t\t\tdropTarget = findDropTarget( elementBehindCursor, shared.clientX, shared.clientY ),\n\t\t\t\t\tchanged = dropTarget !== shared.lastDropTarget;\n\n\t\t\t\tif ( elementBehindCursor !== shared.lastElementBehindCursor ) {\n\t\t\t\t\tfireEvent( elementBehindCursor, shared.dragOverEvents.dragularenter, !!dropTarget );\n\t\t\t\t\tif ( shared.lastElementBehindCursor ) {\n\t\t\t\t\t\tfireEvent( shared.lastElementBehindCursor, shared.dragOverEvents.dragularleave, elementBehindCursor );\n\t\t\t\t\t}\n\t\t\t\t\tshared.lastElementBehindCursor = elementBehindCursor;\n\t\t\t\t}\n\n\t\t\t\tif ( changed ) {\n\t\t\t\t\tif ( shared.lastDropTarget ) {\n\t\t\t\t\t\tmoved( 'out' );\n\t\t\t\t\t}\n\t\t\t\t\tshared.lastDropTarget = dropTarget;\n\t\t\t\t\tmoved( 'over' );\n\t\t\t\t}\n\n\t\t\t\t// do not copy in same container\n\t\t\t\tif ( dropTarget === shared.source && shared.copy && !g( o.copySortSource ) ) {\n\t\t\t\t\tif ( getParent( shared.item ) ) {\n\t\t\t\t\t\tshared.item.parentNode.removeChild( shared.item );\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar reference,\n\t\t\t\t\timmediate = getImmediateChild( dropTarget, elementBehindCursor );\n\n\t\t\t\tif ( immediate !== null ) {\n\t\t\t\t\treference = getReference( dropTarget, immediate, shared.clientX, shared.clientY );\n\t\t\t\t} else if ( g( o.revertOnSpill ) === true && !shared.copy ) {\n\t\t\t\t\t// the case that mirror is not over valid target and reverting is on and copy is off\n\t\t\t\t\treference = shared.initialSibling;\n\t\t\t\t\tdropTarget = shared.source;\n\t\t\t\t} else {\n\t\t\t\t\t// the case that mirror is not over valid target and removing is on or copy is on\n\t\t\t\t\tif ( shared.copy && getParent( shared.item ) ) {\n\t\t\t\t\t\t// remove item or copy of item\n\t\t\t\t\t\tshared.item.parentNode.removeChild( shared.item );\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( (reference === null && changed) ||\n\t\t\t\t\treference !== shared.item &&\n\t\t\t\t\treference !== nextEl( shared.item ) &&\n\t\t\t\t\treference !== shared.currentSibling ) {\n\t\t\t\t\t// moving item/copy to new container from previous one\n\t\t\t\t\tshared.currentSibling = reference;\n\n\t\t\t\t\tdropTarget.insertBefore( shared.item, reference ); // if reference is null item is inserted at the end\n\n\t\t\t\t\tif ( o.scope ) {\n\t\t\t\t\t\to.scope.$emit( o.eventNames.dragularshadow, shared.item, dropTarget, e );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction moved( type ) {\n\t\t\t\t\tif ( o.scope ) {\n\t\t\t\t\t\tnotify( o.scope );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( shared.targetCtx && shared.targetCtx.o.scope && shared.targetCtx.o.scope !== o.scope ) {\n\t\t\t\t\t\tnotify( shared.targetCtx.o.scope );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( g( o.removeOnSpill ) === true ) {\n\t\t\t\t\t\ttype === 'over' ? spillOver() : spillOut();\n\t\t\t\t\t}\t\n\n\t\t\t\t\tfunction notify( scope ){\n\t\t\t\t\t\tscope.$emit( o.eventNames[ 'dragular' + type ], shared.item, shared.lastDropTarget, shared.source, e );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// find valid drop container\n\t\t\tfunction findDropTarget( elementBehindCursor, clientX, clientY ) { // watch performance!! - running each move!\n\t\t\t\tvar target = elementBehindCursor,\n\t\t\t\t\ttargetCtx = null;\n\n\t\t\t\twhile ( target && !accepted() ) {\n\t\t\t\t\ttarget = getParent( target );\n\t\t\t\t}\n\n\t\t\t\t// bugfix #148 model not updated on spill\n\t\t\t\t// added target condition to fix #161\n\t\t\t\tif ( target && targetCtx ){\n\t\t\t\t\tshared.targetCtx = targetCtx;\n\t\t\t\t}\n\n\t\t\t\treturn target;\n\n\t\t\t\tfunction accepted() {\n\n\t\t\t\t\tif ( !isContainer( target ) ) { // is not droppable?\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar immediate = getImmediateChild( target, elementBehindCursor ),\n\t\t\t\t\t\treference = getReference( target, immediate, clientX, clientY ),\n\t\t\t\t\t\tinitial = isInitialPlacement( target, reference ),\n\t\t\t\t\t\ti = o.nameSpace.length,\n\t\t\t\t\t\tnameSpace;\n\n\t\t\t\t\twhile ( i-- ) { // for each namespace\n\t\t\t\t\t\tnameSpace = o.nameSpace[ i ];\n\t\t\t\t\t\tif ( shared.containers[ nameSpace ].indexOf( target ) !== -1 ) {\n\t\t\t\t\t\t\ttargetCtx = getTargetCtx( nameSpace );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// shared.target must be actual (used for scroll functionality)\n\t\t\t\t\tshared.target = target;\n\n\t\t\t\t\tif ( initial ) {\n\n\t\t\t\t\t\treturn true; // accepts = true;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// try to find target in default set of containers\n\t\t\t\t\t\tif ( !targetCtx ) {\n\t\t\t\t\t\t\ttargetCtx = getTargetCtx( 'dragularCommon' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if found and containersModel is dynamic, retrieve model\n\t\t\t\t\t\tif ( targetCtx && _isFunction( targetCtx.o.containersModel ) ) {\n\t\t\t\t\t\t\t// fix targetCtx.m(odel) for dynamic containersModel\n\t\t\t\t\t\t\ttargetCtx.m = getContainersModel( targetCtx.o )[ getContainers( targetCtx.o ).indexOf( target ) ];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( targetCtx && // target container is defined via service or directive\n\t\t\t\t\t\t\ttargetCtx.o.accepts && !targetCtx.o.accepts( shared.item, target, shared.source, reference, shared.sourceModel, shared.initialIndex ) ) {\n\n\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\t} else if ( o.isContainer && // target container is recognized via o.isContainer\n\t\t\t\t\t\t\to.isContainerAccepts && !o.isContainerAccepts( shared.item, target, shared.source, reference, shared.sourceModel, shared.initialIndex ) ) {\n\n\t\t\t\t\t\t\treturn false;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn !o.canBeAccepted || o.canBeAccepted( shared.item, target, shared.source, reference, shared.sourceModel, shared.initialIndex );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tfunction getTargetCtx( nameSpace ) {\n\t\t\t\t\treturn shared.containersCtx[ nameSpace ] && shared.containersCtx[ nameSpace ][ shared.containers[ nameSpace ].indexOf( target ) ];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction spillOver() {\n\t\t\t\trmClass( shared.item, o.classes.hide );\n\t\t\t}\n\n\t\t\tfunction spillOut() {\n\t\t\t\tif ( drake.dragging ) {\n\t\t\t\t\taddClass( shared.item, o.classes.hide );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// is item currently placed in original container and original position?\n\t\t\tfunction isInitialPlacement( target, s ) { // watch performance - running each move several times!\n\t\t\t\tvar sibling = s !== undefined ? s : (shared.mirror ? shared.currentSibling : nextEl( shared.item ));\n\t\t\t\treturn target === shared.source && sibling === shared.initialSibling;\n\t\t\t}\n\n\t\t\tfunction getImmediateChild( dropTarget, target ) { // watch performance - running each move several times!\n\t\t\t\tvar immediate = target;\n\t\t\t\twhile ( immediate !== dropTarget && getParent( immediate ) !== dropTarget ) {\n\t\t\t\t\timmediate = getParent( immediate );\n\t\t\t\t}\n\t\t\t\tif ( immediate === _docElm ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\treturn immediate;\n\t\t\t}\n\n\t\t\tfunction getReference( dropTarget, target, x, y ) { // watch performance - running each move several times!\n\t\t\t\tvar horizontal = o.direction === 'horizontal';\n\t\t\t\treturn target !== dropTarget ? inside() : outside();\n\n\t\t\t\tfunction outside() { // slower, but able to figure out any position\n\t\t\t\t\tvar len = dropTarget.children.length,\n\t\t\t\t\t\ti, el, rect;\n\t\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\t\tel = dropTarget.children[ i ];\n\t\t\t\t\t\trect = el.getBoundingClientRect();\n\t\t\t\t\t\tif ( horizontal && rect.left > x ) {\n\t\t\t\t\t\t\treturn el;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( !horizontal && rect.top > y ) {\n\t\t\t\t\t\t\treturn el;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tfunction inside() { // faster, but only available if dropped inside a child element\n\t\t\t\t\tvar rect = target.getBoundingClientRect();\n\t\t\t\t\tif ( horizontal ) {\n\t\t\t\t\t\treturn resolve( x > rect.left + getRectWidth( rect ) / 2 );\n\t\t\t\t\t}\n\t\t\t\t\treturn resolve( y > rect.top + getRectHeight( rect ) / 2 );\n\t\t\t\t}\n\n\t\t\t\tfunction resolve( after ) {\n\t\t\t\t\treturn after ? nextEl( target ) : target;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction getElementBehindPoint( point, x, y ) { // watch performance!! - function is running each mousemove!\n\t\t\t\tvar p = point || {},\n\t\t\t\t\tstate = p.className,\n\t\t\t\t\tel;\n\t\t\t\tp.className += ' ' + o.classes.hide;\n\t\t\t\tel = _doc.elementFromPoint( x, y );\n\t\t\t\tp.className = state;\n\t\t\t\treturn el;\n\t\t\t}\n\n\t\t\tfunction isContainer( el ) {\n\n\t\t\t\tif ( !el ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvar i = o.nameSpace.length;\n\t\t\t\twhile ( i-- ) {\n\n\t\t\t\t\tif ( shared.containers[ o.nameSpace[ i ] ].indexOf( el ) !== -1 ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( o.isContainer( el ) ) {\n\n\t\t\t\t\tshared.tempModel = o.isContainerModel( el );\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\n\t\t\t\t\tshared.tempModel = null;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tfunction getContainers( opt ) {\n\n\t\t\t\treturn _getContainers( 'containers', opt );\n\t\t\t}\n\n\t\t\tfunction getContainersModel( opt ) {\n\n\t\t\t\treturn _getContainers( 'containersModel', opt, true );\n\t\t\t}\n\n\t\t\tfunction _getContainers( containersType, opt, to2d ) {\n\n\t\t\t\treturn _isFunction( opt[ containersType ] ) ? sanitizeContainers(\n\t\t\t\t\topt[ containersType ](\n\t\t\t\t\t\t(opt === o ? drake : null),\n\t\t\t\t\t\tshared\n\t\t\t\t\t),\n\t\t\t\t\tto2d,\n\t\t\t\t\topt.scope\n\t\t\t\t) : opt[ containersType ];\n\t\t\t}\n\n\t\t\tfunction cancel( revert ) {\n\t\t\t\tif ( !drake.dragging ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar reverts = arguments.length > 0 ? revert : g( o.revertOnSpill ),\n\t\t\t\t\tparent = getParent( shared.item );\n\n\t\t\t\tvar initial = isInitialPlacement( parent );\n\t\t\t\tif ( !initial && !shared.copy && reverts ) {\n\t\t\t\t\tshared.source.insertBefore( shared.item, shared.initialSibling );\n\t\t\t\t}\n\t\t\t\tif ( shared.sourceModel && !shared.copy && !reverts ) {\n\t\t\t\t\tdrop( shared.item, parent );\n\t\t\t\t} else if ( o.scope ) {\n\t\t\t\t\tif ( initial || reverts ) {\n\t\t\t\t\t\to.scope.$emit( o.eventNames.dragularcancel, shared.item, shared.source, shared.sourceModel, shared.initialIndex );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( !shared.sourceModel || shared.copy || reverts || initial ) {\n\t\t\t\t\tcleanup();\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Release stage: ------------------------------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction release( e ) {\n\n\t\t\t\tungrab();\n\t\t\t\tif ( !drake.dragging ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ( e.originalEvent ) {\n\t\t\t\t\te = e.originalEvent; // jQuery enviroment\n\t\t\t\t}\n\n\t\t\t\tshared.clientX = getCoord( 'clientX', e );\n\t\t\t\tshared.clientY = getCoord( 'clientY', e );\n\n\t\t\t\tvar elementBehindCursor = getElementBehindPoint( shared.mirror, shared.clientX, shared.clientY ),\n\t\t\t\t\tdropTarget = findDropTarget( elementBehindCursor, shared.clientX, shared.clientY );\n\n\t\t\t\tif ( dropTarget && ((shared.copy && g( o.copySortSource )) || (!shared.copy || dropTarget !== shared.source)) ) {\n\t\t\t\t\t// found valid target and (is not copy case or target is not initial container)\n\t\t\t\t\tdrop( shared.item, dropTarget );\n\t\t\t\t} else if ( g( o.removeOnSpill ) ) {\n\t\t\t\t\tremove();\n\t\t\t\t} else {\n\t\t\t\t\tcancel();\n\t\t\t\t}\n\n\t\t\t\t// after release there is no container hovered\n\t\t\t\tshared.target = null;\n\n\t\t\t\tif ( shared.lastElementBehindCursor ) {\n\t\t\t\t\tfireEvent( shared.lastElementBehindCursor, shared.dragOverEvents.dragularrelease, elementBehindCursor );\n\t\t\t\t}\n\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\to.scope.$emit( o.eventNames.dragularrelease, shared.item, shared.source, e );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction drop( item, target ) {\n\t\t\t\tif ( !item ) { // https://github.com/luckylooke/dragular/issues/102\n\t\t\t\t\tcleanup();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar sourceItem = shared.sourceItem,\n\t\t\t\t\tcurrentSibling = shared.currentSibling,\n\t\t\t\t\tdropIndex = domIndexOf( item, target );\n\n\t\t\t\tif ( shared.copy && target === shared.source && getParent( item ) && g( o.copySortSource ) ) {\n\t\t\t\t\titem.parentNode.removeChild( shared.sourceItem );\n\t\t\t\t}\n\n\t\t\t\tif ( shared.sourceModel && !isInitialPlacement( target ) ) {\n\t\t\t\t\tif ( shared.targetCtx && shared.targetCtx.fm ) { // target has filtered model\n\t\t\t\t\t\t// convert index from index-in-filteredModel to index-in-model\n\t\t\t\t\t\tdropIndex = shared.targetCtx.m.indexOf( shared.targetCtx.fm[ dropIndex ] );\n\t\t\t\t\t}\n\t\t\t\t\tif ( shared.sourceFilteredModel ) { // source has filtered model\n\t\t\t\t\t\t// convert index from index-in-filteredModel to index-in-model\n\t\t\t\t\t\tshared.initialIndex = shared.sourceModel.indexOf( shared.sourceFilteredModel[ shared.initialIndex ] );\n\t\t\t\t\t}\n\t\t\t\t\t$rootScope.$applyAsync( function applyDrop() {\n\t\t\t\t\t\tif ( !shared.sourceModel ) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( target === shared.source ) {\n\t\t\t\t\t\t\tshared.sourceModel.splice( dropIndex, 0, shared.sourceModel.splice( shared.initialIndex, 1 )[ 0 ] );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tshared.dropElmModel = shared.copy && !o.dontCopyModel ? angular.copy( shared.sourceModel[ shared.initialIndex ] ) : shared.sourceModel[ shared.initialIndex ];\n\n\t\t\t\t\t\t\tif ( !shared.tempModel ) {\n\t\t\t\t\t\t\t\tshared.targetModel = ( shared.targetCtx && shared.targetCtx.m ) || shared.sourceModel;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tshared.targetModel = shared.tempModel;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\titem.parentNode.removeChild( item ); // element must be removed for ngRepeat to apply correctly\n\n\t\t\t\t\t\t\tif ( !shared.copy ) {\n\t\t\t\t\t\t\t\tshared.sourceModel.splice( shared.initialIndex, 1 );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( shared.targetModel ) {\n\t\t\t\t\t\t\t\tshared.targetModel.splice( dropIndex, 0, shared.dropElmModel );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// removing element, as protection against duplicates, angular ng-repeat will create new item according to model\n\t\t\t\t\t\tif ( getParent( item ) ) {\n\t\t\t\t\t\t\titem.parentNode.removeChild( item );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tafterDrop();\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tafterDrop();\n\t\t\t\t}\n\n\t\t\t\tfunction afterDrop() {\n\n\t\t\t\t\t// in nested containers case, new containers doesnt have registered mousedown\n\t\t\t\t\tgetContainers( o ).forEach( function readdMouseDown( container ) {\n\t\t\t\t\t\tregEvent( container, 'off', 'mousedown', grab );\n\t\t\t\t\t\tregEvent( container, 'on', 'mousedown', grab );\n\t\t\t\t\t} );\n\n\t\t\t\t\tif ( o.compileItemOnDrop ) {\n\t\t\t\t\t\tvar scope = angular.element( target ).scope ? angular.element( target ).scope() : o.scope;\n\t\t\t\t\t\tif ( scope ) {\n\t\t\t\t\t\t\tscope.$applyAsync( function () {\n\t\t\t\t\t\t\t\tvar content = $compile( shared.copy ? sourceItem.cloneNode( true ) : sourceItem )( scope );\n\t\t\t\t\t\t\t\tif ( item.parentNode === target ) {\n\t\t\t\t\t\t\t\t\ttarget.removeChild( item );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttarget.insertBefore( content[ 0 ], currentSibling );\n\t\t\t\t\t\t\t\tcleanup();\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( o.scope ) {\n\t\t\t\t\t\tnotify( o.scope );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( shared.targetCtx && shared.targetCtx.o.scope && shared.targetCtx.o.scope !== o.scope ) {\n\t\t\t\t\t\tnotify( shared.targetCtx.o.scope );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !o.compileItemOnDrop ) {\n\t\t\t\t\t\tcleanup();\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction notify( scope ){\n\t\t\t\t\t\tif ( isInitialPlacement( target ) ) {\n\t\t\t\t\t\t\tscope.$emit( o.eventNames.dragularcancel, item, shared.source, shared.sourceModel, shared.initialIndex );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tscope.$emit( o.eventNames.dragulardrop, item, target, shared.source, shared.sourceModel, shared.initialIndex, shared.targetModel, dropIndex );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction remove() {\n\t\t\t\tif ( !drake.dragging ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar parent = getParent( shared.item );\n\n\t\t\t\tif ( parent ) {\n\t\t\t\t\tparent.removeChild( shared.item );\n\t\t\t\t}\n\n\t\t\t\tif ( shared.sourceModel ) {\n\t\t\t\t\t$rootScope.$applyAsync( function removeModel() {\n\t\t\t\t\t\tshared.sourceModel.splice( shared.initialIndex, 1 );\n\t\t\t\t\t\tcleanup();\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\to.scope.$emit( shared.copy ? o.eventNames.dragularcancel : o.eventNames.dragularremove, shared.item, parent, shared.sourceModel, shared.initialIndex );\n\t\t\t\t}\n\t\t\t\tif ( !shared.sourceModel ) {\n\t\t\t\t\tcleanup();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction cleanup() {\n\t\t\t\tungrab();\n\t\t\t\tremoveMirrorImage();\n\n\t\t\t\tif ( shared.item ) {\n\t\t\t\t\trmClass( shared.item, o.classes.transit );\n\t\t\t\t}\n\n\t\t\t\tdrake.dragging = false;\n\n\t\t\t\tif ( g( o.removeOnSpill ) === true ) {\n\t\t\t\t\tspillOut();\n\t\t\t\t}\n\n\t\t\t\tif ( o.scope ) {\n\t\t\t\t\tif ( shared.lastDropTarget ) {\n\t\t\t\t\t\to.scope.$emit( o.eventNames.dragularout, shared.item, shared.lastDropTarget, shared.source );\n\t\t\t\t\t}\n\t\t\t\t\to.scope.$emit( o.eventNames.dragulardragend, shared.item );\n\t\t\t\t}\n\n\t\t\t\tshared.source = shared.item = shared.sourceItem = shared.initialSibling = shared.currentSibling = shared.sourceModel = null;\n\t\t\t\tshared.initialIndex = shared.currentIndex = shared.lastDropTarget = shared.tempModel = shared.targetModel = null;\n\t\t\t\tshared.dropElmModel = shared.targetCtx = shared.copy = shared.moveX = shared.moveY = null;\n\t\t\t}\n\n\t\t\tfunction destroy() {\n\n\t\t\t\tregisterEvents( true );\n\t\t\t\tremoveContainers( o.containers );\n\t\t\t\trelease( {} );\n\t\t\t}\n\n\t\t\tfunction removeContainers( containers ) {\n\n\t\t\t\t$rootScope.$applyAsync( function applyDestroyed() {\n\n\t\t\t\t\tcontainers = _isArray( containers ) ? containers : makeArray( containers );\n\t\t\t\t\tcontainers.forEach( function forEachContainer( container ) {\n\n\t\t\t\t\t\tangular.forEach( o.nameSpace, function forEachNs( nameSpace ) {\n\n\t\t\t\t\t\t\tvar index;\n\t\t\t\t\t\t\tindex = shared.containers[ nameSpace ].indexOf( container );\n\t\t\t\t\t\t\tshared.containers[ nameSpace ].splice( index, 1 );\n\t\t\t\t\t\t\tshared.containersCtx[ nameSpace ].splice( index, 1 );\n\n\t\t\t\t\t\t\tif ( -1 < (index = initialContainers.indexOf( container ))) {\n\t\t\t\t\t\t\t\tinitialContainers.splice( index, 1 );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tfunction addContainers( containers ) {\n\n\t\t\t\tcontainers = _isArray( containers ) ? containers : makeArray( containers );\n\t\t\t\tcontainers.forEach( function forEachContainer( container, i ) {\n\n\t\t\t\t\tangular.forEach( o.nameSpace, function forEachNs( nameSpace ) {\n\n\t\t\t\t\t\tshared.containers[ nameSpace ].push( container );\n\t\t\t\t\t\tshared.containersCtx[ nameSpace ].push({\n\t\t\t\t\t\t\to: o,\n\t\t\t\t\t\t\tm: getContainersModel( o )[ i ], // can be undefined\n\t\t\t\t\t\t\tfm: o.containersFilteredModel[ i ] // can be undefined\n\t\t\t\t\t\t});\n\t\t\t\t\t\tinitialContainers.push( container );\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tfunction scrollContainer( e ) {\n\t\t\t\tif ( shared.target ) {\n\t\t\t\t\tif ( e.originalEvent ) {\n\t\t\t\t\t\te = e.originalEvent; // jQuery enviroment\n\t\t\t\t\t}\n\t\t\t\t\tvar before = shared.target.scrollTop;\n\t\t\t\t\tshared.target.scrollTop += e.deltaY;\n\t\t\t\t\t// block scroll of the document when container can be scrolled\n\t\t\t\t\tif ( before !== shared.target.scrollTop ) {\n\t\t\t\t\t\te.stopPropagation();\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction removeMirrorImage() {\n\t\t\t\tif ( shared.mirror ) {\n\t\t\t\t\trmClass( _doc.body, o.classes.unselectable );\n\t\t\t\t\tregEvent( _docElm, 'off', 'mousemove', drag );\n\t\t\t\t\tregEvent( shared.mirror, 'off', 'wheel', scrollContainer );\n\t\t\t\t\tif ( getParent( shared.mirror ) ) {\n\t\t\t\t\t\tshared.mirror.parentNode.removeChild( shared.mirror );\n\t\t\t\t\t}\n\t\t\t\t\tshared.mirror = null;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t// ====================================================================================================================================\n\t\t\t// Other fns: -------------------------------------------------------------------------------------------------------------------------\n\t\t\t// ====================================================================================================================================\n\n\n\t\t\tfunction depSanitize( containersModel ) {\n\t\t\t\tconsole.warn( 'Deprecated method drake.sanitizeContainersModel! Will be removed in next major release! Please use sanitizeContainers instead.' );\n\t\t\t\tsanitizeContainers( containersModel, true, o.scope );\n\t\t\t}\n\n\t\t} // end of service\n\n\t\t/****************************************************************************************************************************/\n\t\t/****************************************************************************************************************************/\n\t\t/****************************************************************************************************************************/\n\n\t\t// HELPERS FUNCTIONS:\n\n\t\tfunction sanitizeContainers( containers, to2d, scope ) {\n\n\t\t\tif ( _isFunction( containers ) ) {\n\n\t\t\t\treturn containers;\n\t\t\t}\n\t\t\telse if ( _isArray( containers ) ) {\n\n\t\t\t\tif ( to2d ) {\n\t\t\t\t\t// |-------- is 2D array? -----------|\n\t\t\t\t\treturn _isArray( containers[ 0 ] ) ? containers : [ containers ];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn containers;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( typeof containers === 'string' && scope ) {\n\n\t\t\t\tvar evaluated = scope.$eval( containers );\n\n\t\t\t\tif ( _isFunction( evaluated ) ) {\n\t\t\t\t\treturn evaluated;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn function () {\n\t\t\t\t\t\treturn scope.$eval( containers );\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if ( containers ) {\n\n\t\t\t\treturn makeArray( containers );\n\t\t\t}\n\n\t\t\treturn [];\n\t\t}\n\n\t\tfunction regEvent( el, op, type, fn ) {\n\t\t\tvar touch = {\n\t\t\t\t\tmouseup: 'touchend',\n\t\t\t\t\tmousedown: 'touchstart',\n\t\t\t\t\tmousemove: 'touchmove'\n\t\t\t\t},\n\t\t\t\tpointers = {\n\t\t\t\t\tmouseup: 'pointerup',\n\t\t\t\t\tmousedown: 'pointerdown',\n\t\t\t\t\tmousemove: 'pointermove'\n\t\t\t\t},\n\t\t\t\tmicrosoft = {\n\t\t\t\t\tmouseup: 'MSPointerUp',\n\t\t\t\t\tmousedown: 'MSPointerDown',\n\t\t\t\t\tmousemove: 'MSPointerMove'\n\t\t\t\t},\n\t\t\t\t$el = angular.element( el );\n\n\t\t\tif ( el.addEventListener ) {\n\n\t\t\t\tvar opConvert = { on: 'addEventListener', off: 'removeEventListener' };\n\t\t\t\tel[ opConvert[ op ] ]( type, fn, { passive: false } );\n\t\t\t\tel[ opConvert[ op ] ]( touch[ type ], fn, { passive: false } );\n\n\t\t\t} else {\n\n\t\t\t\tif ( typeof navigator !== 'undefined' && navigator.pointerEnabled && pointers[ type ] ) {\n\t\t\t\t\t$el[ op ]( pointers[ type ], fn );\n\t\t\t\t} else if ( typeof navigator !== 'undefined' && navigator.msPointerEnabled && microsoft[ type ] ) {\n\t\t\t\t\t$el[ op ]( microsoft[ type ], fn );\n\t\t\t\t} else if ( touch[ type ] ) {\n\t\t\t\t\t$el[ op ]( touch[ type ], fn );\n\t\t\t\t}\n\t\t\t\t$el[ op ]( type, fn );\n\n\t\t\t}\n\t\t}\n\n\t\tfunction never() {\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction always() {\n\t\t\treturn true;\n\t\t}\n\n\t\t// make array from array-like objects or from single element (based on bevacqua/atoa)\n\t\tfunction makeArray( all, startIndex ) {\n\t\t\tif ( _isArray( all ) ) {\n\t\t\t\treturn all;\n\t\t\t}\n\t\t\tif ( all.length ) { // is array-like\n\t\t\t\treturn Array.prototype.slice.call( all, startIndex ); // convert to vanilla js array\n\t\t\t} else { // is one element\n\t\t\t\treturn [ all ];\n\t\t\t}\n\t\t}\n\n\t\tfunction whichMouseButton( e ) {\n\t\t\tif ( e.touches ) {\n\t\t\t\treturn e.touches.length;\n\t\t\t}\n\t\t\tif ( e.originalEvent && e.originalEvent.touches ) {\n\t\t\t\treturn e.originalEvent.touches.length;\n\t\t\t}\n\t\t\tif ( e.which !== void 0 && e.which !== 0 ) {\n\t\t\t\treturn e.which;\n\t\t\t} // github.com/bevacqua/dragula/issues/261\n\t\t\tif ( e.buttons !== undefined ) {\n\t\t\t\treturn e.buttons;\n\t\t\t}\n\t\t\tvar button = e.button;\n\t\t\tif ( button !== undefined ) { // see github.com/jquery/jquery/blob/99e8ff1baa7ae341e94bb89c3e84570c7c3ad9ea/src/event.js#L573-L575\n\t\t\t\treturn button & 1 ? 1 : button & 2 ? 3 : (button & 4 ? 2 : 0);\n\t\t\t}\n\t\t}\n\n\t\tfunction preventGrabbed( e ) {\n\t\t\tif ( e.originalEvent ) {\n\t\t\t\te = e.originalEvent; // jQuery enviroment\n\t\t\t}\n\t\t\tif ( shared.grabbed ) {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t}\n\n\t\tfunction getScroll( scrollProp, offsetProp ) {\n\t\t\tif ( typeof window[ offsetProp ] !== 'undefined' ) {\n\t\t\t\treturn window[ offsetProp ];\n\t\t\t}\n\t\t\tif ( _docElm.clientHeight ) {\n\t\t\t\treturn _docElm[ scrollProp ];\n\t\t\t}\n\t\t\treturn _doc.body[ scrollProp ];\n\t\t}\n\n\t\tfunction getOffset( el ) { // watch performance!! - function is running each mousemove!\n\t\t\tvar rect = el.getBoundingClientRect(),\n\t\t\t\tscrollTop = getScroll( 'scrollTop', 'pageYOffset' ),\n\t\t\t\tscrollLeft = getScroll( 'scrollLeft', 'pageXOffset' );\n\t\t\treturn {\n\t\t\t\tleft: rect.left + scrollLeft,\n\t\t\t\tright: rect.right + scrollLeft,\n\t\t\t\ttop: rect.top + scrollTop,\n\t\t\t\tbottom: rect.bottom + scrollTop\n\t\t\t};\n\t\t}\n\n\t\tfunction getRectWidth( rect ) {\n\t\t\treturn rect.width || (rect.right - rect.left);\n\t\t}\n\n\t\tfunction getRectHeight( rect ) {\n\t\t\treturn rect.height || (rect.bottom - rect.top);\n\t\t}\n\n\t\tfunction getEmptyArray() {\n\t\t\treturn [];\n\t\t}\n\n\t\tfunction nextEl( el ) {\n\t\t\tif ( !el ) { // https://github.com/luckylooke/dragular/issues/102\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treturn el.nextElementSibling || manually();\n\n\t\t\tfunction manually() {\n\t\t\t\tvar sibling = el;\n\t\t\t\tdo {\n\t\t\t\t\tsibling = sibling.nextSibling;\n\t\t\t\t} while ( sibling && sibling.nodeType !== 1 );\n\t\t\t\treturn sibling;\n\t\t\t}\n\t\t}\n\n\t\t//Cannot use angular.isElement because we need to check plain dom element, no jQlite wrapped\n\t\tfunction isElement( obj ) {\n\t\t\treturn (\n\t\t\t\ttypeof HTMLElement === 'object' ? obj instanceof HTMLElement : //DOM2\n\t\t\t\t\tobj && typeof obj === 'object' && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === 'string'\n\t\t\t);\n\t\t}\n\n\t\tfunction lookupClass( className ) {\n\t\t\tvar cached = shared.classesCache[ className ];\n\t\t\tif ( cached ) {\n\t\t\t\tcached.lastIndex = 0;\n\t\t\t} else {\n\t\t\t\tshared.classesCache[ className ] = cached = new RegExp( '(?:^|\\\\s)' + className + '(?:\\\\s|$)', 'g' );\n\t\t\t}\n\t\t\treturn cached;\n\t\t}\n\n\t\tfunction addClass( el, className ) {\n\t\t\tvar current = el.className;\n\t\t\tif ( !current.length ) {\n\t\t\t\tel.className = className;\n\t\t\t} else if ( !lookupClass( className ).test( current ) ) {\n\t\t\t\tel.className += ' ' + className;\n\t\t\t}\n\t\t}\n\n\t\tfunction rmClass( el, className ) {\n\t\t\tel.className = el.className.replace( lookupClass( className ), ' ' ).trim();\n\t\t}\n\n\t\tfunction getEventHost( e ) {\n\t\t\t// on touchend event, we have to use `e.changedTouches`\n\t\t\t// see http://stackoverflow.com/questions/7192563/touchend-event-properties\n\t\t\t// see https://github.com/bevacqua/dragula/issues/34\n\t\t\tif ( e.targetTouches && e.targetTouches.length ) {\n\t\t\t\treturn e.targetTouches[ 0 ];\n\t\t\t}\n\t\t\tif ( e.changedTouches && e.changedTouches.length ) {\n\t\t\t\treturn e.changedTouches[ 0 ];\n\t\t\t}\n\t\t\treturn e;\n\t\t}\n\n\t\tfunction getCoord( coord, e ) { // watch performance - running each move several times!\n\t\t\tvar host = getEventHost( e );\n\t\t\tvar missMap = {\n\t\t\t\tpageX: 'clientX', // IE8\n\t\t\t\tpageY: 'clientY' // IE8\n\t\t\t};\n\t\t\tif ( coord in missMap && !(coord in host) && missMap[ coord ] in host ) {\n\t\t\t\tcoord = missMap[ coord ];\n\t\t\t}\n\n\t\t\t// Adding support for touch events, as they are not functional in the original\n\t\t\tif ( !host.type || host.type.indexOf( 'touch' ) < 0 ) {\n\t\t\t\treturn host[ coord ];\n\t\t\t} else {\n\t\t\t\tif ( host.type.indexOf( 'end' ) === -1 ) {\n\t\t\t\t\t// No clientX or clientY in a touch event\n\t\t\t\t\treturn host.originalEvent.touches[ 0 ][ coord.replace( 'client', 'page' ) ];\n\t\t\t\t}\n\t\t\t\t// Nothing should happen for touchend\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfunction getParent( el ) { // watch performance!! - function is running each mousemove!\n\t\t\treturn el.parentNode === document ? null : el.parentNode;\n\t\t}\n\n\t\tfunction isInput( el ) {\n\t\t\treturn el.tagName === 'INPUT' || el.tagName === 'TEXTAREA' || el.tagName === 'SELECT' || isEditable( el );\n\t\t}\n\n\t\tfunction isEditable( el ) {\n\t\t\tif ( !el ) {\n\t\t\t\treturn false;\n\t\t\t} // no parents were editable\n\t\t\tif ( el.contentEditable === 'false' ) {\n\t\t\t\treturn false;\n\t\t\t} // stop the lookup\n\t\t\tif ( el.contentEditable === 'true' ) {\n\t\t\t\treturn true;\n\t\t\t} // found a contentEditable element in the chain\n\t\t\treturn isEditable( getParent( el ) ); // contentEditable is set to 'inherit'\n\t\t}\n\n\t\tfunction domIndexOf( child, parent ) {\n\t\t\treturn Array.prototype.indexOf.call( angular.element( parent ).children(), child );\n\t\t}\n\n\t\tfunction fireEvent( target, e, extra ) { // watch performance!! - function is running each mousemove!\n\t\t\tif ( !target ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tshared.extra = extra;\n\t\t\tif ( target.dispatchEvent ) {\n\t\t\t\ttarget.dispatchEvent( e );\n\t\t\t} else {\n\t\t\t\ttarget.fireEvent( 'on' + e.eventType, e );\n\t\t\t}\n\t\t}\n\n\t\tfunction getBool( prop, args, context ) {\n\t\t\tif ( _isFunction( prop ) ) {\n\t\t\t\treturn !!prop.apply( context || this, args || shared );\n\t\t\t} else {\n\t\t\t\treturn !!prop;\n\t\t\t}\n\t\t}\n\n\t};\n\n\tdragularService.$inject = [ '$rootScope', '$compile' ];\n\n\tmodule.exports = dragularService;\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar examplesRouter = function ($stateProvider, $urlRouterProvider) {\n\t $urlRouterProvider.otherwise('/home');\n\n\t var timer,\n\t ctrl = function routerCtrl($state, $stateParams, $timeout) {\n\t // go to install notes by default\n\t if (!$stateParams.link) {\n\t timer = $timeout(function timer() {\n\t $state.go('docs.detail', {\n\t link: 'docsInstall'\n\t });\n\t },0);\n\t }else{\n\t $timeout.cancel(timer);\n\t }\n\t };\n\n\t ctrl.$inject = ['$state', '$stateParams', '$timeout'];\n\n\t $stateProvider\n\t .state('home', {\n\t url: '/home',\n\t templateUrl: 'partials/partial-home.html'\n\t })\n\t .state('docs', {\n\t url: '/docs',\n\t templateUrl: 'partials/partial-docs.html',\n\t controller: ctrl\n\t })\n\t .state('docs.detail', {\n\t url: '/:link',\n\t templateUrl: function($stateParams) {\n\t return $stateParams.link + '/' + $stateParams.link + '.html';\n\t },\n\t controller: ctrl\n\t })\n\t .state('contribute', {\n\t url: '/contribute',\n\t templateUrl: 'partials/partial-contribute.html'\n\t });\n\t};\n\n\texamplesRouter.$inject = ['$stateProvider', '$urlRouterProvider'];\n\n\tmodule.exports = examplesRouter;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar BasicCtrl = function ($element, dragularService) {\n\t dragularService.cleanEnviroment();\n\t dragularService('.containerVertical');\n\t};\n\n\tBasicCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = BasicCtrl;\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\tvar BasicModelCtrl = function ($scope, $element, dragularService) {\n\t $scope.items1 = [{\n\t content: 'Move me, but you can only drop me in one of these containers.'\n\t }, {\n\t content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n\t }, {\n\t content: 'Item 3'\n\t }, {\n\t content: 'Item 4'\n\t }];\n\t $scope.items2 = [{\n\t content: 'Item 5'\n\t }, {\n\t content: 'Item 6'\n\t }, {\n\t content: 'Item 7'\n\t }, {\n\t content: 'Item 8'\n\t }];\n\t var containers = $element.children().eq(0).children();\n\t dragularService.cleanEnviroment();\n\t // var drake = dragularService([containers[0],containers[1]],{\n\t // dragularService([containers[0]],{\n\t dragularService([containers[0], containers[1]],{\n\t containersModel: [$scope.items1, $scope.items2],\n\t // canBeAccepted: function () {\n\t // return false;\n\t // },\n\t // accepts: function () {\n\t // return false;\n\t // },\n\t // isContainer: function (el) {\n\t // return el.id == 'test';\n\t // },\n\t // isContainerModel: function () {\n\t // return $scope.items2;\n\t // }\n\t // scope: $scope\n\t });\n\n\t\t// $scope.$on('dragularcloned', myFn('cloned'));\n\t\t// $scope.$on('dragulardrag', myFn('drag'));\n\t\t// $scope.$on('dragularcancel', myFn('cancel'));\n\t\t// $scope.$on('dragulardrop', myFn('drop'));\n\t\t// $scope.$on('dragularremove', myFn('remove'));\n\t\t// $scope.$on('dragulardragend', myFn('dragend'));\n\t\t// $scope.$on('dragularshadow', myFn('shadow'));\n\t\t//\n\t\t// function myFn(eventName) {\n\t\t// \treturn function() {\n\t\t// \t\tconsole.log(eventName, arguments, drake);\n\t\t// \t};\n\t\t// }\n\n\t};\n\n\tBasicModelCtrl.$inject = ['$scope', '$element', 'dragularService'];\n\n\tmodule.exports = BasicModelCtrl;\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar BoundingBoxCtrl = function ($element, dragularService) {\n\t var boundingBox = $element[0];\n\t dragularService.cleanEnviroment();\n\n\t dragularService($element.children(), {\n\t boundingBox: boundingBox\n\t });\n\t};\n\n\tBoundingBoxCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = BoundingBoxCtrl;\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar BoundingBoxLockXCtrl = function ($element, dragularService) {\n\t var boundingBox = $element.children().children()[0];\n\t dragularService.cleanEnviroment();\n\t dragularService(boundingBox, {\n\t boundingBox: boundingBox,\n\t lockX: true\n\t });\n\t};\n\n\tBoundingBoxLockXCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = BoundingBoxLockXCtrl;\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar BoundingBoxLockYCtrl = function ($element, dragularService) {\n\t var boundingBox = $element.children().children()[0];\n\t dragularService.cleanEnviroment();\n\t dragularService(boundingBox, {\n\t boundingBox: boundingBox,\n\t lockY: true\n\t });\n\t};\n\n\tBoundingBoxLockYCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = BoundingBoxLockYCtrl;\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar CopyCtrl = function ($element, dragularService) {\n\t dragularService.cleanEnviroment();\n\t dragularService($element.children(), {\n\t copy: true\n\t });\n\t};\n\n\tCopyCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = CopyCtrl;\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar CopyModelCtrl = function ($scope, $element, dragularService) {\n\t $scope.items1 = [{\n\t content: 'Move me, and make copy on drop.'\n\t }, {\n\t content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n\t }, {\n\t content: 'Item 3'\n\t }, {\n\t content: 'Item 4'\n\t }];\n\t $scope.items2 = [{\n\t content: 'Item 5'\n\t }, {\n\t content: 'Item 6'\n\t }, {\n\t content: 'Item 7'\n\t }, {\n\t content: 'Item 8'\n\t }];\n\t var containers = $element.children().eq(0).children();\n\t dragularService.cleanEnviroment();\n\t dragularService([containers[0],containers[1]],{\n\t containersModel: [$scope.items1, $scope.items2],\n\t copy: true\n\t });\n\t};\n\n\tCopyModelCtrl.$inject = ['$scope', '$element', 'dragularService'];\n\n\tmodule.exports = CopyModelCtrl;\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar CustomClassesCtrl = function ($element, dragularService) {\n\t dragularService.cleanEnviroment();\n\t dragularService($element.children(), {\n\t classes: {\n\t mirror: 'custom-green-mirror'\n\t }\n\t });\n\t};\n\n\tCustomClassesCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = CustomClassesCtrl;\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar DifferentOptionsModelCtrl = function ($scope, $element, dragularService) {\n\t $scope.items1 = [{\n\t content: 'Move me, but you can only drop me in one of these containers.'\n\t }, {\n\t content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n\t }, {\n\t content: 'Item 3'\n\t }, {\n\t content: 'Item 4'\n\t }];\n\t $scope.items2 = [{\n\t content: 'Item 5'\n\t }, {\n\t content: 'Item 6'\n\t }, {\n\t content: 'Item 7'\n\t }, {\n\t content: 'Item 8'\n\t }];\n\n\t var containerLeft = document.querySelector('#containerLeft'),\n\t containerRight = document.querySelector('#containerRight');\n\n\t function accepts(el, target, source) {\n\t // left->right || in same container\n\t if (source === containerLeft || source === target) {\n\t return true;\n\t }\n\t }\n\n\t dragularService.cleanEnviroment();\n\t dragularService([containerLeft], {\n\t containersModel: [$scope.items1],\n\t copy: true,\n\t copySortSource: true,\n\t //move only from left to right\n\t accepts: accepts\n\t });\n\n\t dragularService([containerRight], {\n\t containersModel: [$scope.items2],\n\t removeOnSpill: true,\n\t //move only from left to right\n\t accepts: accepts\n\t });\n\n\t};\n\n\tDifferentOptionsModelCtrl.$inject = ['$scope', '$element', 'dragularService'];\n\n\tmodule.exports = DifferentOptionsModelCtrl;\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar DirectiveCtrl = function ($scope) {\n\t $scope.dragularOptions = {\n\t classes: {\n\t mirror: 'custom-green-mirror'\n\t },\n\t nameSpace: 'same' // just connecting left and right container\n\t };\n\t};\n\n\tDirectiveCtrl.$inject = ['$scope'];\n\n\tmodule.exports = DirectiveCtrl;\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar DirectiveModelCtrl = function ($scope) {\n\t $scope.items1 = [{\n\t content: 'Move me, and make copy on drop.'\n\t }, {\n\t content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n\t }, {\n\t content: 'Item 3'\n\t }, {\n\t content: 'Item 4'\n\t }];\n\t $scope.items2 = [{\n\t content: 'Item 5'\n\t }, {\n\t content: 'Item 6'\n\t }, {\n\t content: 'Item 7'\n\t }, {\n\t content: 'Item 8'\n\t }];\n\t $scope.dragularOptions = {\n\t containersModel: $scope.items1,\n\t classes: {\n\t mirror: 'custom-green-mirror'\n\t },\n\t nameSpace: 'common' // just connecting left and right container\n\t };\n\t};\n\n\tDirectiveModelCtrl.$inject = ['$scope'];\n\n\tmodule.exports = DirectiveModelCtrl;\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports) {\n\n\t/* global angular */\n\t'use strict';\n\n\tvar DragOverEventsCtrl = function ($element, dragularService) {\n\t dragularService.cleanEnviroment();\n\t dragularService([$element.children()[0], $element.children()[2]], {\n\t nameSpace: 'apples'\n\t });\n\t dragularService([$element.children()[1], $element.children()[3]], {\n\t nameSpace: 'oranges'\n\t });\n\n\t // containers events handling\n\t function registerEvents(el) {\n\t el.on('dragularenter', function(e) {\n\t if (el[0] === e.target) { // filter bubbled\n\t el.addClass(dragularService.shared.extra ? 'gu-over-accept' : 'gu-over-decline');\n\t }\n\t });\n\t el.on('dragularleave dragularrelease', function(e) {\n\t if ((el[0] === e.target && // filter bubbled\n\t dragularService.shared.extra && // extra on dragleave contains element the drag is leaving to\n\t dragularService.shared.extra.parentElement !== e.target) || // is that element child of this container?\n\t e.type === 'dragularrelease') {\n\t el.removeClass('gu-over-accept');\n\t el.removeClass('gu-over-decline');\n\t }\n\t });\n\t }\n\n\t angular.forEach($element.children(), function forEachChild(el) {\n\t registerEvents(angular.element(el));\n\t });\n\n\t // notContainer events handling\n\t var notContainer = angular.element(document.getElementsByClassName('notContainer'));\n\t notContainer.on('dragularenter', function() {\n\t notContainer.addClass('gu-over');\n\t });\n\t notContainer.on('dragularleave dragularrelease', function() {\n\t notContainer.removeClass('gu-over');\n\t });\n\t};\n\n\tDragOverEventsCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = DragOverEventsCtrl;\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar EventsCtrl = function ($scope, $element, dragularService, $timeout) {\n\t dragularService.cleanEnviroment();\n\t \n\t var drake = dragularService($element.children(), {\n\t scope: $scope\n\t });\n\t $scope.$on('dragulardrag', function(e, el) {\n\t e.stopPropagation();\n\t el.className = el.className.replace(' ex-moved', '');\n\t });\n\t $scope.$on('dragulardrop', function(e, el) {\n\t e.stopPropagation();\n\t $timeout(function() {\n\t el.className += ' ex-moved';\n\t }, 0);\n\t });\n\n\t $scope.$on('dragularcloned', myFn('cloned in EventsCtrl'));\n\t $scope.$on('dragulardrag', myFn('drag in EventsCtrl'));\n\t $scope.$on('dragularcancel', myFn('cancel in EventsCtrl'));\n\t $scope.$on('dragulardrop', myFn('drop in EventsCtrl'));\n\t $scope.$on('dragularremove', myFn('remove in EventsCtrl'));\n\t $scope.$on('dragulardragend', myFn('dragend in EventsCtrl'));\n\t $scope.$on('dragularshadow', myFn('shadow in EventsCtrl'));\n\n\t function myFn(eventName) {\n\t return function() {\n\t console.log(eventName, arguments, drake);\n\t };\n\t }\n\t};\n\n\tvar Events2Ctrl = function ($scope, $element, dragularService, $timeout) {\n\t var drake = dragularService($element.children(), {\n\t scope: $scope\n\t });\n\t $scope.$on('dragulardrag', function(e, el) {\n\t e.stopPropagation();\n\t el.className = el.className.replace(' ex-moved', '');\n\t });\n\t $scope.$on('dragulardrop', function(e, el) {\n\t e.stopPropagation();\n\t $timeout(function() {\n\t el.className += ' ex-moved';\n\t }, 0);\n\t });\n\n\t $scope.$on('dragularcloned', myFn('cloned in Events2Ctrl'));\n\t $scope.$on('dragulardrag', myFn('drag in Events2Ctrl'));\n\t $scope.$on('dragularcancel', myFn('cancel in Events2Ctrl'));\n\t $scope.$on('dragulardrop', myFn('drop in Events2Ctrl'));\n\t $scope.$on('dragularremove', myFn('remove in Events2Ctrl'));\n\t $scope.$on('dragulardragend', myFn('dragend in Events2Ctrl'));\n\t $scope.$on('dragularshadow', myFn('shadow in Events2Ctrl'));\n\n\t function myFn(eventName) {\n\t return function() {\n\t console.log(eventName, arguments, drake);\n\t };\n\t }\n\t};\n\n\tEventsCtrl.$inject = ['$scope', '$element', 'dragularService', '$timeout'];\n\tEvents2Ctrl.$inject = ['$scope', '$element', 'dragularService', '$timeout'];\n\n\tmodule.exports = [EventsCtrl, Events2Ctrl];\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar HandleCtrl = function ($element, dragularService) {\n\t dragularService.cleanEnviroment();\n\t\tdragularService($element.children(), {\n\t moves: function(el, container, handle) {\n\t return handle.classList.contains('handle');\n\t }\n\t });\n\t};\n\n\tHandleCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = HandleCtrl;\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar IsContainerModelCtrl = function ($scope, $element, dragularService) {\n\t $scope.items1 = [{\n\t content: 'Move me, but you can only drop me in one of these containers.'\n\t }, {\n\t content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n\t }, {\n\t content: 'Item 3'\n\t }, {\n\t content: 'Item 4'\n\t }];\n\t $scope.cartModel = [];\n\n\t var containerLeft = document.querySelector('#containerLeft');\n\n\t dragularService.cleanEnviroment();\n\t dragularService([containerLeft], {\n\t containersModel: [$scope.items1],\n\t copy: true,\n\t isContainer: function isContainer (el) {\n\t return el.id === 'cart';\n\t },\n\t isContainerModel: function getModel (){\n\t return $scope.cartModel;\n\t }\n\t });\n\n\t $scope.removeItem = function removeItem() {\n\t var index = $scope.cartModel.indexOf(this.item);\n\t $scope.cartModel.splice(index, 1);\n\t };\n\t};\n\n\tIsContainerModelCtrl.$inject = ['$scope', '$element', 'dragularService'];\n\n\tmodule.exports = IsContainerModelCtrl;\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar NameSpacesCtrl = function ($element, dragularService) {\n\t dragularService.cleanEnviroment();\n\t dragularService([$element.children()[0], $element.children()[2]], {\n\t nameSpace: 'apples'\n\t });\n\t dragularService($element.children()[1], {\n\t nameSpace: 'oranges'\n\t });\n\t dragularService($element.children()[3], { // mixed\n\t nameSpace: ['oranges', 'apples']\n\t });\n\t};\n\n\tNameSpacesCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = NameSpacesCtrl;\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar NestedNgRepeatCtrl = function ($timeout, $scope, $element, dragularService) {\n\t $timeout(function() { // timeount due to ngRepeat to be ready\n\t dragularService.cleanEnviroment();\n\t dragularService($element, {\n\t nameSpace: 'rows',\n\t moves: function rowOnly (el, container, handle) {\n\t return handle.classList.contains('row-handle');\n\t }\n\t });\n\n\t dragularService($element.children(), {\n\t nameSpace: 'cells',\n\t moves: function excludeHandle (el, container, handle) {\n\t return !handle.classList.contains('row-handle');\n\t }\n\t });\n\t }, 0);\n\t $scope.items = [{\n\t items: [{\n\t content: 'Item a1'\n\t }, {\n\t content: 'Item a2'\n\t }, {\n\t content: 'Item a3'\n\t }, {\n\t content: 'Item a4'\n\t }]\n\t }, {\n\t items: [{\n\t content: 'Item b1'\n\t }, {\n\t content: 'Item b2'\n\t }, {\n\t content: 'Item b3'\n\t }, {\n\t content: 'Item b4'\n\t }]\n\t }, {\n\t items: [{\n\t content: 'Item c1'\n\t }, {\n\t content: 'Item c2'\n\t }, {\n\t content: 'Item c3'\n\t }, {\n\t content: 'Item c4'\n\t }]\n\t }];\n\t};\n\n\tNestedNgRepeatCtrl.$inject = ['$timeout', '$scope', '$element', 'dragularService'];\n\n\tmodule.exports = NestedNgRepeatCtrl;\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar NestedNgRepeatWithModelCtrl = function ($timeout, $scope, $element, dragularService) {\n\t $timeout(function() { // timeount due to nested ngRepeat to be ready\n\t var container = $element.children().eq(0).children(),\n\t parentContainers = container.children(),\n\t nestedContainers = [];\n\n\t dragularService.cleanEnviroment();\n\t dragularService(container, {\n\t moves: function(el, container, handle) {\n\t return handle.classList.contains('row-handle');\n\t },\n\t containersModel: $scope.items,\n\t nameSpace: 'rows'\n\t });\n\n\t // collect nested contianers\n\t for (var i = 0; i < parentContainers.length; i++) {\n\t nestedContainers.push(parentContainers.eq(i).children()[1]);\n\t }\n\n\t dragularService(nestedContainers, {\n\t moves: function(el, container, handle) {\n\t return !handle.classList.contains('row-handle');\n\t },\n\t containersModel: (function getNestedContainersModel(){\n\t var parent = $scope.items,\n\t containersModel = [];\n\t for (var i = 0; i < parent.length; i++) {\n\t containersModel.push(parent[i].items);\n\t }\n\t return containersModel;\n\t })(),\n\t nameSpace: 'cells'\n\t });\n\t }, 0);\n\t $scope.items = [{\n\t items: [{\n\t content: 'Item a1'\n\t }, {\n\t content: 'Item a2'\n\t }, {\n\t content: 'Item a3'\n\t }, {\n\t content: 'Item a4'\n\t }]\n\t }, {\n\t items: [{\n\t content: 'Item b1'\n\t }, {\n\t content: 'Item b2'\n\t }, {\n\t content: 'Item b3'\n\t }, {\n\t content: 'Item b4'\n\t }]\n\t }, {\n\t items: [{\n\t content: 'Item c1'\n\t }, {\n\t content: 'Item c2'\n\t }, {\n\t content: 'Item c3'\n\t }, {\n\t content: 'Item c4'\n\t }]\n\t }];\n\t};\n\n\tNestedNgRepeatWithModelCtrl.$inject = ['$timeout', '$scope', '$element', 'dragularService'];\n\n\tmodule.exports = NestedNgRepeatWithModelCtrl;\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar NgRepeatCtrl = function ($scope, $element, dragularService) {\n\t dragularService.cleanEnviroment();\n\t dragularService($element.children());\n\t $scope.items = [{\n\t content: 'Try to add or remove some elements (click on +- buttons), you will see that it is not problem for dragular.'\n\t }, {\n\t content: 'Item 2'\n\t }, {\n\t content: 'Item 3'\n\t }, {\n\t content: 'Item 4'\n\t }];\n\t $scope.addItem = function addItem() {\n\t var index = $scope.items.indexOf(this.item) + 1;\n\t $scope.items.splice(index, 0, {\n\t content: this.item.content + '-copy'\n\t });\n\t };\n\t $scope.removeItem = function removeItem() {\n\t var index = $scope.items.indexOf(this.item);\n\t $scope.items.splice(index, 1);\n\t };\n\t};\n\n\tNgRepeatCtrl.$inject = ['$scope', '$element', 'dragularService'];\n\n\tmodule.exports = NgRepeatCtrl;\n\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar NgRepeatFilteredWithModelCtrl = function ($scope, $element, dragularService, $filter) {\n\t $scope.items1 = [{\n\t content: 'Move me, but you can only drop me in one of these containers.'\n\t }, {\n\t content: 'If you try to drop me somewhere other than these containers, I\\'ll just come back.'\n\t }, {\n\t content: 'Apple 3'\n\t }, {\n\t content: 'Orange 4'\n\t }, {\n\t content: 'Orange 5'\n\t }, {\n\t content: 'Apple 6'\n\t }, {\n\t content: 'Apple 7'\n\t }, {\n\t content: 'Apple 8'\n\t }];\n\t $scope.items2 = [{\n\t content: 'Apple 9'\n\t }, {\n\t content: 'Orange 10'\n\t }, {\n\t content: 'Orange 11'\n\t }, {\n\t content: 'Apple 12'\n\t }, {\n\t content: 'Orange 13'\n\t }, {\n\t content: 'Apple 14'\n\t }];\n\t $scope.filter1query = 'Orange';\n\t $scope.filter2query = 'Orange';\n\t $scope.filteredModel1 = [];\n\t $scope.filteredModel2 = [];\n\t $scope.getFilteredModel = function (filteredModel, items, filterQuery) {\n\t filteredModel.length = 0;\n\t /*\n\t * Following one-liner is same like:\n\t * var filteredModelTemp = $filter('filter')(items, filterQuery);\n\t * angular.forEach(filteredModelTemp, function(item){\n\t * filteredModel.push(item);\n\t * });\n\t * Or like:\n\t * var filteredModelTemp = $filter('filter')(items, filterQuery);\n\t * for(var i; i < filteredModelTemp.length; i++){\n\t * filteredModel.push(filteredModelTemp[i]);\n\t * }\n\t *\n\t * You cannot just assign filtered array to filteredModel like this:\n\t * filteredModel = $filter('filter')(items, filterQuery);\n\t * Because you would replace the array object you provide to dragular with new one.\n\t * So dragular will continue to use the one it was provided on init.\n\t * Hopefully I make it clear. :)\n\t */\n\t [].push.apply(filteredModel, $filter('filter')(items, filterQuery));\n\n\t // Example with orderBy filter:\n\t // var tmp = [];\n\t // [].push.apply(tmp, $filter('filter')(items, filterQuery));\n\t // [].push.apply(filteredModel, $filter('orderBy')(tmp, '+content'));\n\n\t return filteredModel;\n\t };\n\t var containers = $element.children().eq(1).children();\n\t dragularService.cleanEnviroment();\n\t dragularService([containers[0],containers[1]],{\n\t containersModel: [$scope.items1, $scope.items2],\n\t containersFilteredModel: [$scope.filteredModel1, $scope.filteredModel2]\n\t });\n\t};\n\n\tNgRepeatFilteredWithModelCtrl.$inject = ['$scope', '$element', 'dragularService', '$filter'];\n\n\tmodule.exports = NgRepeatFilteredWithModelCtrl;\n\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar NgRepeatWithModelCtrl = function ($scope, $element, dragularService) {\n\t $scope.items = [{\n\t content: 'Try to add or remove some elements (click on +- buttons), you will see that it is not problem for dragular.'\n\t }, {\n\t content: 'Item 2'\n\t }, {\n\t content: 'Item 3'\n\t }, {\n\t content: 'Item 4'\n\t }];\n\t dragularService.cleanEnviroment();\n\t dragularService($element.children().eq(0).children(), {containersModel: $scope.items});\n\t $scope.addItem = function addItem() {\n\t var index = $scope.items.indexOf(this.item) + 1;\n\t $scope.items.splice(index, 0, {\n\t content: this.item.content + '-copy'\n\t });\n\t };\n\t $scope.removeItem = function removeItem() {\n\t var index = $scope.items.indexOf(this.item);\n\t $scope.items.splice(index, 1);\n\t };\n\t};\n\n\tNgRepeatWithModelCtrl.$inject = ['$scope', '$element', 'dragularService'];\n\n\tmodule.exports = NgRepeatWithModelCtrl;\n\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar RemoveOnSpillCtrl = function ($element, dragularService) {\n\t dragularService.cleanEnviroment();\n\t\tdragularService($element.children(), {\n\t removeOnSpill: true\n\t });\n\t};\n\n\tRemoveOnSpillCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = RemoveOnSpillCtrl;\n\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar RemoveOnSpillWithModelCtrl = function ($scope, $element, dragularService) {\n\t $scope.items1 = [{\n\t content: 'Move me, but you can only drop me in containers.'\n\t }, {\n\t content: 'If you try to drop me somewhere other than containers, I\\'ll die a fiery death.'\n\t }, {\n\t content: 'Item 3'\n\t }, {\n\t content: 'Item 4'\n\t }];\n\t $scope.items2 = [{\n\t content: 'You can drop me in the left container.'\n\t }, {\n\t content: 'Item 6'\n\t }, {\n\t content: 'Item 7'\n\t }, {\n\t content: 'Item 8'\n\t }];\n\t var containers = $element.children().eq(0).children();\n\t dragularService.cleanEnviroment();\n\t dragularService([containers[0], containers[1]], {\n\t containersModel: [$scope.items1, $scope.items2],\n\t removeOnSpill: true\n\t });\n\t};\n\n\tRemoveOnSpillWithModelCtrl.$inject = ['$scope', '$element', 'dragularService'];\n\n\tmodule.exports = RemoveOnSpillWithModelCtrl;\n\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\n\tvar RevertOnSpillCtrl = function ($element, dragularService) {\n\t dragularService.cleanEnviroment();\n\t dragularService($element.children(), {\n\t revertOnSpill: true\n\t });\n\t};\n\n\tRevertOnSpillCtrl.$inject = ['$element', 'dragularService'];\n\n\tmodule.exports = RevertOnSpillCtrl;\n\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports) {\n\n\t/* global angular */\n\t'use strict';\n\n\tvar ScrollingDragCtrl = function ($interval, $element, dragularService) {\n\t var timer,\n\t leftScrollContainer = document.getElementById('leftScroll'),\n\t rightScrollContainer = document.getElementById('rightScroll'),\n\t leftTopBar = document.getElementById('leftTopBar'),\n\t leftBottomBar = document.getElementById('leftBottomBar'),\n\t rightTopBar = document.getElementById('rightTopBar'),\n\t rightBottomBar = document.getElementById('rightBottomBar');\n\n\t dragularService.cleanEnviroment();\n\t dragularService([leftScrollContainer, rightScrollContainer]);\n\n\t registerEvents(leftTopBar, leftScrollContainer, -5);\n\t registerEvents(leftBottomBar, leftScrollContainer, 5);\n\t registerEvents(rightTopBar, rightScrollContainer, -5);\n\t registerEvents(rightBottomBar, rightScrollContainer, 5);\n\n\t function registerEvents(bar, container, inc, speed) {\n\t if (!speed) {\n\t speed = 20;\n\t }\n\t angular.element(bar).on('dragularenter', function() {\n\t container.scrollTop += inc;\n\t timer = $interval(function moveScroll() {\n\t container.scrollTop += inc;\n\t }, speed);\n\t });\n\t angular.element(bar).on('dragularleave dragularrelease', function() {\n\t $interval.cancel(timer);\n\t });\n\t }\n\t};\n\n\tScrollingDragCtrl.$inject = ['$interval', '$element', 'dragularService'];\n\n\tmodule.exports = ScrollingDragCtrl;\n\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports) {\n\n\t/* global angular */\n\t'use strict';\n\n\tNestedRepeatsWithCustomDirective.$inject = ['dragularService', '$element', '$scope', '$timeout'];\n\n\tangular.module('examplesApp')\n\t\t.directive('questionDirective', QuestionsDirective)\n\t\t.controller('QuestionsController', QuestionsController);\n\n\tmodule.exports = NestedRepeatsWithCustomDirective;\n\n\n\n\tfunction NestedRepeatsWithCustomDirective( dragularService, $element, $scope, $timeout) {\n\n\t\tdragularService.cleanEnviroment();\n\n\t\t$scope.items = [\n\t\t\t{\n\t\t\t\tquestions:[\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text1',\n\t\t\t\t\t\tpoints: 1\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text2',\n\t\t\t\t\t\tpoints: 2\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text3',\n\t\t\t\t\t\tpoints: 3\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\torder: 1,\n\t\t\t\tname: 'x',\n\t\t\t\tage: '1'\n\t\t\t},\n\t\t\t{\n\t\t\t\tquestions:[\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text1',\n\t\t\t\t\t\tpoints: 1\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text2',\n\t\t\t\t\t\tpoints: 2\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text3',\n\t\t\t\t\t\tpoints: 3\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\torder: 2,\n\t\t\t\tname: 'y',\n\t\t\t\tage: '2'\n\t\t\t}, {\n\t\t\t\tquestions:[\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text1',\n\t\t\t\t\t\tpoints: 1\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text2',\n\t\t\t\t\t\tpoints: 2\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text3',\n\t\t\t\t\t\tpoints: 3\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\torder: 3,\n\t\t\t\tname: 'z',\n\t\t\t\tage: '3'\n\t\t\t},\n\t\t\t{\n\t\t\t\tquestions:[\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text1',\n\t\t\t\t\t\tpoints: 1\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text2',\n\t\t\t\t\t\tpoints: 2\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text3',\n\t\t\t\t\t\tpoints: 3\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\torder: 1,\n\t\t\t\tname: 'x',\n\t\t\t\tage: '4'\n\t\t\t}, {\n\t\t\t\tquestions:[\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text1',\n\t\t\t\t\t\tpoints: 1\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text2',\n\t\t\t\t\t\tpoints: 2\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text3',\n\t\t\t\t\t\tpoints: 3\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\torder: 2,\n\t\t\t\tname: 'y',\n\t\t\t\tage: '5'\n\t\t\t}, {\n\t\t\t\tquestions:[\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text1',\n\t\t\t\t\t\tpoints: 1\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text2',\n\t\t\t\t\t\tpoints: 2\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: 'text3',\n\t\t\t\t\t\tpoints: 3\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\torder: 3,\n\t\t\t\tname: 'z',\n\t\t\t\tage: '6'\n\t\t\t}];\n\n\t\t// timeout due to document not ready, jsfiddle settings issue?\n\t\t$timeout(function() {\n\n\t\t\tdragularService('#items', {\n\t\t\t\tcontainersModel: 'items',\n\t\t\t\tscope: $scope,\n\t\t\t\tmoves: function itemsOnly (el, container, handle) {\n\t\t\t\t\treturn handle.classList.contains('item');\n\t\t\t\t},\n\t\t\t\tnameSpace:'items'\n\t\t\t});\n\n\t\t\t$scope.$on('dragulardrop', function(){\n\t\t\t\t$scope.items.forEach(function(item, index){\n\t\t\t\t\titem.order = index + 1;\n\t\t\t\t});\n\t\t\t});\n\n\t\t});\n\n\t}\n\n\tfunction QuestionsDirective() {\n\t\treturn {\n\t\t\trestrict : 'E',\n\t\t\ttemplate : '
{{subitem.points}}. {{subitem.text}}
',\n\t\t\tcontroller : 'QuestionsController',\n\t\t\tscope : {\n\t\t\t\tquestion: '='\n\t\t\t}\n\t\t};\n\t}\n\n\tfunction QuestionsController($scope, dragularService, $element) {\n\n\t\tdragularService( $element.children('.all-data'), {\n\t\t\tcontainersModel: 'question',\n\t\t\tscope: $scope,\n\t\t\tnameSpace: 'subitem',\n\t\t\tmoves: function subItemsOnly (el, container, handle) {\n\t\t\t\treturn handle.classList.contains('subitem');\n\t\t\t}\n\t\t});\n\n\t\t$scope.$on('dragulardrop', function(){\n\t\t\t$scope.question.forEach(function(item, index){\n\t\t\t\titem.points = index + 1;\n\t\t\t});\n\t\t});\n\t}\n\n\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports) {\n\n\t'use strict'; module.exports = angular.module(\"templates\", []).run([\"$templateCache\", function($templateCache) {$templateCache.put(\"docsInstall/docsInstall.html\",\"

Install

\\n

download dragular.js and dragular.css from dist folder

\\n

OR clone git

\\n
\\ngit clone http://github.com/luckylooke/dragular.git\\n
\\n

OR use npm

\\n
\\n[sudo] npm install dragular\\n
\\n

OR use bower

\\n
\\nbower install dragular\\n
\\n

AND include files into your project

\\n
\\n<link href=\\'styles/dragular.css\\' rel=\\'stylesheet\\' type=\\'text/css\\' />\\n<script src=\\'scripts/dragular.js\\'></script>\\n
\\n

AND put dragularModule into dependency array

\\n
\\nvar app = angular.module(\\'myApp\\', [\\'dragularModule\\', \\'otherDependencies\\']);\\n
\\n

DONE :)

\\n\");\n\t$templateCache.put(\"exampleBasic/exampleBasic.html\",\"
\\n

Basic

\\n \\n
\\n
\\n
Move me, but you can only drop me in one of these containers.
\\n
If you try to drop me somewhere other than these containers, I\\'ll just come back.
\\n
Item 3.
\\n
Item 6.
\\n
\\n
\\n
You can drop me in the left container, otherwise I\\'ll stay here.
\\n
Try to click me, dragular distinguish drag from click
\\n
Item 5.
\\n
\\n
\\n
\\n        \\n// JS\\n  controller(\\'Basic\\', [\\'$element\\', \\'dragularService\\', function TodoCtrl($element, dragularService) {\\n    dragularService(\\'.containerVertical\\');\\n  }])\\n        \\n        \\n// CSS\\n.clickedClass {\\n  background-color: orange !important;\\n}\\n        \\n        \\n<!-- HTML -->\\n  <div class=\\'wrapper\\' ng-controller="Basic">\\n    <div class=\\'containerVertical\\'>\\n        <div>Move me, but you can only drop me in one of these containers.</div>\\n        <div>If you try to drop me somewhere other than these containers, I\\'ll just come back.</div>\\n        <div>Item 3.</div>\\n        <div>Item 6.</div>\\n    </div>\\n    <div class=\\'containerVertical\\'>\\n        <div>You can drop me in the left container, otherwise I\\'ll stay here.</div>\\n        <div ng-click=\\\"clicked = !clicked\\\" ng-class=\\\"clicked && \\'clickedClass\\'\\\">Try to click me, dragular distinguish drag from click</div>\\n        <div>Item 5.</div>\\n    </div>\\n</div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleBasicWithModel/exampleBasicWithModel.html\",\"
\\n

Basic - with model

\\n \\n
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
\\n
\\n
Items1:\\n          
{{items1 | json}}
\\n
\\n
\\n
Items2:\\n          
{{items2 | json}}
\\n
\\n
\\n
\\n
\\n        \\n// JS\\n  controller(\\'BasicModel\\', [\\'$scope\\', \\'$element\\', \\'dragularService\\', function TodoCtrl($scope, $element, dragularService) {\\n    $scope.items1 = [{\\n      content: \\'Move me, but you can only drop me in one of these containers.\\'\\n    }, {\\n      content: \\'If you try to drop me somewhere other than these containers, I\\\\\\'ll just come back.\\'\\n    }, {\\n      content: \\'Item 3\\'\\n    }, {\\n      content: \\'Item 4\\'\\n    }];\\n    $scope.items2 = [{\\n      content: \\'Item 5\\'\\n    }, {\\n      content: \\'Item 6\\'\\n    }, {\\n      content: \\'Item 7\\'\\n    }, {\\n      content: \\'Item 8\\'\\n    }];\\n    var containers = $element.children().children();\\n    dragularService([containers[0],containers[1]],{\\n      containersModel: [$scope.items1, $scope.items2]\\n    });\\n  }])\\n        \\n        \\n<!-- HTML -->\\n<div class=\\'wrapper\\' ng-controller="Basic">\\n    <div class=\\'tableRow\\'>\\n        <div class=\\'containerVertical\\'>\\n            <div ng-repeat="item in items1">{{item.content}}</div>\\n        </div>\\n        <div class=\\'containerVertical\\'>\\n            <div ng-repeat="item in items2">{{item.content}}</div>\\n        </div>\\n    </div>\\n    <div class="tableRow">\\n        <div class="container">\\n            <div>Items1:\\n                <br/>{{items1 | json}}</div>\\n        </div>\\n        <div class="container">\\n            <div>Items2:\\n                <br/>{{items2 | json}}</div>\\n        </div>\\n    </div>\\n</div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleBoundingBox/exampleBoundingBox.html\",\"
\\n

BoundingBox

\\n \\n
\\n
\\n
This items cannot cross its example element, just try it your selves.
\\n
Item 2.
\\n
Item 3.
\\n
Item 6.
\\n
\\n
\\n
This items cannot cross its example element, just try it your selves.
\\n
Item 4.
\\n
Item 5.
\\n
\\n
\\n
\\n        \\n  dragularService([$element.children(), {\\n    boundingBox: $element\\n  });\\n        \\n      
\\n
\");\n\t$templateCache.put(\"exampleBoundingBoxLockX/exampleBoundingBoxLockX.html\",\"
\\n

BoundingBox and lockX

\\n \\n
\\n
\\n
\\n
Items are locked in X axis movement and cannot cross its closest parent div.boundingBox, just try it your selves.
\\n
item 2
\\n
item 3
\\n
item 4
\\n
\\n
\\n
\\n
\\n        \\n  dragularService([$element.children()[0].children(), {\\n    boundingBox: $element.children()[0],\\n    lockX: true\\n  });\\n        \\n      
\\n
\");\n\t$templateCache.put(\"exampleBoundingBoxLockY/exampleBoundingBoxLockY.html\",\"
\\n

BoundingBox and LockY

\\n \\n
\\n
\\n
\\n
Items are locked in Y axis movement and cannot cross its closest parent div.boundingBox, just try it your selves.
\\n
item 2
\\n
item 3
\\n
item 4
\\n
item 5
\\n
item 6
\\n
\\n
\\n
\\n
\\n        \\n  dragularService([$element.children()[0].children(), {\\n    boundingBox: $element.children()[0],\\n    lockY: true\\n  });\\n        \\n      
\\n
\");\n\t$templateCache.put(\"exampleCopy/exampleCopy.html\",\"
\\n

Copy

\\n \\n
\\n
\\n
Move me, and make copy on drop.
\\n
If you try to drop me somewhere other than these containers, I\\'ll just come back.
\\n
\\n
\\n
You can drop me in the left container, otherwise I\\'ll stay here.
\\n
\\n
\\n
\\n        \\n// JS\\n  controller(\\'Copy\\', [\\'$element\\', \\'dragularService\\', function TodoCtrl($element, dragularService) {\\n    dragularService($element.children(), {\\n      copy: true\\n    });\\n  }])\\n        \\n        \\n<!-- HTML -->\\n<div class=\\'wrapper\\' ng-controller="Copy" ng-hide="globals.showModelExamples">\\n    <div id=\\'left2\\' class=\\'containerVertical\\'>\\n      <div>Move me, and make copy on drop.</div>\\n      <div>If you try to drop me somewhere other than these containers, I\\'ll just come back.</div>\\n    </div>\\n    <div id=\\'right2\\' class=\\'containerVertical\\'>\\n      <div>You can drop me in the left container, otherwise I\\'ll stay here.</div>\\n    </div>\\n  </div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleCopyWithModel/exampleCopyWithModel.html\",\"
\\n

Copy - with model

\\n \\n
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
\\n
\\n
Items1:\\n
\\n            {{ items1 | json }}\\n          
\\n
\\n
\\n
\\n
Items2:\\n
\\n            {{ items2 | json }}\\n          
\\n
\\n
\\n
\\n
\\n
\\n        \\n// JS\\n  controller(\\'CopyModel\\', [\\'$scope\\', \\'$element\\', \\'dragularService\\', function TodoCtrl($scope, $element, dragularService) {\\n    $scope.items1 = [{\\n      content: \\'Move me, and make copy on drop.\\'\\n    }, {\\n      content: \\'If you try to drop me somewhere other than these containers, I\\\\\\'ll just come back.\\'\\n    }, {\\n      content: \\'Item 3\\'\\n    }, {\\n      content: \\'Item 4\\'\\n    }];\\n    $scope.items2 = [{\\n      content: \\'Item 5\\'\\n    }, {\\n      content: \\'Item 6\\'\\n    }, {\\n      content: \\'Item 7\\'\\n    }, {\\n      content: \\'Item 8\\'\\n    }];\\n    var containers = $element.children().children();\\n    dragularService([containers[0],containers[1]],{\\n      containersModel: [$scope.items1, $scope.items2],\\n      copy: true\\n    });\\n  }])\\n        \\n        \\n<!-- HTML -->\\n<div class=\\'wrapper\\' ng-controller="CopyModel" ng-show="globals.showModelExamples">\\n    <div class=\\'tableRow\\'>\\n      <div class=\\'containerVertical\\'>\\n        <div ng-repeat="item in items1">{{item.content}}</div>\\n      </div>\\n      <div class=\\'containerVertical\\'>\\n        <div ng-repeat="item in items2">{{item.content}}</div>\\n      </div>\\n    </div>\\n    <div class="tableRow">\\n      <div class="container">\\n        <div>Items1:\\n          <br/>{{items1 | json}}</div>\\n      </div>\\n      <div class="container">\\n        <div>Items2:\\n          <br/>{{items2 | json}}</div>\\n      </div>\\n    </div>\\n  </div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleCustomClasses/exampleCustomClasses.html\",\"
\\n

Custom classes

\\n \\n
\\n
\\n
Move me, but you can only drop me in one of these containers.
\\n
If you try to drop me somewhere other than these containers, I\\'ll just come back.
\\n
Item 3.
\\n
Item 6.
\\n
\\n
\\n
You can drop me in the left container, otherwise I\\'ll stay here.
\\n
Item 4.
\\n
Item 5.
\\n
\\n
\\n
\\n        \\n  dragularService([document.getElementById(left), document.getElementById(right)], { classes: {\\n    mirror: \\'custom-green-mirror\\'\\n  } });\\n\\n  // Default classes are:\\n  option.classes = {\\n    mirror: \\'gu-mirror\\',\\n    hide: \\'gu-hide\\',\\n    unselectable: \\'gu-unselectable\\',\\n    transit: \\'gu-transit\\',\\n    overActive: \\'gu-over-active\\',\\n    overAccepts: \\'gu-over-accept\\',\\n    overDeclines: \\'gu-over-decline\\'\\n  };\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleDifferentOptionsWithModel/exampleDifferentOptionsWithModel.html\",\"
\\n

Different options - with model

\\n \\n
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
\\n
\\n
Items1:\\n          
{{items1 | json}}
\\n
\\n
\\n
Items2:\\n          
{{items2 | json}}
\\n
\\n
\\n
\\n
\\n        \\n// JS\\n  .controller(\\'DifferentOptionsModel\\', [\\'$scope\\', \\'$element\\', \\'dragularService\\', function TodoCtrl($scope, $element, dragularService) {\\n    $scope.items1 = [{\\n      content: \\'Move me, but you can only drop me in one of these containers.\\'\\n    }, {\\n      content: \\'If you try to drop me somewhere other than these containers, I\\\\\\'ll just come back.\\'\\n    }, {\\n      content: \\'Item 3\\'\\n    }, {\\n      content: \\'Item 4\\'\\n    }];\\n    $scope.items2 = [{\\n      content: \\'Item 5\\'\\n    }, {\\n      content: \\'Item 6\\'\\n    }, {\\n      content: \\'Item 7\\'\\n    }, {\\n      content: \\'Item 8\\'\\n    }];\\n\\n    var containerLeft = document.querySelector(\\'#containerLeft\\'),\\n      containerRight = document.querySelector(\\'#containerRight\\');\\n\\n    function accepts(el, target, source) {\\n      if (source === containerLeft || source === target) {\\n        return true;\\n      }\\n    }\\n\\n    dragularService([containerLeft], {\\n      containersModel: [$scope.items1],\\n      copy: true,\\n      //move only from left to right  \\n      accepts: accepts\\n    });\\n\\n    dragularService([containerRight], {\\n      containersModel: [$scope.items2],\\n      removeOnSpill: true,\\n      //move only from left to right  \\n      accepts: accepts\\n    });\\n\\n  }])\\n        \\n        \\n<!-- HTML -->\\n<div class=\\'wrapper\\' ng-controller="DifferentOptionsModel">\\n    <div class=\\'tableRow\\'>\\n      <div id="containerLeft" class=\\'containerVertical\\'>\\n        <div ng-repeat="item in items1">{{item.content}}</div>\\n      </div>\\n      <div id="containerRight" class=\\'containerVertical\\'>\\n        <div ng-repeat="item in items2">{{item.content}}</div>\\n      </div>\\n    </div>\\n    <div class="tableRow">\\n      <div class=\\'containerVertical\\'>\\n        <pre>Items1:\\n          <br/>{{items1 | json}}</pre>\\n      </div>\\n      <div class=\\'containerVertical\\'>\\n        <pre>Items2:\\n          <br/>{{items2 | json}}</pre>\\n      </div>\\n    </div>\\n  </div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleDirective/exampleDirective.html\",\"
\\n

Directive

\\n \\n
\\n
\\n
Move me, but you can only drop me in one of these containers.
\\n
If you try to drop me somewhere other than these containers, I\\'ll just come back.
\\n
Item 3.
\\n
Item 6.
\\n
\\n
\\n
You can drop me in the left container, otherwise I\\'ll stay here.
\\n
Item 4.
\\n
Item 5.
\\n
\\n
\\n
\\n        \\n// JS\\n  controller(\\'Directive\\', [\\'$scope\\', \\'dragularService\\', function TodoCtrl($scope) {\\n    $scope.dragularOptions = {\\n      classes: {\\n        mirror: \\'custom-green-mirror\\'\\n      },\\n      nameSpace: \\'common\\' // just connecting left and right container\\n    };\\n  }])\\n        \\n        \\n<!-- HTML -->\\n<div class=\\'wrapper\\' ng-controller="Directive">\\n    <div class=\\'containerVertical\\' dragular="dragularOptions">\\n      <div>Move me, but you can only drop me in one of these containers.</div>\\n      <div>If you try to drop me somewhere other than these containers, I\\'ll just come back.</div>\\n      <div>Item 3.</div>\\n      <div>Item 6.</div>\\n    </div>\\n    <div class=\\'containerVertical\\' dragular=\\'{"classes":{"mirror":"custom-green-mirror"},"nameSpace":"same"}\\'>\\n      <div>You can drop me in the left container, otherwise I\\'ll stay here.</div>\\n      <div>Item 4.</div>\\n      <div>Item 5.</div>\\n    </div>\\n  </div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleDirectiveWithModel/exampleDirectiveWithModel.html\",\"
\\n

Directive - with model

\\n \\n
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
\\n
\\n
Items1:\\n
{{items1 | json}}
\\n
\\n
\\n
Items2:\\n
{{items2 | json}}
\\n
\\n
\\n
\\n
\\n       \\n        \\n// JS\\n  controller(\\'DirectiveModel\\', [\\'$scope\\', function TodoCtrl($scope) {\\n    $scope.items1 = [{\\n      content: \\'Move me, and make copy on drop.\\'\\n    }, {\\n      content: \\'If you try to drop me somewhere other than these containers, I\\\\\\'ll just come back.\\'\\n    }, {\\n      content: \\'Item 3\\'\\n    }, {\\n      content: \\'Item 4\\'\\n    }];\\n    $scope.items2 = [{\\n      content: \\'Item 5\\'\\n    }, {\\n      content: \\'Item 6\\'\\n    }, {\\n      content: \\'Item 7\\'\\n    }, {\\n      content: \\'Item 8\\'\\n    }];\\n    $scope.dragularOptions = {\\n      containersModel: $scope.items1,\\n      classes: {\\n        mirror: \\'custom-green-mirror\\'\\n      },\\n      nameSpace: \\'common\\' // just connecting left and right container\\n    };\\n  }])\\n        \\n        \\n<!-- HTML -->\\n <div class=\\'wrapper\\' ng-controller="DirectiveModel">\\n  <div class=\\'containerVertical\\' dragular="dragularOptions">\\n    <div ng-repeat="item in items1">{{item.content}}</div>\\n  </div>\\n  <div class=\\'containerVertical\\' dragular=\\'{"containersModel":"items2","classes":{"mirror":"custom-green-mirror"},"nameSpace":"common"}\\'>\\n    <div ng-repeat="item in items2">{{item.content}}</div>\\n  </div>\\n</div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleDragOverEvents/exampleDragOverEvents.html\",\"
\\n

Drag-over events

\\n

You can interact with dragging element by litening to dragOver events. Usually you want to containers show wheather they accepts element or not, but you can use it anywhere. DragOver events are: dragenter, dragleave and dragrelease. On dragOver events dragularService reveals several useful properties.

\\n\\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
dragularService.shared.itemitem beeing dragged (it is copy of item if copy is enabled via options)
dragularService.shared.sourcesource container item is dragged from
dragularService.shared.sourceModelsource container model representation if model was porvided
dragularService.shared.initialIndexoriginal index of item, can be used to get item model from sourceModel
dragularService.shared.extracontains accepting information (boolean) on dragenter, element drag is leaving to on dragleave and element behind the cursor on dragrelease
\\n
\\n\\n

Try to drag over the not-container too.

\\n
\\n
\\n
apples and oranges cannot be mixed
\\n
apple 2
\\n
apple 3
\\n
apple 4
\\n
\\n
\\n
orange 1
\\n
orange 2
\\n
orange 3
\\n
orange 4
\\n
\\n
\\n
apple 5
\\n
apple 6
\\n
apple 7
\\n
apple 8
\\n
\\n
\\n
orange 5
\\n
orange 6
\\n
orange 7
\\n
orange 8
\\n
\\n
\\n
Test active class on NOT container.
\\n\\n
\\n    \\n<!-- HTML -->\\n  <div class=\\'wrapper\\' ng-controller="DragOverEvents">\\n    <div class=\\'container width25\\'>\\n      <div>apples and oranges cannot be mixed</div>\\n      <div>apple 2</div>\\n      ...\\n    </div>\\n    <div class=\\'container width25\\'>\\n      <div>orange 1</div>\\n      <div>orange 2</div>\\n      ...\\n    </div>\\n    <div class=\\'container width25\\'>\\n      <div>apple 5</div>\\n      <div>apple 6</div>\\n      ...\\n    </div>\\n    <div class=\\'container width25\\'>\\n      <div>orange 5</div>\\n      <div>orange 6</div>\\n      ...\\n    </div>\\n  </div>\\n  <div class="notContainer"> Test active class on NOT container.</div>\\n    \\n  
\\n\\n
\\n    \\n  // CSS\\n  \\n.notContainer.gu-over {\\n  background-color: yellow;\\n}\\n\\n.containerVertical.gu-over-accept {\\n  background-color: green;\\n}\\n\\n.containerVertical.gu-over-decline {\\n  background-color: red;\\n}\\n    \\n  
\\n\\n
\\n    \\n  // JS\\n  controller(\\'DragOverEvents\\', [\\'$element\\', \\'dragularService\\', function TodoCtrl($element, dragularService) {\\n    dragularService.cleanEnviroment();\\n    dragularService([$element.children()[0], $element.children()[2]], {\\n      nameSpace: \\'apples\\'\\n    });\\n    dragularService([$element.children()[1], $element.children()[3]], {\\n      nameSpace: \\'oranges\\'\\n    });\\n\\n    // containers events handling\\n    function registerEvents(el) {\\n      el.on(\\'dragularenter\\', function(e) {\\n        if (el[0] === e.target) { // filter bubbled\\n          el.addClass(dragularService.shared.extra ? \\'gu-over-accept\\' : \\'gu-over-decline\\');\\n        }\\n      });\\n      el.on(\\'dragularleave dragularrelease\\', function(e) {\\n        if ((el[0] === e.target && // filter bubbled\\n          dragularService.shared.extra && // extra on dragleave contains element the drag is leaving to\\n          dragularService.shared.extra.parentElement !== e.target) // is that element child of this container?\\n          || e.type === \\'dragularrelease\\') {\\n          el.removeClass(\\'gu-over-accept\\');\\n          el.removeClass(\\'gu-over-decline\\');\\n        }\\n      });\\n    }\\n\\n    angular.forEach($element.children(), function forEachChild(el) {\\n      registerEvents(angular.element(el));\\n    });\\n\\n    // notContainer events handling\\n    var notContainer = angular.element(document.getElementsByClassName(\\'notContainer\\'));\\n    notContainer.on(\\'dragularenter\\', function() {\\n      notContainer.addClass(\\'gu-over\\');\\n    });\\n    notContainer.on(\\'dragularleave dragularrelease\\', function() {\\n      notContainer.removeClass(\\'gu-over\\');\\n    });\\n  }])\\n    \\n  
\\n
\\n\");\n\t$templateCache.put(\"exampleEvents/exampleEvents.html\",\"
\\n

Events

\\n

Events affecting more than on cotrollers are emitted on both scopes if provided.

\\n

EventsCtrl

\\n
\\n
\\n
Move me, but you can only drop me in one of these containers.
\\n
If you try to drop me somewhere other than these containers, I\\'ll just come back.
\\n
Item 3.
\\n
Item 6.
\\n
\\n
\\n
You can drop me in the left container, otherwise I\\'ll stay here.
\\n
Item 4.
\\n
Item 5.
\\n
\\n
\\n
\\n

Events2Ctrl

\\n
\\n
\\n
Move me, but you can only drop me in one of these containers.
\\n
If you try to drop me somewhere other than these containers, I\\'ll just come back.
\\n
Item 3.
\\n
Item 6.
\\n
\\n
\\n
You can drop me in the left container, otherwise I\\'ll stay here.
\\n
Item 4.
\\n
Item 5.
\\n
\\n
\\n
\\n        \\nvar EventsCtrl = function ($scope, $element, dragularService, $timeout) {\\n  \\n  var drake = dragularService($element.children(), {\\n    scope: $scope\\n  });\\n  $scope.$on(\\'dragulardrag\\', function(e, el) {\\n    e.stopPropagation();\\n    el.className = el.className.replace(\\' ex-moved\\', \\'\\');\\n  });\\n  $scope.$on(\\'dragulardrop\\', function(e, el) {\\n    e.stopPropagation();\\n    $timeout(function() {\\n      el.className += \\' ex-moved\\';\\n    }, 0);\\n  });\\n\\n  $scope.$on(\\'dragularcloned\\', myFn(\\'cloned in EventsCtrl\\'));\\n  $scope.$on(\\'dragulardrag\\', myFn(\\'drag in EventsCtrl\\'));\\n  $scope.$on(\\'dragularcancel\\', myFn(\\'cancel in EventsCtrl\\'));\\n  $scope.$on(\\'dragulardrop\\', myFn(\\'drop in EventsCtrl\\'));\\n  $scope.$on(\\'dragularremove\\', myFn(\\'remove in EventsCtrl\\'));\\n  $scope.$on(\\'dragulardragend\\', myFn(\\'dragend in EventsCtrl\\'));\\n  $scope.$on(\\'dragularshadow\\', myFn(\\'shadow in EventsCtrl\\'));\\n\\n  function myFn(eventName) {\\n    return function() {\\n      console.log(eventName, arguments, drake);\\n    };\\n  }\\n};\\n\\nvar Events2Ctrl = function ($scope, $element, dragularService, $timeout) {\\n  var drake = dragularService($element.children(), {\\n    scope: $scope\\n  });\\n  $scope.$on(\\'dragulardrag\\', function(e, el) {\\n    e.stopPropagation();\\n    el.className = el.className.replace(\\' ex-moved\\', \\'\\');\\n  });\\n  $scope.$on(\\'dragulardrop\\', function(e, el) {\\n    e.stopPropagation();\\n    $timeout(function() {\\n      el.className += \\' ex-moved\\';\\n    }, 0);\\n  });\\n\\n  $scope.$on(\\'dragularcloned\\', myFn(\\'cloned in Events2Ctrl\\'));\\n  $scope.$on(\\'dragulardrag\\', myFn(\\'drag in Events2Ctrl\\'));\\n  $scope.$on(\\'dragularcancel\\', myFn(\\'cancel in Events2Ctrl\\'));\\n  $scope.$on(\\'dragulardrop\\', myFn(\\'drop in Events2Ctrl\\'));\\n  $scope.$on(\\'dragularremove\\', myFn(\\'remove in Events2Ctrl\\'));\\n  $scope.$on(\\'dragulardragend\\', myFn(\\'dragend in Events2Ctrl\\'));\\n  $scope.$on(\\'dragularshadow\\', myFn(\\'shadow in Events2Ctrl\\'));\\n\\n  function myFn(eventName) {\\n    return function() {\\n      console.log(eventName, arguments, drake);\\n    };\\n  }\\n};\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleHandle/exampleHandle.html\",\"
\\n

Handle

\\n \\n
\\n
\\n
+Move me, but you can use the plus sign to drag me around.
\\n
\\n
\\n
\\n
\\n
\\n        \\n  dragularService([document.getElementById(left), document.getElementById(right)], {\\n    moves: function (el, container, handle) {\\n      return handle.className === \\'handle\\';\\n    }\\n  });\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleIsContainerWithModel/exampleIsContainerWithModel.html\",\"
\\n

isContainer - with model

\\n \\n
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
{{item.content}}\\n
\\n
\\n
\\n
\\n
\\n
Items1:\\n          
{{items1 | json}}
\\n
\\n
\\n
Cart:\\n          
{{cartModel | json}}
\\n
\\n
\\n
\\n
\\n        \\n// JS\\n  .controller(\\'IsContainerModel\\', [\\'$scope\\', \\'$element\\', \\'dragularService\\', function TodoCtrl($scope, $element, dragularService) {\\n    $scope.items1 = [{\\n      content: \\'Move me, but you can only drop me in one of these containers.\\'\\n    }, {\\n      content: \\'If you try to drop me somewhere other than these containers, I\\\\\\'ll just come back.\\'\\n    }, {\\n      content: \\'Item 3\\'\\n    }, {\\n      content: \\'Item 4\\'\\n    }];\\n    $scope.cartModel = [];\\n\\n    var containerLeft = document.querySelector(\\'#containerLeft\\');\\n\\n    dragularService.cleanEnviroment();\\n    dragularService([containerLeft], {\\n      containersModel: [$scope.items1],\\n      copy: true,\\n      isContainer: function isContainer (el) {\\n        return el.id === \\'cart\\';\\n      },\\n      isContainerModel: function getModel (){\\n        return $scope.cartModel;\\n      }\\n    });\\n\\n    $scope.removeItem = function removeItem() {\\n      var index = $scope.cartModel.indexOf(this.item);\\n      $scope.cartModel.splice(index, 1);\\n    };\\n\\n  }])\\n        \\n        \\n<!-- HTML -->\\n <div class=\\'wrapper\\' ng-controller="IsContainerModel">\\n    <div class=\\'tableRow\\'>\\n      <div id="containerLeft" class=\\'containerVertical\\'>\\n        <div ng-repeat="item in items1">{{item.content}}</div>\\n      </div>\\n      <div id="cart" class=\\'containerVertical\\'>\\n        <div class=\\'cursorDefault\\' ng-repeat="item in cartModel">{{item.content}}\\n        <button class=\\'cursorDefault\\' ng-click="removeItem()">x</button></div>\\n      </div>\\n    </div>\\n    <div class="tableRow">\\n      <div class=\\'containerVertical\\'>\\n        <pre>Items1:\\n          <br/>{{items1 | json}}</pre>\\n      </div>\\n      <div class=\\'containerVertical\\'>\\n        <pre>Cart:\\n          <br/>{{cartModel | json}}</pre>\\n      </div>\\n    </div>\\n  </div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleNameSpaces/exampleNameSpaces.html\",\"
\\n

NameSpaces

\\n \\n
\\n
\\n
try to mix oranges and apples
\\n
apple 2
\\n
apple 3
\\n
apple 4
\\n
\\n
\\n
orange 1
\\n
orange 2
\\n
orange 3
\\n
orange 4
\\n
\\n
\\n
apple 5
\\n
apple 6
\\n
apple 7
\\n
apple 8
\\n
\\n
\\n
mixed 1
\\n
mixed 2
\\n
mixed 3
\\n
mixed 4
\\n
\\n
\\n
\\n      \\ndragularService([$element.children()[0], $element.children()[2]], {\\n  nameSpace: \\'apples\\'\\n});\\ndragularService($element.children()[1], {\\n  nameSpace: \\'oranges\\'\\n});\\ndragularService($element.children()[3], { // mixed\\n  nameSpace: [\\'oranges\\', \\'apples\\']\\n});\\n      \\n    
\\n
\");\n\t$templateCache.put(\"exampleNestedNgRepeat/exampleNestedNgRepeat.html\",\"
\\n

Nested ngRepeat

\\n \\n
\\n
\\n
Row {{$index}}
\\n
{{item.content}}
\\n
\\n
\\n
\\n        \\n  // HTML\\n\\n  <div ng-controller="Example15">\\n    <div ng-repeat="item in items" class=\\'exampleRow\\'>\\n      <div class="row-handle">Row {{$index}}</div>\\n      <div ng-repeat="item in item.items" class="exampleCell">{{item.content}}</div>\\n    </div>\\n  </div>\\n        \\n      
\\n
\\n        \\n  // CSS\\n\\n  .exampleRow {\\n    display: flex;\\n    flex-direction: row;\\n  }\\n\\n  .exampleCell {\\n    flex-grow: 1;\\n  }\\n\\n  .exampleRow,\\n  .exampleCell {\\n    margin: 10px;\\n    padding: 10px;\\n    background-color: rgba(0, 0, 0, 0.2);\\n    cursor: move;\\n    cursor: grab;\\n    cursor: -moz-grab;\\n    cursor: -webkit-grab;\\n  }\\n        \\n      
\\n
\\n        \\n  // JS\\n\\n  .controller(\\'NestedNgRepeat\\', [\\'$timeout\\', \\'$scope\\', \\'$element\\', \\'dragularService\\', function NestedNgRepeatCtrl($timeout, $scope, $element, dragularService) {\\n    $timeout(function() { // timeount due to ngRepeat to be ready\\n      dragularService($element, {\\n        nameSpace: \\'rows\\',\\n        moves: function rowOnly (el, container, handle) {\\n          return handle.classList.contains(\\'row-handle\\');\\n        }\\n      });\\n      dragularService($element.children(), {\\n        nameSpace: \\'cells\\',\\n        moves: function excludeHandle (el, container, handle) {\\n          return !handle.classList.contains(\\'row-handle\\');\\n        }\\n      });\\n    }, 0);\\n    $scope.items = [{\\n      items: [{\\n        content: \\'Item a1\\'\\n      }, {\\n        content: \\'Item a2\\'\\n      }, {\\n        content: \\'Item a3\\'\\n      }, {\\n        content: \\'Item a4\\'\\n      }]\\n    }, {\\n      items: [{\\n        content: \\'Item b1\\'\\n      }, {\\n        content: \\'Item b2\\'\\n      }, {\\n        content: \\'Item b3\\'\\n      }, {\\n        content: \\'Item b4\\'\\n      }]\\n    }, {\\n      items: [{\\n        content: \\'Item c1\\'\\n      }, {\\n        content: \\'Item c2\\'\\n      }, {\\n        content: \\'Item c3\\'\\n      }, {\\n        content: \\'Item c4\\'\\n      }]\\n    }];\\n  }])\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleNestedNgRepeatWithModel/exampleNestedNgRepeatWithModel.html\",\"
\\n

Nested ngRepeat - with model

\\n \\n
\\n
\\n
\\n
\\n
Row {{::$index}}
\\n
\\n
{{item.content}}
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n            
Items:\\n
{{items | json}}
\\n
\\n
\\n
\\n
\\n
\\n    \\n<!-- HTML -->\\n<div ng-controller="NestedNgRepeatWithModel">\\n  <div class=\\'containerVertical\\'>\\n    <div ng-repeat="item in items" class=\\'exampleRow\\'>\\n      <div class="row-handle">Row {{::$index}}</div>\\n      <div class="exampleRow exampleCell containerNested">\\n        <div ng-repeat="item in item.items" class="exampleCell">{{item.content}}</div>\\n      </div>\\n    </div>\\n  </div>\\n</div>\\n    \\n  
\\n
\\n    \\n  // CSS\\n\\n  .exampleRow {\\n    display: flex;\\n    flex-direction: row;\\n  }\\n\\n  .exampleCell {\\n    flex-grow: 1;\\n  }\\n\\n  .exampleRow,\\n  .exampleCell {\\n    margin: 10px;\\n    padding: 10px;\\n    background-color: rgba(0, 0, 0, 0.2);\\n    cursor: move;\\n    cursor: grab;\\n    cursor: -moz-grab;\\n    cursor: -webkit-grab;\\n  }\\n    \\n  
\\n
\\n    \\n  // JS\\n.controller(\\'NestedNgRepeatWithModel\\', [\\'$timeout\\', \\'$scope\\', \\'$element\\', \\'dragularService\\', function NestedNgRepeatWithModelCtrl($timeout, $scope, $element, dragularService) {\\n    $timeout(function() { // timeount due to nested ngRepeat to be ready\\n      var container = $element.children().eq(0).children(),\\n        parentContainers = container.children(),\\n        nestedContainers = [];\\n\\n      dragularService(container, {\\n        moves: function(el, container, handle) {\\n          return handle.classList.contains(\\'row-handle\\');\\n        },\\n        containersModel: $scope.items,\\n        nameSpace: \\'rows\\'\\n      });\\n\\n      // collect nested contianers\\n      for (var i = 0; i < parentContainers.length; i++) {\\n        nestedContainers.push(parentContainers.eq(i).children()[1]);\\n      }\\n\\n      dragularService(nestedContainers, {\\n        moves: function(el, container, handle) {\\n          return !handle.classList.contains(\\'row-handle\\');\\n        },\\n        containersModel: (function getNestedContainersModel(){\\n          var parent = $scope.items,\\n            containersModel = [];\\n          for (var i = 0; i < parent.length; i++) {\\n            containersModel.push(parent[i].items);\\n          }\\n          return containersModel;\\n        })(),\\n        nameSpace: \\'cells\\'\\n      });\\n    }, 0);\\n    $scope.items = [{\\n      items: [{\\n        content: \\'Item a1\\'\\n      }, {\\n        content: \\'Item a2\\'\\n      }, {\\n        content: \\'Item a3\\'\\n      }, {\\n        content: \\'Item a4\\'\\n      }]\\n    }, {\\n      items: [{\\n        content: \\'Item b1\\'\\n      }, {\\n        content: \\'Item b2\\'\\n      }, {\\n        content: \\'Item b3\\'\\n      }, {\\n        content: \\'Item b4\\'\\n      }]\\n    }, {\\n      items: [{\\n        content: \\'Item c1\\'\\n      }, {\\n        content: \\'Item c2\\'\\n      }, {\\n        content: \\'Item c3\\'\\n      }, {\\n        content: \\'Item c4\\'\\n      }]\\n    }];\\n  }])\\n    \\n  
\\n
\\n\");\n\t$templateCache.put(\"exampleNestedRepeatsWithCustomDirective/exampleNestedRepeatsWithCustomDirective.html\",\"
\\n
\\n
\\n {{item.order}}: ({{item.name}} + {{item.age}})\\n
\\n \\n \\n
\\n
\\n
\\n
\\n\");\n\t$templateCache.put(\"exampleNgRepeat/exampleNgRepeat.html\",\"
\\n

ngRepeat

\\n \\n
\\n
\\n
\\n {{item.content}}\\n
\\n
\\n
\\n
\\n        \\n  // HTML:\\n  <div class=\\'containerVertical\\'>\\n    <div ng-repeat="item in items">\\n      {{item.content}}\\n    </div>\\n  </div>\\n\\n  // JS:\\n  dragularService($element.children());\\n  $scope.items = [{\\n    content: \\'Try to add or remove some elements (click on +- buttons), you will see that it is not problem for dragular.\\'\\n  },{\\n    content: \\'Item 2\\'\\n  },{\\n    content: \\'Item 3\\'\\n  },{\\n    content: \\'Item 4\\'\\n  }];\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleNgRepeatWithModel/exampleNgRepeatWithModel.html\",\"
\\n

ngRepeat - with model

\\n \\n
\\n
\\n
\\n
\\n {{item.content}}\\n \\n \\n
\\n
\\n
\\n
\\n
\\n
Items:\\n
{{items | json}}
\\n
\\n
\\n
\\n
\\n    \\n  // HTML:\\n   <div class=\\'wrapper\\' ng-controller="NgRepeatWithModel">\\n      <div class=\\'containerVertical\\'>\\n        <div ng-repeat="item in items">\\n          {{item.content}}\\n          <button class=\\'cursorDefault\\' ng-click="addItem()">+</button>\\n          <button class=\\'cursorDefault\\' ng-click="removeItem()">x</button>\\n        </div>\\n    </div>\\n  </div>\\n    \\n  
\\n
\\n    \\n  // JS:\\n  controller(\\'NgRepeatWithModel\\', [\\'$scope\\', \\'$element\\', \\'dragularService\\', function TodoCtrl($scope, $element, dragularService) {\\n    $scope.items = [{\\n      content: \\'Try to add or remove some elements (click on +- buttons), you will see that it is not problem for dragular.\\'\\n    }, {\\n      content: \\'Item 2\\'\\n    }, {\\n      content: \\'Item 3\\'\\n    }, {\\n      content: \\'Item 4\\'\\n    }];\\n    dragularService($element.children().eq(0).children(), {containersModel: $scope.items});\\n    $scope.addItem = function addItem() {\\n      var index = $scope.items.indexOf(this.item) + 1;\\n      $scope.items.splice(index, 0, {\\n        content: this.item.content + \\'-copy\\'\\n      });\\n    };\\n    $scope.removeItem = function removeItem() {\\n      var index = $scope.items.indexOf(this.item);\\n      $scope.items.splice(index, 1);\\n    };\\n  }])\\n    \\n  
\\n
\\n\");\n\t$templateCache.put(\"exampleNgRepeatFilteredWithModel/exampleNgRepeatFilteredWithModel.html\",\"
\\n

Filtered ngRepeat - with model

\\n

Move stuff between these two filtered containers. You can play with filter inputs to see that everything goes right.\\n
\\n Please notify the getFilteredModel function, it is necessery for not replacing the initial array object with new filtered one!

\\n
\\n
\\n
\\n \\n
\\n
\\n \\n
\\n
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
\\n
\\n
Items1:\\n          
{{items1 | json}}
\\n
\\n
\\n
Items2:\\n          
{{items2 | json}}
\\n
\\n
\\n
\\n
\\n        \\n// JS\\n  .controller(\\'NgRepeatFilteredWithModel\\', [\\'$scope\\', \\'$element\\', \\'dragularService\\', \\'$filter\\', function TodoCtrl($scope, $element, dragularService, $filter) {\\n    $scope.items1 = [{\\n      content: \\'Move me, but you can only drop me in one of these containers.\\'\\n    }, {\\n      content: \\'If you try to drop me somewhere other than these containers, I\\\\\\'ll just come back.\\'\\n    }, {\\n      content: \\'Apple 3\\'\\n    }, {\\n      content: \\'Orange 4\\'\\n    }, {\\n      content: \\'Orange 5\\'\\n    }, {\\n      content: \\'Apple 6\\'\\n    }, {\\n      content: \\'Apple 7\\'\\n    }, {\\n      content: \\'Apple 8\\'\\n    }];\\n    $scope.items2 = [{\\n      content: \\'Apple 9\\'\\n    }, {\\n      content: \\'Orange 10\\'\\n    }, {\\n      content: \\'Orange 11\\'\\n    }, {\\n      content: \\'Apple 12\\'\\n    }, {\\n      content: \\'Orange 13\\'\\n    }, {\\n      content: \\'Apple 14\\'\\n    }];\\n    $scope.filter1query = \\'Orange\\';\\n    $scope.filter2query = \\'Orange\\';\\n    $scope.filteredModel1 = [];\\n    $scope.filteredModel2 = [];\\n    $scope.getFilteredModel = function (filteredModel, items, filterQuery) {\\n      filteredModel.length = 0;\\n      /*\\n      * Following one-liner is same like:\\n      *   var filteredModelTemp = $filter(\\'filter\\')(items, filterQuery);\\n      *   angular.forEach(filteredModelTemp, function(item){\\n      *     filteredModel.push(item);\\n      *   });\\n      * Or like:\\n      *   var filteredModelTemp = $filter(\\'filter\\')(items, filterQuery);\\n      *   for(var i; i < filteredModelTemp.length; i++){\\n      *     filteredModel.push(filteredModelTemp[i]);\\n      *   }\\n      *\\n      * You cannot just assign filtered array to filteredModel like this:\\n      *   filteredModel = $filter(\\'filter\\')(items, filterQuery);\\n      * Because you would replace the array object you provide to dragular with new one.\\n      * So dragular will continue to use the one it was provided on init.\\n      * Hopefully I make it clear. :)\\n       */\\n      [].push.apply(filteredModel, $filter(\\'filter\\')(items, filterQuery));\\n      return filteredModel;\\n    };\\n    var containers = $element.children().eq(1).children();\\n    dragularService.cleanEnviroment();\\n    dragularService([containers[0],containers[1]],{\\n      containersModel: [$scope.items1, $scope.items2],\\n      containersFilteredModel: [$scope.filteredModel1, $scope.filteredModel2]\\n    });\\n  }]);\\n\\n        \\n        \\n<!-- HTML -->\\n  <div class=\\'wrapper\\' ng-controller="NgRepeatFilteredWithModel">\\n    <div class="tableRow">\\n      <div class=\\'containerVertical\\'>\\n        <input ng-model="filter1query" style="margin:10px 10px">\\n      </div>\\n      <div class=\\'containerVertical\\'>\\n        <input ng-model="filter2query" style="margin:10px 10px">\\n      </div>\\n    </div>\\n    <div class=\\'tableRow\\'>\\n      <div class=\\'containerVertical\\'>\\n        <div ng-repeat="item in getFilteredModel(filteredModel1, items1, filter1query)">{{item.content}}</div>\\n      </div>\\n      <div class=\\'containerVertical\\'>\\n        <div ng-repeat="item in getFilteredModel(filteredModel2, items2, filter2query)">{{item.content}}</div>\\n      </div>\\n    </div>\\n    <div class="tableRow">\\n      <div class=\\'containerVertical\\'>\\n        <pre>Items1:\\n          <br/>{{items1 | json}}</pre>\\n      </div>\\n      <div class=\\'containerVertical\\'>\\n        <pre>Items2:\\n          <br/>{{items2 | json}}</pre>\\n      </div>\\n    </div>\\n  </div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleRemoveOnSpill/exampleRemoveOnSpill.html\",\"
\\n

Remove on spill

\\n \\n
\\n
\\n
Move me, but you can only drop me in containers.
\\n
If you try to drop me somewhere other than containers, I\\'ll die a fiery death.
\\n
Item 3.
\\n
Item 6.
\\n
Item 4.
\\n
Item 5.
\\n
\\n
\\n
You can drop me in the left container.
\\n
Item 4.
\\n
Item 5.
\\n
\\n
\\n
\\n        \\n  dragularService([document.getElementById(single)], { removeOnSpill: true });\\n        \\n      
\\n
\");\n\t$templateCache.put(\"exampleRemoveOnSpillWithModel/exampleRemoveOnSpillWithModel.html\",\"
\\n

Remove on spill - with model

\\n \\n
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
{{item.content}}
\\n
\\n
\\n
\\n
\\n
Items1:\\n          
{{items1 | json}}
\\n
\\n
\\n
Items2:\\n          
{{items2 | json}}
\\n
\\n
\\n
\\n
\\n        \\n// JS\\n  .controller(\\'RemoveOnSpillWithModel\\', [\\'$scope\\', \\'$element\\', \\'dragularService\\', function TodoCtrl($scope, $element, dragularService) {\\n    $scope.items1 = [{\\n      content: \\'Move me, but you can only drop me in containers.\\'\\n    }, {\\n      content: \\'If you try to drop me somewhere other than containers, I\\\\\\'ll die a fiery death.\\'\\n    }, {\\n      content: \\'Item 3\\'\\n    }, {\\n      content: \\'Item 4\\'\\n    }];\\n    $scope.items2 = [{\\n      content: \\'You can drop me in the left container.\\'\\n    }, {\\n      content: \\'Item 6\\'\\n    }, {\\n      content: \\'Item 7\\'\\n    }, {\\n      content: \\'Item 8\\'\\n    }];\\n    var containers = $element.children().eq(0).children();\\n    dragularService.cleanEnviroment();\\n    dragularService([containers[0],containers[1]],{\\n      containersModel: [$scope.items1, $scope.items2],\\n      removeOnSpill: true\\n    });\\n  }])\\n        \\n        \\n<!-- HTML -->\\n<div class=\\'wrapper\\' ng-controller="Basic">\\n    <div class=\\'tableRow\\'>\\n        <div class=\\'containerVertical\\'>\\n            <div ng-repeat="item in items1">{{item.content}}</div>\\n        </div>\\n        <div class=\\'containerVertical\\'>\\n            <div ng-repeat="item in items2">{{item.content}}</div>\\n        </div>\\n    </div>\\n    <div class="tableRow">\\n        <div class="container">\\n            <div>Items1:\\n                <br/>{{items1 | json}}</div>\\n        </div>\\n        <div class="container">\\n            <div>Items2:\\n                <br/>{{items2 | json}}</div>\\n        </div>\\n    </div>\\n</div>\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"exampleRevertOnSpill/exampleRevertOnSpill.html\",\"
\\n

Revert on spill

\\n \\n
\\n
\\n
Move me, but you can only drop me in one of these containers.
\\n
If you try to drop me somewhere other than these containers, I\\'ll just come back.
\\n
Item 3.
\\n
Item 6.
\\n
\\n
\\n
You can drop me in the left container, otherwise I\\'ll stay here.
\\n
Item 4.
\\n
Item 5.
\\n
\\n
\\n
\\n        \\n  dragularService([document.getElementById(left), document.getElementById(right)], { revertOnSpill: true });\\n        \\n      
\\n
\");\n\t$templateCache.put(\"exampleScrollingDrag/exampleScrollingDrag.html\",\"
\\n

Scrolling drag

\\n \\n
\\n
\\n
up
\\n
\\n
Item 1.
\\n
Item 2.
\\n
Item 3.
\\n
Item 4.
\\n
Item 5.
\\n
Item 6.
\\n
Item 7.
\\n
Item 9.
\\n
Item 10.
\\n
Item 11.
\\n
Item 12.
\\n
Item 13.
\\n
\\n
down
\\n
\\n
\\n
\\n
\\n
Item 1.
\\n
Item 2.
\\n
Item 3.
\\n
Item 4.
\\n
Item 5.
\\n
Item 6.
\\n
Item 7.
\\n
Item 9.
\\n
Item 10.
\\n
Item 11.
\\n
Item 12.
\\n
Item 13.
\\n
\\n
\\n
\\n
\\n
\\n        \\n// JS\\ncontroller(\\'ScrollingDrag\\', [\\'$interval\\', \\'$element\\', \\'dragularService\\', function TodoCtrl($interval, $element, dragularService) {\\n\\n\\n    var timer,\\n      leftScrollContainer = document.getElementById(\\'leftScroll\\'),\\n      rightScrollContainer = document.getElementById(\\'rightScroll\\'),\\n      leftTopBar = document.getElementById(\\'leftTopBar\\'),\\n      leftBottomBar = document.getElementById(\\'leftBottomBar\\'),\\n      rightTopBar = document.getElementById(\\'rightTopBar\\'),\\n      rightBottomBar = document.getElementById(\\'rightBottomBar\\');\\n\\n    dragularService.cleanEnviroment();\\n    dragularService([leftScrollContainer, rightScrollContainer]);\\n\\n    registerEvents(leftTopBar, leftScrollContainer, -5);\\n    registerEvents(leftBottomBar, leftScrollContainer, 5);\\n    registerEvents(rightTopBar, rightScrollContainer, -5);\\n    registerEvents(rightBottomBar, rightScrollContainer, 5);\\n\\n    function registerEvents(bar, container, inc, speed) {\\n      if (!speed) {\\n        speed = 20;\\n      }\\n      angular.element(bar).on(\\'dragularenter\\', function() {\\n        container.scrollTop += inc;\\n        timer = $interval(function moveScroll() {\\n          container.scrollTop += inc;\\n        }, speed);\\n      });\\n      angular.element(bar).on(\\'dragularleave dragularrelease\\', function() {\\n        $interval.cancel(timer);\\n      });\\n    }\\n  }])\\n        \\n      
\\n
\\n        \\n<!-- HTML -->\\n<div ng-controller="ScrollingDrag">\\n    <div class="containerVertical scrollingDrag">\\n      <div class="scrollBar" id="leftTopBar">up</div>\\n      <div id="leftScroll" class="scrollingDragInner">\\n        <div>Item 1</div>\\n        <div>Item 2</div>\\n            ...\\n      </div>\\n      <div class="scrollBar" id="leftBottomBar">down</div>\\n    </div>\\n    <div class="containerVertical scrollingDrag">\\n      <div class="scrollBar" id="rightTopBar">up</div>\\n      <div id="rightScroll" class="scrollingDragInner">\\n        <div>Item 1</div>\\n        <div>Item 2</div>\\n            ...\\n      </div>\\n      <div class="scrollBar" id="rightBottomBar">down</div>\\n    </div>\\n  </div>\\n        \\n      
\\n
\\n        \\n// CSS\\n.scrollingDrag {\\n  width: 45%;\\n  display: inline-block;\\n}\\n\\n.scrollingDragInner {\\n  max-height: 200px;\\n  overflow-y: auto;\\n}\\n\\n#rightTopBar,\\n#rightBottomBar {\\n  background: transparent;\\n  position: relative;\\n  height: 20px;\\n}\\n\\n#rightTopBar {\\n  top: 10px;\\n}\\n\\n#rightBottomBar {\\n  bottom: 10px;\\n}\\n\\ndiv.scrollBar {\\n  background: yellow;\\n  text-align: center;\\n  padding: 1px;\\n}\\n\\n        \\n      
\\n
\\n\");\n\t$templateCache.put(\"partials/partial-contribute.html\",\"
\\n
\\n
\\n \\n
\\n
\\n
\\n\");\n\t$templateCache.put(\"partials/partial-docs.html\",\"
\\n
\\n
\\n \\n
\\n \\n
\\n

\\n \\n

\\n \\n
\\n
\\n \\n
\\n \\n
\\n\");\n\t$templateCache.put(\"partials/partial-home.html\",\"
\\n
\\n \\n
\\n
\\n

DRAGULAR

\\n

Angular drag&drop based on dragula.

\\n

Live examples in docs

\\n
\\n
\\n
\\n

Browser support includes every sane browser and **IE7+**. _(Granted you polyfill the functional `Array` methods in ES5)_

\\n

Inspiration

\\n

I am working on huge angular project and I am using several drag&drop libraries in it, one for UI, one for lists, etc.. I want to use one full-featured drag&drop library for whole project. As I could not find any suitable, I decided to create one. I have choosen great library dragula by Nicolas Bevacqua as my starting point, make it more angular and started to put features in it! If you wish light-weight angular version of dragula, there is official angular version of dragula.

\\n

Actual version 4.4.6 is based on dragula 3.6.3 and tested with angular 1.5.5.

\\n

Differences of dragular (against dragula)

\\n
    \\n
  • replaced dragula crossvent with angulars event binding
  • \\n
  • replaced dragula contra.emitter with $scope.$emit if scope provided in options (options.scope)
  • \\n
  • provided as service or directive dragular where options can be passed via atribute dragular
  • \\n
  • automatic direction if not provided in options, instead of default vertical
  • \\n
  • accepting arraylike objects as containers array (jQuery, jQlite collections etc..)
  • \\n
  • accepting custom classes via option.classes
  • \\n
  • namespaced containers groups available via option.nameSpace (containers in same nameSpace cooperate)
  • \\n
  • boundingBox (dragging element can me moved only in specific area)
  • \\n
  • lockX/Y (dragging element can me moved only in specific direction)
  • \\n
  • DOM can be synced with scope model
  • \\n
  • support css selectors to define containers
  • \\n
  • added syntax highlighter to example codes
  • \\n
  • etc..
  • \\n
\\n

Todo

\\n
    \\n
  • improve docs
  • \\n
\\n

Features

\\n
    \\n
  • provided as service and also as directive
  • \\n
  • Super easy to set up
  • \\n
  • No bloated dependencies
  • \\n
  • Figures out sort order on its own
  • \\n
  • A shadow where the item would be dropped offers visual feedback
  • \\n
  • Touch events!
  • \\n
\\n

For installation, usage and examples go to docs

\\n
\\n
\\n \\n
\\n \\n
\\n \\n
\\n\");\n\t$templateCache.put(\"partials/autogenerated/contribute.html\",\"

How to contribute

\\n

It's important to us that you feel you can contribute towards the evolution of Dragular. This can take many forms: from helping to fix bugs or improve the docs, to adding in new features to the source. This guide should help you in making that process as smooth as possible.

\\n

Before contributing, please read the code of conduct.

\\n

Reporting issues

\\n

GitHub Issues is the place to report bugs you may have found in either the core library or any of the examples that are part of the repository. When submitting a bug please do the following:

\\n

1. Search for existing issues. Your bug may have already been fixed or addressed in a development branch version of Dragular, so be sure to search the issues first before putting in a duplicate issue.

\\n

2. Not sure if it's a bug?. Then please ask via issues and tag it [question].

\\n

3. Create an isolated and reproducible test case. If you are reporting a bug, make sure you also have a minimal, runnable, code example that reproduces the problem you have.

\\n

4. Include a live example. After narrowing your code down to only the problem areas, make use of Codepen, jsBin, or a link to your live site so that we can view a live example of the problem. (you can start by forking this codepen)

\\n

5. Share as much information as possible. Include browser version affected, your OS, version of the library, steps to reproduce, etc. "X isn't working!!!1!" will probably just be closed.

\\n

Dev vs. Master

\\n

The dev branch of Dragular is our 'current working' version. It is always ahead of the master branch in terms of features and fixes. However it's also bleeding-edge and experimental and we cannot and do not guarantee it will compile or work for you. Very often we have to break things for a few days while we rebuild and patch. So by all means please export the dev branch and contribute towards it, indeed that is where all Pull Requests should be sent, but do so understanding the API may change beneath you.

\\n

Making Changes

\\n

To take advantage of our npm build script and jshint config it will be easiest for you if you have node.js installed locally.

\\n

You can download node.js from nodejs.org.

\\n

After that you can clone the repository and run npm i inside the cloned folder. This will install dependencies necessary for building the project. For development workflow automation dragular uses gulp >= 3.9.0. Before starting development, make sure that gulp is installed on your machine globally: npm i -g gulp.

\\n

Developing

\\n

There are several gulp tasks that are used for generating different builds:

\\n
    \\n
  • gulp dev - Serves files with BrowserSync server, watches & automatically refreshes connected browsers on changes, generates non-minified but concatenated styles & scripts from the dragular source.
  • \\n
  • gulp dev:docs - Does exactly the same as gulp dev, except it works with the documentation source.
  • \\n
  • gulp build - Concatenates and minifies dragular source files.
  • \\n
  • gulp build:docs - Concatenates and minifies documentation source files.
  • \\n
\\n

Linting

\\n
    \\n
  • gulp lint & gulp lint:docs - Lint JavaScript files.
  • \\n
\\n

Making a pull request

\\n

Once that is ready, make your changes and submit a Pull Request:

\\n
    \\n
  • Send Pull Requests to the dev branch. All Pull Requests must be sent to the dev branch, master is the latest release and PRs to that branch will be closed.

    \\n
  • \\n
  • Ensure changes are jshint validated. Our JSHint configuration file is provided in the repository and you should check against it before submitting.

    \\n
  • \\n
  • Only commit relevant changes. Don't include changes that are not directly relevant to the fix you are making. The more focused a PR is, the faster it will get attention and be merged. Extra files changing only whitespace or trash files will likely get your PR closed.

    \\n
  • \\n
\\n

Dependencies for building from source and running tests:

\\n

Coding style preferences are not contributions

\\n

If your PR is doing little more than changing the Dragular source code into a format / coding style that you prefer then we will automatically close it. All PRs must adhere to the coding style already set-out across the lines of code in Dragular. Your personal preferences for how things should "look" or be structured do not apply here, sorry. PRs should fix bugs, fix documentation or add features. No changes for the sake of change.

\\n

I don't really like git / node.js, but I can fix this bug

\\n

That is fine too. While Pull Requests are the best thing in the world for us, they are not the only way to help. You're welcome to post fixes to our forum or even just email them to us. All we ask is that you still adhere to the guidelines presented here re: JSHint, etc.

\\n\");}]);\n\n/***/ })\n/******/ ])\n});\n;"]} \ No newline at end of file diff --git a/docs/src/examples/templates.js b/docs/src/examples/templates.js index 0934b568..8e6f8067 100644 --- a/docs/src/examples/templates.js +++ b/docs/src/examples/templates.js @@ -2,8 +2,8 @@ $templateCache.put("exampleBasic/exampleBasic.html","
\n

Basic

\n \n
\n
\n
Move me, but you can only drop me in one of these containers.
\n
If you try to drop me somewhere other than these containers, I\'ll just come back.
\n
Item 3.
\n
Item 6.
\n
\n
\n
You can drop me in the left container, otherwise I\'ll stay here.
\n
Try to click me, dragular distinguish drag from click
\n
Item 5.
\n
\n
\n
\n        \n// JS\n  controller(\'Basic\', [\'$element\', \'dragularService\', function TodoCtrl($element, dragularService) {\n    dragularService(\'.containerVertical\');\n  }])\n        \n        \n// CSS\n.clickedClass {\n  background-color: orange !important;\n}\n        \n        \n<!-- HTML -->\n  <div class=\'wrapper\' ng-controller="Basic">\n    <div class=\'containerVertical\'>\n        <div>Move me, but you can only drop me in one of these containers.</div>\n        <div>If you try to drop me somewhere other than these containers, I\'ll just come back.</div>\n        <div>Item 3.</div>\n        <div>Item 6.</div>\n    </div>\n    <div class=\'containerVertical\'>\n        <div>You can drop me in the left container, otherwise I\'ll stay here.</div>\n        <div ng-click=\"clicked = !clicked\" ng-class=\"clicked && \'clickedClass\'\">Try to click me, dragular distinguish drag from click</div>\n        <div>Item 5.</div>\n    </div>\n</div>\n        \n      
\n
\n"); $templateCache.put("exampleBasicWithModel/exampleBasicWithModel.html","
\n

Basic - with model

\n \n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n          
{{items1 | json}}
\n
\n
\n
Items2:\n          
{{items2 | json}}
\n
\n
\n
\n
\n        \n// JS\n  controller(\'BasicModel\', [\'$scope\', \'$element\', \'dragularService\', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items1 = [{\n      content: \'Move me, but you can only drop me in one of these containers.\'\n    }, {\n      content: \'If you try to drop me somewhere other than these containers, I\\\'ll just come back.\'\n    }, {\n      content: \'Item 3\'\n    }, {\n      content: \'Item 4\'\n    }];\n    $scope.items2 = [{\n      content: \'Item 5\'\n    }, {\n      content: \'Item 6\'\n    }, {\n      content: \'Item 7\'\n    }, {\n      content: \'Item 8\'\n    }];\n    var containers = $element.children().children();\n    dragularService([containers[0],containers[1]],{\n      containersModel: [$scope.items1, $scope.items2]\n    });\n  }])\n        \n        \n<!-- HTML -->\n<div class=\'wrapper\' ng-controller="Basic">\n    <div class=\'tableRow\'>\n        <div class=\'containerVertical\'>\n            <div ng-repeat="item in items1">{{item.content}}</div>\n        </div>\n        <div class=\'containerVertical\'>\n            <div ng-repeat="item in items2">{{item.content}}</div>\n        </div>\n    </div>\n    <div class="tableRow">\n        <div class="container">\n            <div>Items1:\n                <br/>{{items1 | json}}</div>\n        </div>\n        <div class="container">\n            <div>Items2:\n                <br/>{{items2 | json}}</div>\n        </div>\n    </div>\n</div>\n        \n      
\n
\n"); $templateCache.put("exampleBoundingBox/exampleBoundingBox.html","
\n

BoundingBox

\n \n
\n
\n
This items cannot cross its example element, just try it your selves.
\n
Item 2.
\n
Item 3.
\n
Item 6.
\n
\n
\n
This items cannot cross its example element, just try it your selves.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n        \n  dragularService([$element.children(), {\n    boundingBox: $element\n  });\n        \n      
\n
"); -$templateCache.put("exampleBoundingBoxLockY/exampleBoundingBoxLockY.html","
\n

BoundingBox and LockY

\n \n
\n
\n
\n
Items are locked in Y axis movement and cannot cross its closest parent div.boundingBox, just try it your selves.
\n
item 2
\n
item 3
\n
item 4
\n
item 5
\n
item 6
\n
\n
\n
\n
\n        \n  dragularService([$element.children()[0].children(), {\n    boundingBox: $element.children()[0],\n    lockY: true\n  });\n        \n      
\n
"); $templateCache.put("exampleBoundingBoxLockX/exampleBoundingBoxLockX.html","
\n

BoundingBox and lockX

\n \n
\n
\n
\n
Items are locked in X axis movement and cannot cross its closest parent div.boundingBox, just try it your selves.
\n
item 2
\n
item 3
\n
item 4
\n
\n
\n
\n
\n        \n  dragularService([$element.children()[0].children(), {\n    boundingBox: $element.children()[0],\n    lockX: true\n  });\n        \n      
\n
"); +$templateCache.put("exampleBoundingBoxLockY/exampleBoundingBoxLockY.html","
\n

BoundingBox and LockY

\n \n
\n
\n
\n
Items are locked in Y axis movement and cannot cross its closest parent div.boundingBox, just try it your selves.
\n
item 2
\n
item 3
\n
item 4
\n
item 5
\n
item 6
\n
\n
\n
\n
\n        \n  dragularService([$element.children()[0].children(), {\n    boundingBox: $element.children()[0],\n    lockY: true\n  });\n        \n      
\n
"); $templateCache.put("exampleCopy/exampleCopy.html","
\n

Copy

\n \n
\n
\n
Move me, and make copy on drop.
\n
If you try to drop me somewhere other than these containers, I\'ll just come back.
\n
\n
\n
You can drop me in the left container, otherwise I\'ll stay here.
\n
\n
\n
\n        \n// JS\n  controller(\'Copy\', [\'$element\', \'dragularService\', function TodoCtrl($element, dragularService) {\n    dragularService($element.children(), {\n      copy: true\n    });\n  }])\n        \n        \n<!-- HTML -->\n<div class=\'wrapper\' ng-controller="Copy" ng-hide="globals.showModelExamples">\n    <div id=\'left2\' class=\'containerVertical\'>\n      <div>Move me, and make copy on drop.</div>\n      <div>If you try to drop me somewhere other than these containers, I\'ll just come back.</div>\n    </div>\n    <div id=\'right2\' class=\'containerVertical\'>\n      <div>You can drop me in the left container, otherwise I\'ll stay here.</div>\n    </div>\n  </div>\n        \n      
\n
\n"); $templateCache.put("exampleCopyWithModel/exampleCopyWithModel.html","
\n

Copy - with model

\n \n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n
\n            {{ items1 | json }}\n          
\n
\n
\n
\n
Items2:\n
\n            {{ items2 | json }}\n          
\n
\n
\n
\n
\n
\n        \n// JS\n  controller(\'CopyModel\', [\'$scope\', \'$element\', \'dragularService\', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items1 = [{\n      content: \'Move me, and make copy on drop.\'\n    }, {\n      content: \'If you try to drop me somewhere other than these containers, I\\\'ll just come back.\'\n    }, {\n      content: \'Item 3\'\n    }, {\n      content: \'Item 4\'\n    }];\n    $scope.items2 = [{\n      content: \'Item 5\'\n    }, {\n      content: \'Item 6\'\n    }, {\n      content: \'Item 7\'\n    }, {\n      content: \'Item 8\'\n    }];\n    var containers = $element.children().children();\n    dragularService([containers[0],containers[1]],{\n      containersModel: [$scope.items1, $scope.items2],\n      copy: true\n    });\n  }])\n        \n        \n<!-- HTML -->\n<div class=\'wrapper\' ng-controller="CopyModel" ng-show="globals.showModelExamples">\n    <div class=\'tableRow\'>\n      <div class=\'containerVertical\'>\n        <div ng-repeat="item in items1">{{item.content}}</div>\n      </div>\n      <div class=\'containerVertical\'>\n        <div ng-repeat="item in items2">{{item.content}}</div>\n      </div>\n    </div>\n    <div class="tableRow">\n      <div class="container">\n        <div>Items1:\n          <br/>{{items1 | json}}</div>\n      </div>\n      <div class="container">\n        <div>Items2:\n          <br/>{{items2 | json}}</div>\n      </div>\n    </div>\n  </div>\n        \n      
\n
\n"); $templateCache.put("exampleCustomClasses/exampleCustomClasses.html","
\n

Custom classes

\n \n
\n
\n
Move me, but you can only drop me in one of these containers.
\n
If you try to drop me somewhere other than these containers, I\'ll just come back.
\n
Item 3.
\n
Item 6.
\n
\n
\n
You can drop me in the left container, otherwise I\'ll stay here.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n        \n  dragularService([document.getElementById(left), document.getElementById(right)], { classes: {\n    mirror: \'custom-green-mirror\'\n  } });\n\n  // Default classes are:\n  option.classes = {\n    mirror: \'gu-mirror\',\n    hide: \'gu-hide\',\n    unselectable: \'gu-unselectable\',\n    transit: \'gu-transit\',\n    overActive: \'gu-over-active\',\n    overAccepts: \'gu-over-accept\',\n    overDeclines: \'gu-over-decline\'\n  };\n        \n      
\n
\n"); @@ -19,8 +19,8 @@ $templateCache.put("exampleNestedNgRepeat/exampleNestedNgRepeat.html","
\n

Nested ngRepeat - with model

\n \n
\n
\n
\n
\n
Row {{::$index}}
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
\n
\n
\n            
Items:\n
{{items | json}}
\n
\n
\n
\n
\n
\n    \n<!-- HTML -->\n<div ng-controller="NestedNgRepeatWithModel">\n  <div class=\'containerVertical\'>\n    <div ng-repeat="item in items" class=\'exampleRow\'>\n      <div class="row-handle">Row {{::$index}}</div>\n      <div class="exampleRow exampleCell containerNested">\n        <div ng-repeat="item in item.items" class="exampleCell">{{item.content}}</div>\n      </div>\n    </div>\n  </div>\n</div>\n    \n  
\n
\n    \n  // CSS\n\n  .exampleRow {\n    display: flex;\n    flex-direction: row;\n  }\n\n  .exampleCell {\n    flex-grow: 1;\n  }\n\n  .exampleRow,\n  .exampleCell {\n    margin: 10px;\n    padding: 10px;\n    background-color: rgba(0, 0, 0, 0.2);\n    cursor: move;\n    cursor: grab;\n    cursor: -moz-grab;\n    cursor: -webkit-grab;\n  }\n    \n  
\n
\n    \n  // JS\n.controller(\'NestedNgRepeatWithModel\', [\'$timeout\', \'$scope\', \'$element\', \'dragularService\', function NestedNgRepeatWithModelCtrl($timeout, $scope, $element, dragularService) {\n    $timeout(function() { // timeount due to nested ngRepeat to be ready\n      var container = $element.children().eq(0).children(),\n        parentContainers = container.children(),\n        nestedContainers = [];\n\n      dragularService(container, {\n        moves: function(el, container, handle) {\n          return handle.classList.contains(\'row-handle\');\n        },\n        containersModel: $scope.items,\n        nameSpace: \'rows\'\n      });\n\n      // collect nested contianers\n      for (var i = 0; i < parentContainers.length; i++) {\n        nestedContainers.push(parentContainers.eq(i).children()[1]);\n      }\n\n      dragularService(nestedContainers, {\n        moves: function(el, container, handle) {\n          return !handle.classList.contains(\'row-handle\');\n        },\n        containersModel: (function getNestedContainersModel(){\n          var parent = $scope.items,\n            containersModel = [];\n          for (var i = 0; i < parent.length; i++) {\n            containersModel.push(parent[i].items);\n          }\n          return containersModel;\n        })(),\n        nameSpace: \'cells\'\n      });\n    }, 0);\n    $scope.items = [{\n      items: [{\n        content: \'Item a1\'\n      }, {\n        content: \'Item a2\'\n      }, {\n        content: \'Item a3\'\n      }, {\n        content: \'Item a4\'\n      }]\n    }, {\n      items: [{\n        content: \'Item b1\'\n      }, {\n        content: \'Item b2\'\n      }, {\n        content: \'Item b3\'\n      }, {\n        content: \'Item b4\'\n      }]\n    }, {\n      items: [{\n        content: \'Item c1\'\n      }, {\n        content: \'Item c2\'\n      }, {\n        content: \'Item c3\'\n      }, {\n        content: \'Item c4\'\n      }]\n    }];\n  }])\n    \n  
\n
\n"); $templateCache.put("exampleNestedRepeatsWithCustomDirective/exampleNestedRepeatsWithCustomDirective.html","
\n
\n
\n {{item.order}}: ({{item.name}} + {{item.age}})\n
\n \n \n
\n
\n
\n
\n"); $templateCache.put("exampleNgRepeat/exampleNgRepeat.html","
\n

ngRepeat

\n \n
\n
\n
\n {{item.content}}\n
\n
\n
\n
\n        \n  // HTML:\n  <div class=\'containerVertical\'>\n    <div ng-repeat="item in items">\n      {{item.content}}\n    </div>\n  </div>\n\n  // JS:\n  dragularService($element.children());\n  $scope.items = [{\n    content: \'Try to add or remove some elements (click on +- buttons), you will see that it is not problem for dragular.\'\n  },{\n    content: \'Item 2\'\n  },{\n    content: \'Item 3\'\n  },{\n    content: \'Item 4\'\n  }];\n        \n      
\n
\n"); -$templateCache.put("exampleNgRepeatFilteredWithModel/exampleNgRepeatFilteredWithModel.html","
\n

Filtered ngRepeat - with model

\n

Move stuff between these two filtered containers. You can play with filter inputs to see that everything goes right.\n
\n Please notify the getFilteredModel function, it is necessery for not replacing the initial array object with new filtered one!

\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n          
{{items1 | json}}
\n
\n
\n
Items2:\n          
{{items2 | json}}
\n
\n
\n
\n
\n        \n// JS\n  .controller(\'NgRepeatFilteredWithModel\', [\'$scope\', \'$element\', \'dragularService\', \'$filter\', function TodoCtrl($scope, $element, dragularService, $filter) {\n    $scope.items1 = [{\n      content: \'Move me, but you can only drop me in one of these containers.\'\n    }, {\n      content: \'If you try to drop me somewhere other than these containers, I\\\'ll just come back.\'\n    }, {\n      content: \'Apple 3\'\n    }, {\n      content: \'Orange 4\'\n    }, {\n      content: \'Orange 5\'\n    }, {\n      content: \'Apple 6\'\n    }, {\n      content: \'Apple 7\'\n    }, {\n      content: \'Apple 8\'\n    }];\n    $scope.items2 = [{\n      content: \'Apple 9\'\n    }, {\n      content: \'Orange 10\'\n    }, {\n      content: \'Orange 11\'\n    }, {\n      content: \'Apple 12\'\n    }, {\n      content: \'Orange 13\'\n    }, {\n      content: \'Apple 14\'\n    }];\n    $scope.filter1query = \'Orange\';\n    $scope.filter2query = \'Orange\';\n    $scope.filteredModel1 = [];\n    $scope.filteredModel2 = [];\n    $scope.getFilteredModel = function (filteredModel, items, filterQuery) {\n      filteredModel.length = 0;\n      /*\n      * Following one-liner is same like:\n      *   var filteredModelTemp = $filter(\'filter\')(items, filterQuery);\n      *   angular.forEach(filteredModelTemp, function(item){\n      *     filteredModel.push(item);\n      *   });\n      * Or like:\n      *   var filteredModelTemp = $filter(\'filter\')(items, filterQuery);\n      *   for(var i; i < filteredModelTemp.length; i++){\n      *     filteredModel.push(filteredModelTemp[i]);\n      *   }\n      *\n      * You cannot just assign filtered array to filteredModel like this:\n      *   filteredModel = $filter(\'filter\')(items, filterQuery);\n      * Because you would replace the array object you provide to dragular with new one.\n      * So dragular will continue to use the one it was provided on init.\n      * Hopefully I make it clear. :)\n       */\n      [].push.apply(filteredModel, $filter(\'filter\')(items, filterQuery));\n      return filteredModel;\n    };\n    var containers = $element.children().eq(1).children();\n    dragularService.cleanEnviroment();\n    dragularService([containers[0],containers[1]],{\n      containersModel: [$scope.items1, $scope.items2],\n      containersFilteredModel: [$scope.filteredModel1, $scope.filteredModel2]\n    });\n  }]);\n\n        \n        \n<!-- HTML -->\n  <div class=\'wrapper\' ng-controller="NgRepeatFilteredWithModel">\n    <div class="tableRow">\n      <div class=\'containerVertical\'>\n        <input ng-model="filter1query" style="margin:10px 10px">\n      </div>\n      <div class=\'containerVertical\'>\n        <input ng-model="filter2query" style="margin:10px 10px">\n      </div>\n    </div>\n    <div class=\'tableRow\'>\n      <div class=\'containerVertical\'>\n        <div ng-repeat="item in getFilteredModel(filteredModel1, items1, filter1query)">{{item.content}}</div>\n      </div>\n      <div class=\'containerVertical\'>\n        <div ng-repeat="item in getFilteredModel(filteredModel2, items2, filter2query)">{{item.content}}</div>\n      </div>\n    </div>\n    <div class="tableRow">\n      <div class=\'containerVertical\'>\n        <pre>Items1:\n          <br/>{{items1 | json}}</pre>\n      </div>\n      <div class=\'containerVertical\'>\n        <pre>Items2:\n          <br/>{{items2 | json}}</pre>\n      </div>\n    </div>\n  </div>\n        \n      
\n
\n"); $templateCache.put("exampleNgRepeatWithModel/exampleNgRepeatWithModel.html","
\n

ngRepeat - with model

\n \n
\n
\n
\n
\n {{item.content}}\n \n \n
\n
\n
\n
\n
\n
Items:\n
{{items | json}}
\n
\n
\n
\n
\n    \n  // HTML:\n   <div class=\'wrapper\' ng-controller="NgRepeatWithModel">\n      <div class=\'containerVertical\'>\n        <div ng-repeat="item in items">\n          {{item.content}}\n          <button class=\'cursorDefault\' ng-click="addItem()">+</button>\n          <button class=\'cursorDefault\' ng-click="removeItem()">x</button>\n        </div>\n    </div>\n  </div>\n    \n  
\n
\n    \n  // JS:\n  controller(\'NgRepeatWithModel\', [\'$scope\', \'$element\', \'dragularService\', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items = [{\n      content: \'Try to add or remove some elements (click on +- buttons), you will see that it is not problem for dragular.\'\n    }, {\n      content: \'Item 2\'\n    }, {\n      content: \'Item 3\'\n    }, {\n      content: \'Item 4\'\n    }];\n    dragularService($element.children().eq(0).children(), {containersModel: $scope.items});\n    $scope.addItem = function addItem() {\n      var index = $scope.items.indexOf(this.item) + 1;\n      $scope.items.splice(index, 0, {\n        content: this.item.content + \'-copy\'\n      });\n    };\n    $scope.removeItem = function removeItem() {\n      var index = $scope.items.indexOf(this.item);\n      $scope.items.splice(index, 1);\n    };\n  }])\n    \n  
\n
\n"); +$templateCache.put("exampleNgRepeatFilteredWithModel/exampleNgRepeatFilteredWithModel.html","
\n

Filtered ngRepeat - with model

\n

Move stuff between these two filtered containers. You can play with filter inputs to see that everything goes right.\n
\n Please notify the getFilteredModel function, it is necessery for not replacing the initial array object with new filtered one!

\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n          
{{items1 | json}}
\n
\n
\n
Items2:\n          
{{items2 | json}}
\n
\n
\n
\n
\n        \n// JS\n  .controller(\'NgRepeatFilteredWithModel\', [\'$scope\', \'$element\', \'dragularService\', \'$filter\', function TodoCtrl($scope, $element, dragularService, $filter) {\n    $scope.items1 = [{\n      content: \'Move me, but you can only drop me in one of these containers.\'\n    }, {\n      content: \'If you try to drop me somewhere other than these containers, I\\\'ll just come back.\'\n    }, {\n      content: \'Apple 3\'\n    }, {\n      content: \'Orange 4\'\n    }, {\n      content: \'Orange 5\'\n    }, {\n      content: \'Apple 6\'\n    }, {\n      content: \'Apple 7\'\n    }, {\n      content: \'Apple 8\'\n    }];\n    $scope.items2 = [{\n      content: \'Apple 9\'\n    }, {\n      content: \'Orange 10\'\n    }, {\n      content: \'Orange 11\'\n    }, {\n      content: \'Apple 12\'\n    }, {\n      content: \'Orange 13\'\n    }, {\n      content: \'Apple 14\'\n    }];\n    $scope.filter1query = \'Orange\';\n    $scope.filter2query = \'Orange\';\n    $scope.filteredModel1 = [];\n    $scope.filteredModel2 = [];\n    $scope.getFilteredModel = function (filteredModel, items, filterQuery) {\n      filteredModel.length = 0;\n      /*\n      * Following one-liner is same like:\n      *   var filteredModelTemp = $filter(\'filter\')(items, filterQuery);\n      *   angular.forEach(filteredModelTemp, function(item){\n      *     filteredModel.push(item);\n      *   });\n      * Or like:\n      *   var filteredModelTemp = $filter(\'filter\')(items, filterQuery);\n      *   for(var i; i < filteredModelTemp.length; i++){\n      *     filteredModel.push(filteredModelTemp[i]);\n      *   }\n      *\n      * You cannot just assign filtered array to filteredModel like this:\n      *   filteredModel = $filter(\'filter\')(items, filterQuery);\n      * Because you would replace the array object you provide to dragular with new one.\n      * So dragular will continue to use the one it was provided on init.\n      * Hopefully I make it clear. :)\n       */\n      [].push.apply(filteredModel, $filter(\'filter\')(items, filterQuery));\n      return filteredModel;\n    };\n    var containers = $element.children().eq(1).children();\n    dragularService.cleanEnviroment();\n    dragularService([containers[0],containers[1]],{\n      containersModel: [$scope.items1, $scope.items2],\n      containersFilteredModel: [$scope.filteredModel1, $scope.filteredModel2]\n    });\n  }]);\n\n        \n        \n<!-- HTML -->\n  <div class=\'wrapper\' ng-controller="NgRepeatFilteredWithModel">\n    <div class="tableRow">\n      <div class=\'containerVertical\'>\n        <input ng-model="filter1query" style="margin:10px 10px">\n      </div>\n      <div class=\'containerVertical\'>\n        <input ng-model="filter2query" style="margin:10px 10px">\n      </div>\n    </div>\n    <div class=\'tableRow\'>\n      <div class=\'containerVertical\'>\n        <div ng-repeat="item in getFilteredModel(filteredModel1, items1, filter1query)">{{item.content}}</div>\n      </div>\n      <div class=\'containerVertical\'>\n        <div ng-repeat="item in getFilteredModel(filteredModel2, items2, filter2query)">{{item.content}}</div>\n      </div>\n    </div>\n    <div class="tableRow">\n      <div class=\'containerVertical\'>\n        <pre>Items1:\n          <br/>{{items1 | json}}</pre>\n      </div>\n      <div class=\'containerVertical\'>\n        <pre>Items2:\n          <br/>{{items2 | json}}</pre>\n      </div>\n    </div>\n  </div>\n        \n      
\n
\n"); $templateCache.put("exampleRemoveOnSpill/exampleRemoveOnSpill.html","
\n

Remove on spill

\n \n
\n
\n
Move me, but you can only drop me in containers.
\n
If you try to drop me somewhere other than containers, I\'ll die a fiery death.
\n
Item 3.
\n
Item 6.
\n
Item 4.
\n
Item 5.
\n
\n
\n
You can drop me in the left container.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n        \n  dragularService([document.getElementById(single)], { removeOnSpill: true });\n        \n      
\n
"); $templateCache.put("exampleRemoveOnSpillWithModel/exampleRemoveOnSpillWithModel.html","
\n

Remove on spill - with model

\n \n
\n
\n
\n
{{item.content}}
\n
\n
\n
{{item.content}}
\n
\n
\n
\n
\n
Items1:\n          
{{items1 | json}}
\n
\n
\n
Items2:\n          
{{items2 | json}}
\n
\n
\n
\n
\n        \n// JS\n  .controller(\'RemoveOnSpillWithModel\', [\'$scope\', \'$element\', \'dragularService\', function TodoCtrl($scope, $element, dragularService) {\n    $scope.items1 = [{\n      content: \'Move me, but you can only drop me in containers.\'\n    }, {\n      content: \'If you try to drop me somewhere other than containers, I\\\'ll die a fiery death.\'\n    }, {\n      content: \'Item 3\'\n    }, {\n      content: \'Item 4\'\n    }];\n    $scope.items2 = [{\n      content: \'You can drop me in the left container.\'\n    }, {\n      content: \'Item 6\'\n    }, {\n      content: \'Item 7\'\n    }, {\n      content: \'Item 8\'\n    }];\n    var containers = $element.children().eq(0).children();\n    dragularService.cleanEnviroment();\n    dragularService([containers[0],containers[1]],{\n      containersModel: [$scope.items1, $scope.items2],\n      removeOnSpill: true\n    });\n  }])\n        \n        \n<!-- HTML -->\n<div class=\'wrapper\' ng-controller="Basic">\n    <div class=\'tableRow\'>\n        <div class=\'containerVertical\'>\n            <div ng-repeat="item in items1">{{item.content}}</div>\n        </div>\n        <div class=\'containerVertical\'>\n            <div ng-repeat="item in items2">{{item.content}}</div>\n        </div>\n    </div>\n    <div class="tableRow">\n        <div class="container">\n            <div>Items1:\n                <br/>{{items1 | json}}</div>\n        </div>\n        <div class="container">\n            <div>Items2:\n                <br/>{{items2 | json}}</div>\n        </div>\n    </div>\n</div>\n        \n      
\n
\n"); $templateCache.put("exampleRevertOnSpill/exampleRevertOnSpill.html","
\n

Revert on spill

\n \n
\n
\n
Move me, but you can only drop me in one of these containers.
\n
If you try to drop me somewhere other than these containers, I\'ll just come back.
\n
Item 3.
\n
Item 6.
\n
\n
\n
You can drop me in the left container, otherwise I\'ll stay here.
\n
Item 4.
\n
Item 5.
\n
\n
\n
\n        \n  dragularService([document.getElementById(left), document.getElementById(right)], { revertOnSpill: true });\n        \n      
\n
"); diff --git a/src/dragularModule.js b/src/dragularModule.js index 2d069f46..d7734de0 100644 --- a/src/dragularModule.js +++ b/src/dragularModule.js @@ -4,7 +4,7 @@ var dragularDirective = require( './dragularDirective' ); var dragularService = require( './dragularService' ); /** - * Dragular 4.4.6 by Luckylooke https://github.com/luckylooke/dragular + * Dragular 4.5.0 by Luckylooke https://github.com/luckylooke/dragular * Angular version of dragula https://github.com/bevacqua/dragula */ module.exports = 'dragularModule'; diff --git a/src/dragularService.js b/src/dragularService.js index c1eb6153..c467f32f 100644 --- a/src/dragularService.js +++ b/src/dragularService.js @@ -1084,8 +1084,9 @@ var dragularService = function ( $rootScope, $compile ) { shared.containers[ nameSpace ].splice( index, 1 ); shared.containersCtx[ nameSpace ].splice( index, 1 ); - if ( -1 < (index = initialContainers.indexOf( container ))) + if ( -1 < (index = initialContainers.indexOf( container ))) { initialContainers.splice( index, 1 ); + } } ); } ); } );