mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-10-17 03:51:36 +08:00
fix(client): tooltip position for launcher on horizontal layout
This commit is contained in:
parent
13a997beb0
commit
fd8f9506d4
@ -23,7 +23,10 @@ export default class AbstractButtonWidget extends NoteContextAwareWidget {
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.tooltip = new bootstrap.Tooltip(this.$widget, {
|
||||
html: true, title: () => this.getTitle(), trigger: 'hover'
|
||||
html: true,
|
||||
title: () => this.getTitle(),
|
||||
trigger: 'hover',
|
||||
placement: this.settings.titlePlacement
|
||||
})
|
||||
|
||||
if (this.settings.onContextMenu) {
|
||||
@ -36,8 +39,6 @@ export default class AbstractButtonWidget extends NoteContextAwareWidget {
|
||||
});
|
||||
}
|
||||
|
||||
this.$widget.attr("data-placement", this.settings.titlePlacement);
|
||||
|
||||
super.doRender();
|
||||
}
|
||||
|
||||
|
@ -13,10 +13,11 @@ import HistoryNavigationButton from "../buttons/history_navigation.js";
|
||||
import QuickSearchWidget from "../quick_search.js";
|
||||
|
||||
export default class LauncherWidget extends BasicWidget {
|
||||
constructor() {
|
||||
constructor(isHorizontalLayout) {
|
||||
super();
|
||||
|
||||
this.innerWidget = null;
|
||||
this.isHorizontalLayout = isHorizontalLayout;
|
||||
}
|
||||
|
||||
isEnabled() {
|
||||
@ -64,6 +65,9 @@ export default class LauncherWidget extends BasicWidget {
|
||||
}
|
||||
|
||||
this.child(this.innerWidget);
|
||||
if (this.isHorizontalLayout && this.innerWidget.settings) {
|
||||
this.innerWidget.settings.titlePlacement = "bottom";
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -4,12 +4,13 @@ import appContext from "../../components/app_context.js";
|
||||
import LauncherWidget from "./launcher.js";
|
||||
|
||||
export default class LauncherContainer extends FlexContainer {
|
||||
constructor(horizontal) {
|
||||
super(horizontal ? "row" : "column");
|
||||
constructor(isHorizontalLayout) {
|
||||
super(isHorizontalLayout ? "row" : "column");
|
||||
|
||||
this.id('launcher-container');
|
||||
this.css(horizontal ? "width" : 'height', '100%');
|
||||
this.css(isHorizontalLayout ? "width" : 'height', '100%');
|
||||
this.filling();
|
||||
this.isHorizontalLayout = isHorizontalLayout;
|
||||
|
||||
this.load();
|
||||
}
|
||||
@ -29,7 +30,7 @@ export default class LauncherContainer extends FlexContainer {
|
||||
|
||||
for (const launcherNote of await visibleLaunchersRoot.getChildNotes()) {
|
||||
try {
|
||||
const launcherWidget = new LauncherWidget();
|
||||
const launcherWidget = new LauncherWidget(this.isHorizontalLayout);
|
||||
const success = await launcherWidget.initLauncher(launcherNote);
|
||||
|
||||
if (success) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user