Skip to content
This repository has been archived by the owner on Nov 27, 2019. It is now read-only.

Commit

Permalink
Wind River v4.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
luckylooke committed Feb 18, 2018
1 parent 95ea5f3 commit ebb4091
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Browser support includes every sane browser and **IE7+**. <sub>_(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).

<b>Actual version 4.4.6 is based on dragula 3.6.3 and tested with angular 1.6.5.</b>
<b>Actual version 4.5.0 is based on dragula 3.6.3 and tested with angular 1.6.5.</b>

# Differences of dragular (against dragula)

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
34 changes: 29 additions & 5 deletions dist/dragular.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 ) {
Expand Down Expand Up @@ -1196,24 +1198,46 @@ 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 ) {

var index;
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 ) {
Expand Down
2 changes: 1 addition & 1 deletion dist/dragular.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dragular.min.js.map

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions docs/dist/examples.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/dist/examples.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/dist/examples.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/src/examples/templates.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/dragularModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
3 changes: 2 additions & 1 deletion src/dragularService.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
} );
} );
} );
Expand Down

0 comments on commit ebb4091

Please sign in to comment.