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

Commit 475a21a

Browse files
authored
Merge pull request #1 from angular-ui/master
Bringing up to date with the head fork
2 parents ae252a8 + e763b57 commit 475a21a

34 files changed

+7771
-262
lines changed

.bowerrc

-3
This file was deleted.

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
bower_components/
2-
node_modules/
2+
node_modules/
3+
coverage/
4+
junit/
5+
dist/
6+
out/

.jshintrc

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"boss": true,
3+
"browser": true,
4+
"curly": true,
5+
"eqnull": true,
6+
"expr": true,
7+
"immed": true,
8+
"indent": 2,
9+
"laxbreak": true,
10+
"loopfunc": true,
11+
"newcap": true,
12+
"noarg": true,
13+
"noempty": true,
14+
"nonew": true,
15+
"quotmark": true,
16+
"smarttabs": true,
17+
"sub": true,
18+
"trailing": true,
19+
"undef": true,
20+
"unused": true,
21+
"globals": {
22+
"angular": false
23+
}
24+
}

.npmignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
bower_components/
2+
node_modules/
3+
coverage/
4+
junit/
5+
# dist/
6+
out/

.prettierrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"single-quote": true
3+
}

.travis.yml

+39-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,42 @@
11
language: node_js
22
node_js:
3-
- "0.8"
4-
3+
- '6'
4+
addons:
5+
firefox: "54.0.1"
56
before_install:
6-
- export DISPLAY=:99.0
7-
- sh -e /etc/init.d/xvfb start
8-
- npm install -g bower grunt-cli
9-
- npm install
10-
- bower install
11-
12-
script: "grunt"
7+
- export DISPLAY=:99.0
8+
- sh -e /etc/init.d/xvfb start
9+
- npm install -qg bower grunt grunt-cli
10+
- npm install -q
11+
- bower install
12+
after_success:
13+
- ./node_modules/angular-ui-publisher/travis/authentication.sh || exit 0
14+
- grunt dist build:gh-pages publish:gh-pages build:bower publish:bower
15+
script: grunt
16+
env:
17+
global:
18+
- REPO="[email protected]:angular-ui/ui-sortable.git"
19+
- secure: lv6/NYEdeaQi/ITVGbmWLdj2LoHjrMaF511YoDOOEWjdtCZPUmIciMYDvDidaLzr5NKgtaQCzGouHIgbdM2r+blJndTB+fydXYw3nq9qvRsXRGbWH0TY2KtdB++73NhomHN2kOYAx7IOW7XN+StWG6kdBFJ6lDOZl9vOZTHnHvE=
20+
- secure: A6zLTHw99hvJ37FNKPnW4y6Eu/G+1M7NEw4vgWDlyH96RB0QYYvRKuHVn68FRBtHSdcaFzuANjzxeE0QEBBhq4kM4AjsQtveBHJcTBDZGnzZB7krH1E8yrNH70EWI8b3bXsWzUaYeNgUMFJpFa1pEMWq2rCe0CwEFVHf8TlF7MI=
21+
- secure: BEWMRv9ET7fXabDkAvRQJBsIziyDeYrVkXDEINgdDwaoNclYtDSnxyYMG1wAcoNM6Znb8MdcmZm2SaOUOxIwplukomh1i8oT6wXeEl+vaYoCS6kz9iwcqgE0rFx9Zo+9q+UCvst30aB//XtVt71tbpKYaNTilZH2U6gvmUxYUAM=
22+
- secure: SbIj+dXPq3y+cREpT+GoXBflKr2SmonL+ini3Q+7EL+82xMbqnTYRRdVvSBOAbK35fskBgDec91kuF2jKKvi3n2kYLWqYC5a6MteMsD/Ne7ntmebSZ4xIoI2CnHnYMoh8X5r2R5ykAu9phKDb6ujNol2bSI/2UBeSXse1ROp6M8=
23+
- secure: RCFXr57oVjSOnM28rYMSfi4xlU70R5bjbDU+NUhQ+Mw7S1Bz1B0F+ZwMRuXDz2GnBnA+2Vu6i6qY0TWxfd7SAkG7+mW8hKc7OrHjYSt6tPPeCfwx6fcnFF6wxWR5fOt47aX4sNnOkaAoPQa2rf6uPHknTP0mVJgX//hsS++8orw=
24+
- secure: VPb2CQUyWC0BY5Pf2qJpUBEV3nPvvxeQYMZ/woVy53TN+EL0n0un70Ia9ddGBljcRLYht08lRnf8SMnSkpCyqtDGVY/XskzdR7D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um99vSwxUkqyTpR5Gl8N7bu51bbRzGwTFqAQoxiIc2bEpSwVyql0okLnYsaZVDOjlyuAqZ1RRj+xBfcUrI=
37+
- secure: ZoIMbOS9tUpCEZyWGEzkNITPvPorJ+d7n3yMGJqhD6Ud7n6oFyLskT7JECZ4cUiykVaWsAHGMN+xxYLUkAJLdhd2gE3reN+8JrSjJb32W0Sf+5z1ajcwWBsZu4nyxRpPo2QZduS7lU2M0+YdFs8qG7gEhploFDu7hZOI2RaCkTo=
38+
- secure: DZhkAksHSU8MGN0dISwGWA2uuMEvxpeSmqJu2fpPTei//n5l/n+RqlfYH8hUKdMf87RBpXRY1VpHiFYpkNYsmf903gw3kdRWhW07hG3Yt9hXc+YIR0OK6KZ5sb/XZi/ZkWrPEInAL2Yol00e6+U13134SZlPE84P6ktXiKKtlMc=
39+
- secure: Cy34UQZ7/9toUKV6905XYeXIaFdDRhLb+ibEbLnjoo3ifeApNaecc1l4aBN88HN6nKnX1TKSZyiETwCpCWCee2d7KTi4IhSFTAa+SVUTV6BmikhdUs6MwemyreyWFlxZD32huZKyWU9ZEAwwQ0Oq9gPqECWWZkdT4LInF6SLWLY=
40+
- secure: E9gahGC9Swvy83Kos9LhFsxZp/zBI6Ll9lqQd6HxT7YSXj2YeoxSMCsF629bODPdtuMirhmFqReKZKL1lDpJBswr1sFtnmVavSwVBW4v/CIAQu0ENC85Knv1wgoAcl7cRisWaueSHJ0DyNstZZWGNWryIINg9zjFdrOSztDvoN8=
41+
- secure: UxCvWwq2GcUdL3BtJyRMEFPHPRGIdPPLthThmWrmUE7dnblpDUdWVXKc62f7Y42qtHlhYh1EjxX0GJFcS1F0Lfge0e0cxDNWBATBoLKpC67kTyz/cUgqFEv6tsbkziBtbOrBuy6/LMZly1BqG/3fIDEJezkKOIqHF+pdApvAC/8=
42+
- secure: LY+rU4ouy35DfnXdTumu+lPQsMPzNWQktXlms1YG1jWqOs7As223fLQAFe5tyVs34K0xQsPCq3whfaDCd4ZNVYLO3srsXSuRpDw8DRt1fQhhVJo8IBI+Yv92FiFZr54BsBxM4Wzt8hFWEzDlIgziOYSriSXMuBomMHXbtm5vkzg=

API.md

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# ui.item.sortable API documentation
2+
3+
This refers to the additional properties that are exposed through the `ui` parameter in the provided callback hooks. eg:
4+
```js
5+
$scope.sortableOptions = {
6+
update: function(e, ui) {
7+
if (ui.item.sortable.model == "can't be moved") {
8+
ui.item.sortable.cancel();
9+
}
10+
}
11+
};
12+
```
13+
14+
## Properties
15+
16+
**Note:**
17+
The properties of `ui.item.sortable` object are cleared right after the stop callback fires. If you need to access them after the sorting ends, you should keep references in separate variables in your code.
18+
19+
### dropindex
20+
Type: [Integer](http://api.jquery.com/Types/#Integer)
21+
Holds the index of the drop target that the dragged item was dropped.
22+
23+
24+
### droptarget
25+
Type: [jQuery](http://api.jquery.com/Types/#jQuery)
26+
Holds the ui-sortable element that the dragged item was dropped on.
27+
28+
### droptargetModel
29+
Type: [Array](http://api.jquery.com/Types/#Array)
30+
Holds the array that is specified by the `ng-model` attribute of the [`droptarget`](#droptarget) ui-sortable element.
31+
32+
### index
33+
Type: [Integer](http://api.jquery.com/Types/#Integer)
34+
Holds the original index of the item dragged.
35+
36+
### model
37+
Type: [Object](http://api.jquery.com/Types/#Object)
38+
Holds the JavaScript object that is used as the model of the dragged item, as specified by the ng-repeat of the [`source`](#source) ui-sortable element and the item's [`index`](#index).
39+
40+
### moved
41+
Type: [Object](http://api.jquery.com/Types/#Object)/`undefined`
42+
Holds the model of the dragged item only when a sorting happens between two connected ui-sortable elements.
43+
In other words: `'moved' in ui.item.sortable` will return false only when a sorting is withing the same ui-sortable element ([`source`](#source) equals to the [`droptarget`](#droptarget)).
44+
45+
### received
46+
Type: [Boolean](http://api.jquery.com/Types/#Boolean)
47+
When sorting between two connected sortables, it will be set to true inside the `update` callback of the [`droptarget`](#droptarget).
48+
49+
### source
50+
Type: [jQuery](http://api.jquery.com/Types/#jQuery)
51+
Holds the ui-sortable element that the dragged item originated from.
52+
53+
### sourceModel
54+
Type: [Array](http://api.jquery.com/Types/#Array)
55+
Holds the array that is specified by the `ng-model` of the [`source`](#source) ui-sortable element.
56+
57+
58+
## Methods
59+
60+
### cancel[()](http://api.jquery.com/Types/#Function)
61+
Returns: Nothing
62+
Can be called inside the `update` callback, in order to prevent/revert a sorting.
63+
Should be used instead of the [jquery-ui-sortable cancel()](http://api.jqueryui.com/sortable/#method-cancel) method.
64+
65+
### isCanceled[()](http://api.jquery.com/Types/#Function)
66+
Returns: [Boolean](http://api.jquery.com/Types/#Boolean)
67+
Returns whether the current sorting is marked as canceled, by an earlier call to [`ui.item.sortable.cancel()`](#cancel).
68+
69+
### isCustomHelperUsed[()](http://api.jquery.com/Types/#Function)
70+
Returns: [Boolean](http://api.jquery.com/Types/#Boolean)
71+
Returns whether the [`helper`](http://api.jqueryui.com/sortable/#option-helper) element used for the current sorting, is one of the original ui-sortable list elements.
72+
73+
74+
## Events
75+
76+
### `ui-sortable:moved`
77+
Is emitted after the `stop` callback.
78+
In connected sortables it is also emitted after the `update` on the receiving sortable.
79+
80+
```js
81+
$rootScope.$on('ui-sortable:moved', function (e, ui) {
82+
83+
});
84+
```

CONTRIBUTING.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Contributing to UI Sortable
2+
3+
## Reporting Issues
4+
5+
The following examples are provided as a good starting point to demonstrate issues, proposals and use cases.
6+
Feel free to edit any of them for your needs (don't forget to also update the libraries used to your version).
7+
8+
* [Simple Demo](http://codepen.io/thgreasi/pen/jlkhr)
9+
* [Connected Lists](http://codepen.io/thgreasi/pen/uFile)
10+
11+
Since some issues may be caused by jquery-ui-sortable and not by the wrapping that angular-ui-sortable does,
12+
please try your use case using [this plain jquery-ui sortable example](http://codepen.io/thgreasi/pen/rarQvR) before opening a new issue in the repositry.

0 commit comments

Comments
 (0)