Skip to content

Commit ce0b91d

Browse files
committed
Update to newest Angular-UI version and fix module names
1 parent 1215c3b commit ce0b91d

File tree

4 files changed

+28
-14
lines changed

4 files changed

+28
-14
lines changed

README.md

+19-6
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ Suppose model (in AngularJS) is defined as follows
2929

3030
Define global `sortable` options that will be provided to underlying jQuery sortable plugin. Here we need to provide `connectWith` option to link several sortables together.
3131

32-
angular.module('ui.config', []).value('ui.config', {
33-
sortable: {
34-
connectWith: '.column',
35-
}
36-
});
32+
angular.module('ui.sortable').value('uiSortableConfig', {
33+
sortable: {
34+
connectWith: '.column',
35+
update: 'itemsChanged',
36+
}
37+
});
3738

3839
Define UI part as below, using `ui-multi-sortable` directive and `model-subset` attribute to point actual items' subset.
3940

@@ -57,10 +58,22 @@ It is possible to hook up own callbacks into `update`, `start` and `stop` events
5758
To invoke `$scope` function, name of this function should be provided instead of function reference.
5859
Example of defining callbacks:
5960

60-
angular.module('ui.config', []).value('ui.config', {
61+
angular.module('ui.sortable').value('uiSortableConfig', {
6162
sortable: {
6263
connectWith: '.column',
6364
update: 'changed', // $scope function called 'changed' will be invoked within Angular context
6465
start: function() { console.log('modification started'); // regular function will be invoked
6566
}
6667
});
68+
69+
Changelog
70+
-----
71+
72+
### 0.0.2
73+
74+
First version of component. Works with older versions of Angular-UI components (before project was split)
75+
76+
### 0.1.0
77+
78+
Dependencies updated to `1.0.7`for AngularJS itself and `0.0.1` for angular-ui-sortable. This version isn't backward compatible due to changes in foundation components (angular-ui-sortable).
79+

component.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"author": "Michal Ostruszka",
33
"name": "angular-ui-multi-sortba",
4-
"description": "Extension for Angular-UI sortable that adds ability to drag elements between different lists",
5-
"version": "0.0.2",
4+
"description": "Extension for Angular-UI sortable that adds ability to drag elements between different lists. Works with new angular-ui-sortable",
5+
"version": "0.1.0",
66
"homepage": "https://github.com/mostr/angular-ui-multi-sortable",
77
"repository": {
88
"type": "git",
@@ -11,6 +11,7 @@
1111
"main": "./multiSortable.js",
1212
"dependencies": {
1313
"jquery": ">= 1.8.0",
14-
"angular": ">= 1.0.2"
14+
"angular": ">= 1.0.7",
15+
"angular-ui-sortable": ">=0.0.1"
1516
}
1617
}

example/index.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<link href="styles.css" rel="stylesheet">
55
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
66
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
7-
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script>
8-
<script src="https://raw.github.com/angular-ui/angular-ui/master/build/angular-ui.js"></script>
7+
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js"></script>
8+
<script src="https://rawgithub.com/angular-ui/ui-sortable/master/src/sortable.js"></script>
99
<script src="../multiSortable.js"></script>
1010
</head>
1111

@@ -24,14 +24,14 @@
2424
<script type="text/javascript">
2525
(function(){
2626

27-
angular.module('ui.config', []).value('ui.config', {
27+
angular.module('ui.sortable').value('uiSortableConfig', {
2828
sortable: {
2929
connectWith: '.column',
3030
update: 'itemsChanged',
3131
}
3232
});
3333

34-
this.taskboard = angular.module('taskboard', ['ui']);
34+
this.taskboard = angular.module('taskboard', ['ui.sortable']);
3535

3636
this.TaskController = function($scope) {
3737
$scope.changed = 'Unfortunately not';

multiSortable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
@author: Michal Ostruszka (http://michalostruszka.pl)
77
**/
88

9-
angular.module('ui.directives').directive('uiMultiSortable', ['ui.config', '$parse', function(uiConfig, $parse) {
9+
angular.module('ui.sortable').directive('uiMultiSortable', ['uiSortableConfig', '$parse', function(uiConfig, $parse) {
1010
var options = {};
1111
if (uiConfig.sortable !== null) {
1212
angular.extend(options, uiConfig.sortable);

0 commit comments

Comments
 (0)