mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
improve multi selection sidebar opening and closing
this patch changes the open/close behavior of the sidebar when activating and deactiviting the multi selection. in the past activating the multi selection on a mini screen will hide the cards and show the multi selection sidebar on the whole screen. a user would need to hide the sidebar in order to select multiple cards. this patch changes this behavior. the sidebar will no longer be opened if the user is on a mini screen while activating the multi selection. in the past deactivating the multi selection would show the default sidebar instead of the multi selection sidebar. after this patch the default sidebar will only be shown if the sidebar was visible before activating the multi selection.
This commit is contained in:
parent
37a3fbf69c
commit
1d523c1ede
1 changed files with 9 additions and 0 deletions
|
@ -60,6 +60,8 @@ MultiSelection = {
|
|||
|
||||
startRangeCardId: null,
|
||||
|
||||
_sidebarWasOpen: false,
|
||||
|
||||
reset() {
|
||||
this._selectedCards.set([]);
|
||||
},
|
||||
|
@ -84,11 +86,15 @@ MultiSelection = {
|
|||
|
||||
activate() {
|
||||
if (!this.isActive()) {
|
||||
this._sidebarWasOpen = Sidebar.isOpen();
|
||||
EscapeActions.executeUpTo('detailsPane');
|
||||
this._isActive.set(true);
|
||||
Tracker.flush();
|
||||
}
|
||||
Sidebar.setView(this.sidebarView);
|
||||
if(Utils.isMiniScreen()) {
|
||||
Sidebar.hide();
|
||||
}
|
||||
},
|
||||
|
||||
disable() {
|
||||
|
@ -96,6 +102,9 @@ MultiSelection = {
|
|||
this._isActive.set(false);
|
||||
if (Sidebar && Sidebar.getView() === this.sidebarView) {
|
||||
Sidebar.setView();
|
||||
if(!this._sidebarWasOpen) {
|
||||
Sidebar.hide();
|
||||
}
|
||||
}
|
||||
this.reset();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue