Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I set more variables in the array? #119

Open
wants to merge 83 commits into
base: 2.0alpha
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
ff9b3be
Forgot ; in $.each()
Nytrm Oct 3, 2013
a56e305
Added ability to skip items with disabledClass. Useful when sorting …
poscar Jan 17, 2014
3b03132
Added disabledClass option to README.
poscar Jan 17, 2014
4fa262d
Fixed skipping over disabled elements when they are visible.
poscar Jan 17, 2014
f36d074
Allows starting individual branches expanded or collapsed
dustinbolton Jan 22, 2014
9cf554a
Merge commit 'refs/pull/upstream/115' into 2.0alpha
May 16, 2014
46f2ee7
Merge commit 'refs/pull/upstream/107' into 2.0alpha
May 16, 2014
163a1db
add relocate event per
May 19, 2014
fa0b9a2
add an example page based on the original, with 4 levels deep, custom
May 21, 2014
ef4d379
update link in README for new example and remove paypal begging since
May 21, 2014
2a376ec
forgot to update a link
May 21, 2014
2d26c23
remove maintainer needed notice...the community can pick this up
May 21, 2014
7e88e62
whoops, remove relative path for the js file
May 21, 2014
c67cf9d
copypasta error
May 21, 2014
33c22e2
css fix
May 21, 2014
f0fa368
http/https fix
May 21, 2014
8103511
see if github previews plays nice this way
May 21, 2014
5a4675d
fix demo link
May 21, 2014
a7a4ef6
disableParentChange option added.
twicejr May 28, 2014
c68bad7
Merge pull request #1 from twicejr/2.0alpha
Jun 9, 2014
0764472
Explain new disableParentChange option.
twicejr Jun 19, 2014
c155b4b
Merge pull request #3 from twicejr/patch-2
Jun 20, 2014
9c1d399
load as AMD module if AMD is available
jeffreymb Sep 2, 2014
dd49cab
Merge pull request #6 from Icode4food/amd_loading
Sep 2, 2014
d818b87
Protocol neutral references
michamilz Dec 2, 2014
5167203
Merge pull request #23 from michamilz/patch-1
Dec 7, 2014
152ee6c
Add JSCS config
cameronprattedwards Jan 2, 2015
8006976
Consistently use double quotes
cameronprattedwards Jan 2, 2015
4148d92
Fix all other codestyle errors
cameronprattedwards Jan 2, 2015
7086520
Use ESLint
cameronprattedwards Jan 2, 2015
e44f995
Use accidental global usage
cameronprattedwards Jan 2, 2015
abe72e7
Allow dangling underscores
cameronprattedwards Jan 2, 2015
6e304d3
Fix eqeqeq errors
cameronprattedwards Jan 2, 2015
61428b8
Fix grab bag of linting errors
cameronprattedwards Jan 2, 2015
f207a71
Fix whitespace errors
cameronprattedwards Jan 2, 2015
ff42af9
Allow in-loop functions and use-before-define
cameronprattedwards Jan 2, 2015
76e26e9
Merge pull request #32 from cameronprattedwards/topics/code-style
Jan 3, 2015
1f26460
Merge pull request #33 from cameronprattedwards/topics/use-strict
Jan 3, 2015
c8ad673
Fix underscore bug
cameronprattedwards Jan 5, 2015
d361da2
Fix this bugs
cameronprattedwards Jan 5, 2015
93c1087
Merge pull request #35 from cameronprattedwards/fix/identity
Jan 9, 2015
d6f6068
Possible solution for triggering relocate event correctly
twicejr Jan 12, 2015
f785480
Fix relocate event; execution was aynchronous. Now uses _clear functi…
twicejr Jan 14, 2015
5a8e1fe
Merge pull request #36 from twicejr/patch-3
Jan 14, 2015
348d2cf
Define 'a'
cameronprattedwards Feb 5, 2015
998bd41
Fix protectRoot logic
cameronprattedwards Feb 5, 2015
5c5edd9
Merge pull request #40 from cameronprattedwards/fix/protectroot-logic
Feb 11, 2015
8c354da
Merge pull request #39 from cameronprattedwards/topics/fix-top-sorting
Feb 11, 2015
b06095c
Fixing bug in jQuery selector
gregshutt Feb 13, 2015
ed53026
Merge pull request #42 from gregshutt/2.0alpha
Feb 19, 2015
ff5ce6e
Fix parent container when dragging top-down
dangoodman Mar 4, 2015
25e74f6
Merge pull request #46 from dangoodman/2.0alpha
Mar 6, 2015
4495125
Fix bug
fonclub Mar 7, 2015
7a22321
Merge pull request #47 from fonclub/2.0alpha
Mar 8, 2015
b28d1ad
Fixed disableParentChange always preventing sorting on root.
ccHanibal Mar 9, 2015
e304ca3
Keep branchClass on root item if protectRoot is true
dangoodman Mar 9, 2015
950833a
Merge pull request #49 from dangoodman/2.0alpha
Mar 17, 2015
41fc8ca
Merge pull request #48 from ccHanibal/2.0alpha
Mar 17, 2015
70bf5fd
Fix helper positioning bug when window scrolled
Apr 2, 2015
515ab44
Merge pull request #51 from tjdraper/2.0alpha
Apr 23, 2015
1824fe3
Adding Meteor support.
andyp22 May 9, 2015
e29e6c5
Adding Meteor install instructions.
andyp22 May 9, 2015
85c546a
Pointing to ilikenwf.
andyp22 May 9, 2015
e5a3cd2
Pointing to ilikenwf.
andyp22 May 9, 2015
8250338
Merge pull request #54 from andyp22/2.0alpha
May 11, 2015
24a7e49
Fixed scrolling offset problem.
May 22, 2015
e0a3568
Merge pull request #55 from cuddlyogre/2.0alpha
May 23, 2015
d0dab69
Added package.json.
abzainuddin Jul 24, 2015
bc116e9
Merge pull request #60 from CodeYellowBV/2.0alpha
Jul 24, 2015
1517ef8
added bower file
themepixels Nov 16, 2015
397fa6f
Merge pull request #66 from themepixels/themepixels-patch-1
Nov 17, 2015
674b349
Add ability to use data- attributes to show up in the hierarchy.
bfcoder Dec 16, 2015
df0e967
Merge pull request #67 from bfcoder/data-attr
Dec 20, 2015
e33527b
add element data to array
amin101 Jan 17, 2016
ff8d438
add element name to array
amin101 Jan 17, 2016
695d128
change item_id to id
amin101 Jan 17, 2016
14a4731
start root node from 0 not 1
amin101 Jan 17, 2016
747d42c
Merge pull request #77 from amin101/2.0alpha
Jan 18, 2016
5e0e952
Update version to 2.0b1
AlexHill Feb 4, 2016
2c2943c
Merge pull request #79 from AlexHill/patch-1
Feb 4, 2016
5d29a45
r.js support
eanekrasov Feb 18, 2016
0812aa1
Merge pull request #81 from eanekrasov/2.0alpha
Feb 19, 2016
8fdc6a1
v2.0 - also moving dev to master
Mar 31, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"globals": {
"window": false,
"document": false
},
"rules": {
"no-underscore-dangle": false,
"no-loop-func": false,
"no-use-before-define": false
}
}
3 changes: 3 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"preset": "jquery"
}
38 changes: 24 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
**ANNOUNCEMENT**

**I'm sorry to say that I am not able to keep up the pace in developing this project anymore. I know how much nestedSortable is important for web applications, and I still can't understand why it's not part of jQuery-UI. I also think the base of the plugin is very strong, and deserves much more attention and involvement.**
**If anybody is willing to take this project, please say so [here](https://github.com/mjsarfatti/nestedSortable/issues/95).**
**Thank you.**

# nestedSortable jQuery plugin

**nestedSortable** is a jQuery plugin that extends jQuery Sortable UI functionalities to nested lists.
*Note: Version 2.0 is published in branch '2.0alpha' and is available for testing. At the moment it has only been tested in Firefox and Chrome, if you work with IE feel free to give it a shot and let me know if something goes wrong.*

## Meteor Installation
meteor add ilikenwf:nested-sortable

## What's new in version 2.0

The biggest change is that your nested list can now behave as a tree with expand/collapse funcionality. Simply set `isTree` to **true** in the options and you are good to go! Check the [demo](http://mjsarfatti.com/sandbox/nestedSortable) out to see what can be done with nestedSortable and a little CSS. (Note that all **nestedSortable** does is to assign/remove classes on the fly)
The biggest change is that your nested list can now behave as a tree with expand/collapse funcionality. Simply set `isTree` to **true** in the options and you are good to go! Check the [demo](http://ilikenwf.github.io/example.html) out to see what can be done with nestedSortable and a little CSS. (Note that all **nestedSortable** does is to assign/remove classes on the fly)
Also:
- **isAllowed** function finally works as expected, see the docs below
- Fixed: a small bug in the **protectRoot** function
Expand All @@ -28,6 +24,7 @@ Also:
- All jQuery Sortable options, events and methods are available
- It is possible to define elements that will not accept a new nested item/list and a maximum depth for nested items
- The root level can be protected
- The parentship of items can be locked, just as if it was a family tree.

## Usage

Expand Down Expand Up @@ -61,11 +58,13 @@ Please note: every `<li>` must have either one or two direct children, the first

Also, the default list type is `<ol>`.

*This is the bare minimum to have a working nestedSortable. Check the [demo](http://mjsarfatti.com/sandbox/nestedSortable) out to see what can be accomplished with a little more.*
*This is the bare minimum to have a working nestedSortable. Check the [demo](http://ilikenwf.github.io/example.html) out to see what can be accomplished with a little more.*

## Custom Options

<dl>
<dt>disableParentChange (2.0)</dt>
<dd>Set this to true to lock the parentship of items. They can only be re-ordered within theire current parent container.</dd>
<dt>doNotClear (2.0)</dt>
<dd>Set this to true if you don't want empty lists to be removed. Default: <b>false</b></dd>
<dt>expandOnHover (2.0)</dt>
Expand Down Expand Up @@ -109,6 +108,8 @@ Also, the default list type is `<ol>`.
<dd>Given to collapsed branches when dragging an item over them. Default: <b>mjs-nestedSortable-hovering</b></dd>
<dt>leafClass (2.0)<dt>
<dd>Given to items that do not have children. Default: <b>mjs-nestedSortable-leaf</b></dd>
<dt>disabledClass (2.0)<dt>
<dd>Given to items that should be skipped when sorting over them. For example, non-visible items that are still part of the list. Default: <b>mjs-nestedSortable-disabled</b></dd>
</dl>

## Custom Methods
Expand Down Expand Up @@ -143,7 +144,21 @@ Also, the default list type is `<ol>`.
'2' ...
'id' => itemId
</pre>
Similarly to <code>toArray</code>, it accepts <b>attribute</b> and <b>expression</b> options.</dd>
Similarly to <code>toArray</code>, it accepts <b>attribute</b> and <b>expression</b> options.
Optionally adding `data-` attributes will cause them to show up in the hierarchy. See demo for example.
</dd>
</dl>

## Events
<dl>
<dt>change</dt>
<dd>Fires when the item is dragged to a new location. This triggers for each location it is dragged into not just the ending location.
<dt>sort</dt>
<dd>Fires when the item is dragged.</dd>
<dt>revert</dt>
<dd>Fires once the object has moved if the new location is invalid.</dd>
<dt>relocate</dt>
<dd>Only fires once when the item is done bing moved at its final location.</dd>
</dl>

## Known Bugs
Expand All @@ -163,8 +178,3 @@ Tested with: Firefox, Chrome

This work is licensed under the MIT License.
Which means you can do pretty much whatever you want with it.

Nonetheless if this plugin saved you money, saved you time or saved your life please take a moment to think about the work I've been doing for you and consider sharing a bit of your joy with me. Your donation, however small, will be greatly appreciated.
Thank you.

[Donate with PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=RSJEW3N9PRMYY&lc=IT&item_name=Manuele%20Sarfatti&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)
6 changes: 6 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "nestedSortable",
"version": "2.0",
"main": "",
"license": "MIT"
}
Loading