forked from bevacqua/angularjs-dragula
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ec7e9b4
Showing
26 changed files
with
30,146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
npm-debug.log | ||
.DS_Store | ||
Thumbs.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
bower_components | ||
dist | ||
example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"curly": true, | ||
"eqeqeq": true, | ||
"newcap": true, | ||
"noarg": true, | ||
"noempty": true, | ||
"nonew": true, | ||
"sub": true, | ||
"undef": true, | ||
"unused": true, | ||
"trailing": true, | ||
"boss": true, | ||
"eqnull": true, | ||
"strict": true, | ||
"immed": true, | ||
"expr": true, | ||
"latedef": "nofunc", | ||
"quotmark": "single", | ||
"validthis": true, | ||
"indent": 2, | ||
"node": true, | ||
"browser": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
'use strict'; | ||
|
||
var dragula = require('dragula'); | ||
var dragulaService = require('./service'); | ||
var replicateEvents = require('./replicate-events'); | ||
|
||
function register (angular) { | ||
var app = angular.module('dragula', ['ng']); | ||
|
||
app.factory('dragulaService', dragulaService); | ||
app.directive('dragula', ['dragulaService', angularDragula]); | ||
|
||
return 'dragula'; | ||
|
||
function angularDragula (dragulaService) { | ||
return { | ||
restrict: 'A', | ||
link: link | ||
}; | ||
|
||
function link (scope, elem, attrs) { | ||
var container = elem[0]; | ||
var name = scope.$eval(attrs.dragula); | ||
var bag = dragulaService.find(scope, name); | ||
if (bag) { | ||
bag.drake.containers.push(container); return; | ||
} | ||
var drake = dragula({ | ||
containers: [container] | ||
}); | ||
var destroyDrake = drake.destroy; | ||
drake.destroy = destroy; | ||
bag = dragulaService.add(scope, name, drake); | ||
replicateEvents(angular, bag, scope); | ||
function destroy () { | ||
dragulaService.remove(scope, name); | ||
destroyDrake.call(drake); | ||
} | ||
} | ||
} | ||
} | ||
|
||
module.exports = register; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "angular-dragula", | ||
"version": "0.0.0", | ||
"description": "Drag and drop so simple it hurts", | ||
"main": [ | ||
"dist/angular-dragula.js", | ||
"dist/dragula.css" | ||
], | ||
"ignore": [], | ||
"homepage": "https://github.com/bevacqua/angular-dragula", | ||
"authors": [ | ||
"Nicolas Bevacqua <[email protected]>" | ||
], | ||
"license": "MIT" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# 1.0.1 Atog | ||
|
||
- Use `atoa` instead of casting things on our own | ||
- Cast `arguments` to true array when applying it onto `dragula` | ||
|
||
# 1.0.0 IPO | ||
|
||
- Initial Public Release |
Oops, something went wrong.