mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 18:10:06 -05:00
Close the full-screen Search sidebar when its Back control is used on a mini screen, while preserving desktop and other sidebar transitions. Add positive, negative, wiring, and mobile browser regressions. Thanks to 1ubuntuuser and xet7 ! Fixes #3576,
21 lines
585 B
JavaScript
21 lines
585 B
JavaScript
'use strict';
|
|
|
|
const SIDEBAR_BACK_CLOSE = 'close';
|
|
const SIDEBAR_BACK_HOME = 'home';
|
|
|
|
// Search occupies the full board area on a mini screen. Its back button should
|
|
// therefore reveal the board, not replace Search with the sidebar Home/settings
|
|
// view. Desktop keeps the sidebar open, and every other view keeps its existing
|
|
// back-to-Home behavior.
|
|
function sidebarBackAction(view, isMiniScreen) {
|
|
return view === 'search' && isMiniScreen
|
|
? SIDEBAR_BACK_CLOSE
|
|
: SIDEBAR_BACK_HOME;
|
|
}
|
|
|
|
module.exports = {
|
|
SIDEBAR_BACK_CLOSE,
|
|
SIDEBAR_BACK_HOME,
|
|
sidebarBackAction,
|
|
};
|