Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 0adb9bd

Browse files
committed
Merge pull request #116 from thgreasi/master
Merge angular1.2 branch into master.
2 parents af50123 + 11df76e commit 0adb9bd

13 files changed

+1132
-778
lines changed

.jshintrc

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"expr": true,
66
"globalstrict": true,
77
"immed": true,
8+
"indent": 2,
89
"laxbreak": true,
910
"loopfunc": true,
1011
"newcap": true,

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
The following examples are provided as a good starting point to demonstrate issues, proposals and use cases.
66
Feel free to edit any of them for your needs (don't forget to also update the libraries used to your version).
77

8-
* [Simple Demo](http://codepen.io/thgreasi/pen/BlFLp)
9-
* [Connected Lists](http://codepen.io/thgreasi/pen/apwsb)
8+
* [Simple Demo](http://codepen.io/thgreasi/pen/jlkhr)
9+
* [Connected Lists](http://codepen.io/thgreasi/pen/uFile)

README.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ This directive allows you to sort array with drag & drop.
66

77
- JQuery
88
- JQueryUI
9-
- AngularJS 1.0.x
10-
11-
**Note for AngularJS 1.2 users:** Use the separate branch `angular1.2`.
129

1310
## Usage
1411

@@ -39,7 +36,6 @@ Apply the directive to your form elements:
3936
Otherwise the index matching of the generated DOM elements and the `ng-model`'s items will break.
4037
* `ui-sortable` lists containing many 'types' of items can be implemented by using [dynamic template loading with ng-include](http://stackoverflow.com/questions/14607879/angularjs-load-dynamic-template-html-within-directive/14621927#14621927), to determine how each model item should be rendered.
4138

42-
4339
### Options
4440

4541
All the jQueryUI Sortable options can be passed through the directive.
@@ -70,7 +66,7 @@ Inside the `update` callback, you can check the item that is dragged and cancel
7066
$scope.sortableOptions = {
7167
update: function(e, ui) {
7268
if (ui.item.scope().item == "can't be moved") {
73-
ui.item.parent().sortable('cancel');
69+
ui.item.sortable.cancel();
7470
}
7571
}
7672
};
@@ -84,8 +80,8 @@ So `ui.item.scope` and the directive's `ng-model`, are equal to the scope before
8480
The following pen's are provided as a good starting point to demonstrate issues, proposals and use cases.
8581
Feel free to edit any of them for your needs (don't forget to also update the libraries used to your version).
8682

87-
- [Simple Demo](http://codepen.io/thgreasi/pen/BlFLp)
88-
- [Connected Lists](http://codepen.io/thgreasi/pen/apwsb)
83+
- [Simple Demo](http://codepen.io/thgreasi/pen/jlkhr)
84+
- [Connected Lists](http://codepen.io/thgreasi/pen/uFile)
8985

9086

9187
## Testing

bower.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-ui-sortable",
3-
"version": "0.10.1",
3+
"version": "0.12.0",
44
"description": "This directive allows you to jQueryUI Sortable.",
55
"author": "https://github.com/angular-ui/ui-sortable/graphs/contributors",
66
"license": "MIT",
@@ -16,11 +16,11 @@
1616
"package.json"
1717
],
1818
"dependencies": {
19-
"angular": "~1.0.x",
19+
"angular": "~1.2.x",
2020
"jquery-ui": ">= 1.9"
2121
},
2222
"devDependencies": {
23-
"angular-mocks": "~1.0.x",
23+
"angular-mocks": "~1.2.x",
2424
"jquery-simulate": "latest"
2525
}
2626
}

gruntFile.js

+18-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = function(grunt) {
88
grunt.registerTask('default', ['jshint', 'karma:unit']);
99
grunt.registerTask('serve', ['karma:continuous', 'dist', 'build:gh-pages', 'connect:continuous', 'watch']);
1010
grunt.registerTask('dist', ['ngmin', 'uglify']);
11+
grunt.registerTask('coverage', ['jshint', 'karma:coverage']);
1112

1213

1314
// HACK TO ACCESS TO THE COMPONENT PUBLISHER
@@ -65,7 +66,17 @@ module.exports = function(grunt) {
6566
karma: {
6667
unit: testConfig('test/karma.conf.js'),
6768
server: {configFile: 'test/karma.conf.js'},
68-
continuous: {configFile: 'test/karma.conf.js', background: true }
69+
continuous: {configFile: 'test/karma.conf.js', background: true },
70+
coverage: {
71+
configFile: 'test/karma.conf.js',
72+
reporters: ['progress', 'coverage'],
73+
preprocessors: { 'src/*.js': ['coverage'] },
74+
coverageReporter: {
75+
type : 'html',
76+
dir : 'coverage/'
77+
},
78+
singleRun: true
79+
}
6980
},
7081

7182
jshint: {
@@ -118,6 +129,12 @@ module.exports = function(grunt) {
118129
}
119130
},
120131

132+
changelog: {
133+
options: {
134+
dest: 'CHANGELOG.md'
135+
}
136+
},
137+
121138
watch: {
122139
src: {
123140
files: ['src/*'],

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-ui-sortable",
3-
"version": "0.10.1",
3+
"version": "0.12.0",
44
"description": "This directive allows you to jQueryUI Sortable.",
55
"author": "https://github.com/angular-ui/ui-sortable/graphs/contributors",
66
"license": "MIT",
@@ -14,11 +14,13 @@
1414
"grunt-contrib-jshint": "0.8.x",
1515
"grunt-contrib-uglify": "0.2.x",
1616
"grunt-contrib-watch": "0.5.x",
17+
"grunt-conventional-changelog": "~1.0.0",
1718
"grunt-karma": "0.6.x",
1819
"grunt-ngmin": "0.0.x",
1920
"karma": "0.10.x",
2021
"karma-chrome-launcher": "0.1.x",
2122
"karma-coffee-preprocessor": "0.1.x",
23+
"karma-coverage": "~0.1",
2224
"karma-firefox-launcher": "0.1.x",
2325
"karma-html2js-preprocessor": "0.1.x",
2426
"karma-jasmine": "0.1.x",

0 commit comments

Comments
 (0)