mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 11:02:28 +08:00
feat(mobile): hide quick search
This commit is contained in:
parent
8a61b58970
commit
d2d2620742
@ -10,7 +10,7 @@ import CommandButtonWidget from "../buttons/command_button.js";
|
||||
import utils from "../../services/utils.js";
|
||||
import TodayLauncher from "../buttons/launcher/today_launcher.js";
|
||||
import HistoryNavigationButton from "../buttons/history_navigation.js";
|
||||
import QuickSearchWidget from "../quick_search.js";
|
||||
import QuickSearchLauncherWidget from "../quick_search_launcher.js";
|
||||
|
||||
export default class LauncherWidget extends BasicWidget {
|
||||
constructor(isHorizontalLayout) {
|
||||
@ -118,7 +118,7 @@ export default class LauncherWidget extends BasicWidget {
|
||||
case "todayInJournal":
|
||||
return new TodayLauncher(note);
|
||||
case "quickSearch":
|
||||
return this.isHorizontalLayout ? new QuickSearchWidget() : null;
|
||||
return this.isHorizontalLayout ? new QuickSearchLauncherWidget() : null;
|
||||
default:
|
||||
throw new Error(`Unrecognized builtin widget ${builtinWidget} for launcher ${note.noteId} "${note.title}"`);
|
||||
}
|
||||
|
22
src/public/app/widgets/quick_search_launcher.js
Normal file
22
src/public/app/widgets/quick_search_launcher.js
Normal file
@ -0,0 +1,22 @@
|
||||
import utils from "../services/utils.js";
|
||||
import QuickSearchWidget from "./quick_search.js";
|
||||
|
||||
/**
|
||||
* Similar to the {@link QuickSearchWidget} but meant to be included inside the launcher bar.
|
||||
*
|
||||
* <p>
|
||||
* Adds specific tweaks such as:
|
||||
*
|
||||
* - Hiding the widget on mobile.
|
||||
*/
|
||||
export default class QuickSearchLauncherWidget extends QuickSearchWidget {
|
||||
|
||||
isEnabled() {
|
||||
if (utils.isMobile()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return super.isEnabled();
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user