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

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
luckylooke committed Aug 12, 2017
2 parents c42056a + 7effe35 commit ca03544
Show file tree
Hide file tree
Showing 19 changed files with 3,470 additions and 2,627 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 4.4.6 Ghost in the shell
- isContainer docs augmentation
- fixed bug in getTargetCtx
- fixed #161 previous target context used if the last before drop was not accepted target

# 4.4.5 Target
- fixes #154 - both scopes should be notified about events (source and also target scope)
- adding main gulp tasks to standard npm tasks, to get better orented quickly
Expand Down
10 changes: 5 additions & 5 deletions 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.5 is based on dragula 3.6.3 and tested with angular 1.6.5.</b>
<b>Actual version 4.4.6 is based on dragula 3.6.3 and tested with angular 1.6.5.</b>

# Differences of dragular (against dragula)

Expand Down Expand Up @@ -224,15 +224,15 @@ $scope.getFilteredModel = function (filteredModel, items, filterQuery) {

See 'options.containersModel' above for usecase.

### `options.isContainer`
### `options.isContainer( element )`

Element can be forced to be container by custom logic function. Tested element is passed as argument.
Element can be forced to be container by custom logic function. Tested element is passed as argument. It is an element under dragged item called recursivelly so it can be also parent of element under the item or parent of a parent, etc..

### `options.isContainerModel`
### `options.isContainerModel( element )`

If isContainer function is provided, you can provide also respective model. Tested element is passed as argument.

### `options.isContainerAccepts`
### `options.isContainerAccepts( shared.item, target, shared.source, reference, shared.sourceModel, shared.initialIndex )`

If isContainer function is provided, you can provide also respective acceptation function. Parameters are same as for `options.accepts`.

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.4",
"version": "4.4.6",
"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
25 changes: 13 additions & 12 deletions dist/dragular.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ return /******/ (function(modules) { // webpackBootstrap
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
/***/ (function(module, exports, __webpack_require__) {

/* global angular */
'use strict';
var dragularDirective = __webpack_require__( 1 );
var dragularService = __webpack_require__( 2 );

/**
* Dragular 4.4.5 by Luckylooke https://github.com/luckylooke/dragular
* Dragular 4.4.6 by Luckylooke https://github.com/luckylooke/dragular
* Angular version of dragula https://github.com/bevacqua/dragula
*/
module.exports = 'dragularModule';
Expand All @@ -71,9 +71,9 @@ return /******/ (function(modules) { // webpackBootstrap
.directive( 'dragular', dragularDirective );


/***/ },
/***/ }),
/* 1 */
/***/ function(module, exports) {
/***/ (function(module, exports) {

'use strict';

Expand Down Expand Up @@ -122,9 +122,9 @@ return /******/ (function(modules) { // webpackBootstrap
module.exports = dragular;


/***/ },
/***/ }),
/* 2 */
/***/ function(module, exports) {
/***/ (function(module, exports) {

/* global angular */
'use strict';
Expand Down Expand Up @@ -230,7 +230,7 @@ return /******/ (function(modules) { // webpackBootstrap
containersModel: false, // if provided, model will be synced with DOM
containersFilteredModel: false, // if provided, dragular will handle filtered model cases
isContainer: never, // potential target can be forced to be container by custom logic
isContainerModel: getEmptyObject, // if isContainer function is provided, you can provide also respective model
isContainerModel: getEmptyArray, // if isContainer function is provided, you can provide also respective model
isContainerAccepts: always, // if isContainer function is provided, you can provide also respective accept function
moves: always, // can drag start?
accepts: always, // can target accept dragged item? (target context used)
Expand Down Expand Up @@ -780,7 +780,8 @@ return /******/ (function(modules) { // webpackBootstrap
}

// bugfix #148 model not updated on spill
if ( targetCtx ){
// added target condition to fix #161
if ( target && targetCtx ){
shared.targetCtx = targetCtx;
}

Expand Down Expand Up @@ -845,7 +846,7 @@ return /******/ (function(modules) { // webpackBootstrap
}

function getTargetCtx( nameSpace ) {
return shared.containersCtx[ nameSpace ][ shared.containers[ nameSpace ].indexOf( target ) ];
return shared.containersCtx[ nameSpace ] && shared.containersCtx[ nameSpace ][ shared.containers[ nameSpace ].indexOf( target ) ];
}
}

Expand Down Expand Up @@ -1411,8 +1412,8 @@ return /******/ (function(modules) { // webpackBootstrap
return rect.height || (rect.bottom - rect.top);
}

function getEmptyObject() {
return {};
function getEmptyArray() {
return [];
}

function nextEl( el ) {
Expand Down Expand Up @@ -1549,7 +1550,7 @@ return /******/ (function(modules) { // webpackBootstrap
module.exports = dragularService;


/***/ }
/***/ })
/******/ ])
});
;
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.

258 changes: 129 additions & 129 deletions docs/dist/examples.css

Large diffs are not rendered by default.

Loading

0 comments on commit ca03544

Please sign in to comment.