Skip to content

Update jquery.nestable.js#1

Open
jcroucher wants to merge 1 commit intoyhnavein:masterfrom
jcroucher:patch-1
Open

Update jquery.nestable.js#1
jcroucher wants to merge 1 commit intoyhnavein:masterfrom
jcroucher:patch-1

Conversation

@jcroucher
Copy link

The line var parentItem = el.parent().parent(); was getting the wrong level in my code. I commented out the second parent which now works.
I also added the ability to get the previous child item prevSibling: el.prev().data('id')
This allows me to move a tree of items up and down in the one level and also between levels.

Sample HTML

`




  1. ITEM-NAME




  2. ITEM-NAME

`

The line var parentItem = el.parent().parent(); was getting the wrong level in my code. I commented out the second parent which now works.
I also added the ability to get the previous child item prevSibling: el.prev().data('id')
This allows me to move a tree of items up and down in the one level and also between levels.

Sample HTML

<ol class="dd-list" data-id="ITEM-ID">
	<li class="dd-item" data-id="ITEM-ID">
        <div class="dd-handle">
        	ITEM-NAME
        </div>
    </li>
    <li class="dd-item" data-id="ITEM-ID">
        <div class="dd-handle">
        	ITEM-NAME
        </div>
    </li>
</ol>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant