-
Notifications
You must be signed in to change notification settings - Fork 716
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
[NEW] Adds drag-and-drop on sidebar #539
Conversation
it allows you to reorder it and then saves it using localstorage
localStorage.setItem(this.sortOrderKey, JSON.stringify(this.sortOrder)); | ||
|
||
const url = sideBarElement.dataset.host; | ||
const host = { url, title: sideBarElement.querySelector('div.tooltip').innerHTML }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add the active
class to the selected server as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done! it should be after recreating the servers on the sidebar, so I put it on the end of the drop listener
src/scripts/sidebar.js
Outdated
}); | ||
Object.values(servers.hosts) | ||
.sort((a, b) => { | ||
const orderA = this.sortOrder.indexOf(a.url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for consts here IMO, just return the values.
@vcapretz can you post a gif showing the feature? |
@rodrigok added on the the first comment! |
when dropping the dragged server on the final position it should be set as the active one
* Adds drag-and-drop on sidebar it allows you to reorder it and then saves it using localstorage * Set active to the dragged server when dropping the dragged server on the final position it should be set as the active one
@RocketChat/DesktopApp
Closes #214
this feature introduce the option to drag and drop servers on sidebar, it uses localstorage to save it so when you open the app again it should keep the order