mirror of
https://github.com/frappe/books.git
synced 2025-01-24 15:48:25 +00:00
fix(ui): hanging border when using bg header
- focus not found issue - save shortcut in Settings
This commit is contained in:
parent
4928ec18d3
commit
99af94f38e
@ -10,10 +10,13 @@
|
|||||||
<div
|
<div
|
||||||
v-if="!showSidebar && platform === 'Mac' && languageDirection !== 'rtl'"
|
v-if="!showSidebar && platform === 'Mac' && languageDirection !== 'rtl'"
|
||||||
class="h-full"
|
class="h-full"
|
||||||
:class="showSidebar ? '' : 'w-tl me-4 border-e'"
|
:class="spacerClass"
|
||||||
/>
|
/>
|
||||||
</Transition>
|
</Transition>
|
||||||
<h1 class="text-xl font-semibold select-none" v-if="title">
|
<h1
|
||||||
|
class="text-xl font-semibold select-none whitespace-nowrap"
|
||||||
|
v-if="title"
|
||||||
|
>
|
||||||
{{ title }}
|
{{ title }}
|
||||||
</h1>
|
</h1>
|
||||||
<div class="flex items-stretch window-no-drag gap-2">
|
<div class="flex items-stretch window-no-drag gap-2">
|
||||||
@ -53,6 +56,17 @@ export default defineComponent({
|
|||||||
showBorder() {
|
showBorder() {
|
||||||
return !!this.$slots.default && this.searchborder;
|
return !!this.$slots.default && this.searchborder;
|
||||||
},
|
},
|
||||||
|
spacerClass() {
|
||||||
|
if (this.showSidebar) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.border) {
|
||||||
|
return 'w-tl me-4 border-e';
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'w-tl me-4';
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -305,7 +305,7 @@ export default defineComponent({
|
|||||||
this.searcher?.updateKeywords();
|
this.searcher?.updateKeywords();
|
||||||
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
(this.$refs.input as HTMLInputElement).focus();
|
(this.$refs.input as HTMLInputElement)?.focus();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
close(): void {
|
close(): void {
|
||||||
|
@ -78,16 +78,24 @@ import FormHeader from 'src/components/FormHeader.vue';
|
|||||||
import { handleErrorWithDialog } from 'src/errorHandling';
|
import { handleErrorWithDialog } from 'src/errorHandling';
|
||||||
import { getErrorMessage } from 'src/utils';
|
import { getErrorMessage } from 'src/utils';
|
||||||
import { evaluateHidden } from 'src/utils/doc';
|
import { evaluateHidden } from 'src/utils/doc';
|
||||||
|
import { showToast } from 'src/utils/interactive';
|
||||||
import { reloadWindow } from 'src/utils/ipcCalls';
|
import { reloadWindow } from 'src/utils/ipcCalls';
|
||||||
import { docsPathMap } from 'src/utils/misc';
|
import { docsPathMap } from 'src/utils/misc';
|
||||||
import { docsPathRef } from 'src/utils/refs';
|
import { docsPathRef } from 'src/utils/refs';
|
||||||
import { UIGroupedFields } from 'src/utils/types';
|
import { UIGroupedFields } from 'src/utils/types';
|
||||||
import { showToast } from 'src/utils/interactive';
|
import { computed, defineComponent, inject } from 'vue';
|
||||||
import { computed, defineComponent } from 'vue';
|
|
||||||
import CommonFormSection from '../CommonForm/CommonFormSection.vue';
|
import CommonFormSection from '../CommonForm/CommonFormSection.vue';
|
||||||
|
import { shortcutsKey } from 'src/utils/injectionKeys';
|
||||||
|
|
||||||
|
const COMPONENT_NAME = 'Settings';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { FormContainer, Button, FormHeader, CommonFormSection },
|
components: { FormContainer, Button, FormHeader, CommonFormSection },
|
||||||
|
setup() {
|
||||||
|
return {
|
||||||
|
shortcuts: inject(shortcutsKey),
|
||||||
|
};
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
errors: {},
|
errors: {},
|
||||||
@ -119,10 +127,17 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
|
|
||||||
docsPathRef.value = docsPathMap.Settings ?? '';
|
docsPathRef.value = docsPathMap.Settings ?? '';
|
||||||
|
this.shortcuts?.pmod.set(COMPONENT_NAME, ['KeyS'], () => {
|
||||||
|
if (!this.canSave) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.sync();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
async deactivated(): Promise<void> {
|
async deactivated(): Promise<void> {
|
||||||
docsPathRef.value = '';
|
docsPathRef.value = '';
|
||||||
|
this.shortcuts?.delete(COMPONENT_NAME);
|
||||||
if (!this.canSave) {
|
if (!this.canSave) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user