-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Use Sortable to move entities in entities editor #6810
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a0fc4aa
Use Sortable to move entities in entities editor
zsarnett 05edc85
Make it actually work
zsarnett c25b398
comment
zsarnett 6325183
Remove array result
zsarnett acba1ee
Change comment from copy pasta
zsarnett 5fc3126
make styles a css result - Not working
zsarnett e3ac8be
Fix it
zsarnett 53c4b96
rename and move
zsarnett 42418ab
lint
zsarnett File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,77 +1,75 @@ | ||
| import { html } from "lit-element"; | ||
| import { css } from "lit-element"; | ||
|
|
||
| export const sortStyles = html` | ||
| <style> | ||
| #sortable a:nth-of-type(2n) paper-icon-item { | ||
| animation-name: keyframes1; | ||
| animation-iteration-count: infinite; | ||
| transform-origin: 50% 10%; | ||
| animation-delay: -0.75s; | ||
| animation-duration: 0.25s; | ||
| } | ||
| export const sortableStyles = css` | ||
| #sortable a:nth-of-type(2n) paper-icon-item { | ||
| animation-name: keyframes1; | ||
| animation-iteration-count: infinite; | ||
| transform-origin: 50% 10%; | ||
| animation-delay: -0.75s; | ||
| animation-duration: 0.25s; | ||
| } | ||
|
|
||
| #sortable a:nth-of-type(2n-1) paper-icon-item { | ||
| animation-name: keyframes2; | ||
| animation-iteration-count: infinite; | ||
| animation-direction: alternate; | ||
| transform-origin: 30% 5%; | ||
| animation-delay: -0.5s; | ||
| animation-duration: 0.33s; | ||
| } | ||
| #sortable a:nth-of-type(2n-1) paper-icon-item { | ||
| animation-name: keyframes2; | ||
| animation-iteration-count: infinite; | ||
| animation-direction: alternate; | ||
| transform-origin: 30% 5%; | ||
| animation-delay: -0.5s; | ||
| animation-duration: 0.33s; | ||
| } | ||
|
|
||
| #sortable { | ||
| outline: none; | ||
| display: flex; | ||
| flex-direction: column; | ||
| } | ||
|
|
||
| .sortable-ghost { | ||
| opacity: 0.4; | ||
| } | ||
| #sortable { | ||
| outline: none; | ||
| display: flex; | ||
| flex-direction: column; | ||
| } | ||
|
|
||
| .sortable-fallback { | ||
| opacity: 0; | ||
| } | ||
| .sortable-ghost { | ||
| opacity: 0.4; | ||
| } | ||
|
|
||
| @keyframes keyframes1 { | ||
| 0% { | ||
| transform: rotate(-1deg); | ||
| animation-timing-function: ease-in; | ||
| } | ||
| .sortable-fallback { | ||
| opacity: 0; | ||
| } | ||
|
|
||
| 50% { | ||
| transform: rotate(1.5deg); | ||
| animation-timing-function: ease-out; | ||
| } | ||
| @keyframes keyframes1 { | ||
| 0% { | ||
| transform: rotate(-1deg); | ||
| animation-timing-function: ease-in; | ||
| } | ||
|
|
||
| @keyframes keyframes2 { | ||
| 0% { | ||
| transform: rotate(1deg); | ||
| animation-timing-function: ease-in; | ||
| } | ||
|
|
||
| 50% { | ||
| transform: rotate(-1.5deg); | ||
| animation-timing-function: ease-out; | ||
| } | ||
| 50% { | ||
| transform: rotate(1.5deg); | ||
| animation-timing-function: ease-out; | ||
| } | ||
| } | ||
|
|
||
| .hide-panel { | ||
| display: none; | ||
| position: absolute; | ||
| right: 8px; | ||
| @keyframes keyframes2 { | ||
| 0% { | ||
| transform: rotate(1deg); | ||
| animation-timing-function: ease-in; | ||
| } | ||
|
|
||
| :host([expanded]) .hide-panel { | ||
| display: inline-flex; | ||
| 50% { | ||
| transform: rotate(-1.5deg); | ||
| animation-timing-function: ease-out; | ||
| } | ||
| } | ||
|
|
||
| paper-icon-item.hidden-panel, | ||
| paper-icon-item.hidden-panel span, | ||
| paper-icon-item.hidden-panel ha-icon[slot="item-icon"] { | ||
| color: var(--secondary-text-color); | ||
| cursor: pointer; | ||
| } | ||
| </style> | ||
| .hide-panel { | ||
| display: none; | ||
| position: absolute; | ||
| right: 8px; | ||
| } | ||
|
|
||
| :host([expanded]) .hide-panel { | ||
| display: inline-flex; | ||
| } | ||
|
|
||
| paper-icon-item.hidden-panel, | ||
| paper-icon-item.hidden-panel span, | ||
| paper-icon-item.hidden-panel ha-icon[slot="item-icon"] { | ||
| color: var(--secondary-text-color); | ||
| cursor: pointer; | ||
| } | ||
| `; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.