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

DOM 이동 구현 , prev, next #13

Closed
easylogic opened this issue Aug 5, 2020 · 0 comments
Closed

DOM 이동 구현 , prev, next #13

easylogic opened this issue Aug 5, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@easylogic
Copy link
Owner

현재 선택된 dom 의 부모를 기준으로 형제(sibling) Node 전후로 갈 수 있도록 구현

prev

as-is

    const currentImage = e.$dt.closest('image-item');
    const $parent = currentImage.parent(); 

    $parent.el.insertBefore(currentImage.el, currentImage.el.previousSibling)

to-be

$currentImage.movePrev(); 

next

as-is

    const currentImage = e.$dt.closest('image-item');
    const $parent = currentImage.parent(); 

    const next = currentImage.el.nextSibling

    $parent.el.insertBefore(currentImage.el, next ? next.nextSibling : null)

to-be

$currentImage.moveNext(); 
@easylogic easylogic self-assigned this Aug 5, 2020
@easylogic easylogic added the enhancement New feature or request label Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant