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

Commit

Permalink
Hitman v4.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
luckylooke committed Jan 14, 2017
1 parent 27546a6 commit c483129
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 40 deletions.
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.2.5",
"version": "4.3.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.min.js",
Expand Down
3 changes: 3 additions & 0 deletions changelog.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
- **[Braking change!]** rename 'dragulardrag' event to 'dragulardragstart'
- new event 'dragulardrag' emited each iteration while dragging

# 4.3.0 Hitman
- added new options for `options.containersModel`, it accepts also string from now

# 4.2.5 Di-strict 9
- fixing #108 - Webpack and strict mode

Expand Down
15 changes: 9 additions & 6 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.2.4 by Luckylooke https://github.com/luckylooke/dragular
* Dragular 4.3.0 by Luckylooke https://github.com/luckylooke/dragular
* Angular version of dragula https://github.com/bevacqua/dragula
*/
module.exports = 'dragularModule';
Expand Down Expand Up @@ -281,12 +281,15 @@ return /******/ (function(modules) { // webpackBootstrap
// Initial functions: -----------------------------------------------------------------------------------------------------------------

function sanitizeContainersModel(containersModel) {
if (typeof(containersModel) === 'function') {
if (typeof containersModel === 'function') {
return containersModel;
}
if (Array.isArray(containersModel)) {
// |-------- is 2D array? -----------|
return Array.isArray(containersModel[0]) ? containersModel : [containersModel];
} else if (Array.isArray(containersModel)) {
// |-------- is 2D array? -----------|
return Array.isArray(containersModel[0]) ? containersModel : [containersModel];
} else if (typeof containersModel === 'string' && (o.scope || o.containersModelCtx)) {
return function () {
return o.containersModelCtx ? o.containersModelCtx[containersModel] : o.scope[containersModel];
};
} else {
return [];
}
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.

27 changes: 15 additions & 12 deletions docs/dist/examples.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 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.

2 changes: 1 addition & 1 deletion docs/src/examples/partials/partial-home.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h1>DRAGULAR</h1>
<p>Browser support includes every sane browser and **IE7+**. <sub>_(Granted you polyfill the functional `Array` methods in ES5)_</sub></p>
<h2>Inspiration</h2>
<p>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 <a href="http://github.com/bevacqua/dragula">dragula</a> by <a href="https://github.com/bevacqua">Nicolas Bevacqua</a> 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 <a href="http://github.com/bevacqua/angular-dragula">official angular version of dragula</a>.</p>
<p><b>Actual version 4.2.5 is based on dragula 3.6.3 and tested with angular 1.5.5.</b></p>
<p><b>Actual version 4.3.0 is based on dragula 3.6.3 and tested with angular 1.5.5.</b></p>
<h2>Differences of dragular (against dragula)</h2>
<ul>
<li>replaced dragula crossvent with angulars event binding</li>
Expand Down
12 changes: 6 additions & 6 deletions docs/src/examples/templates.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion readme.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Browser support includes every sane browser and **IE7+**. <sub>_(Granted you pol

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](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.2.5 is based on dragula 3.6.3 and tested with angular 1.5.5.</b>
<b>Actual version 4.3.0 is based on dragula 3.6.3 and tested with angular 1.5.5.</b>

# Differences of dragular (against dragula)

Expand Down Expand Up @@ -178,6 +178,8 @@ If you wish to have model synced with containers state, you need to provide it w

You can also provide callback function via `options.containersModel` which is called everytime drag starts. It must return array or 2D-array as mentioned in above paragraph.

String can be also provided to `options.containersModel` which is used against `options.scope` if provided, if not there is also opportunity to provide another object via `options.containersModelCtx` to be used as context and provided string will be evaluated against this object. In case that both `options.containersModelCtx` and `options.scope` are provided, `options.containersModelCtx` has higher priority, so it will be evaluated against it. Target property must be array or 2D-array as mentioned in first paragraph.

**Please note that if you are using filters on your items you must provide filtered array no source one!**
```html
<input ng-model="query">
Expand Down
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.2.4 by Luckylooke https://github.com/luckylooke/dragular
* Dragular 4.3.0 by Luckylooke https://github.com/luckylooke/dragular
* Angular version of dragula https://github.com/bevacqua/dragula
*/
module.exports = 'dragularModule';
Expand Down
13 changes: 8 additions & 5 deletions src/dragularService.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,15 @@ var dragularService = function ($rootScope, $compile) {
// Initial functions: -----------------------------------------------------------------------------------------------------------------

function sanitizeContainersModel(containersModel) {
if (typeof(containersModel) === 'function') {
if (typeof containersModel === 'function') {
return containersModel;
}
if (Array.isArray(containersModel)) {
// |-------- is 2D array? -----------|
return Array.isArray(containersModel[0]) ? containersModel : [containersModel];
} else if (Array.isArray(containersModel)) {
// |-------- is 2D array? -----------|
return Array.isArray(containersModel[0]) ? containersModel : [containersModel];
} else if (typeof containersModel === 'string' && (o.scope || o.containersModelCtx)) {
return function () {
return o.containersModelCtx ? o.containersModelCtx[containersModel] : o.scope[containersModel];
};
} else {
return [];
}
Expand Down

0 comments on commit c483129

Please sign in to comment.