Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"url": "git+https://github.com/opencor/webapp.git"
},
"type": "module",
"version": "0.20260224.0",
"version": "0.20260224.1",
"scripts": {
"archive:web": "bun src/renderer/scripts/archive.web.js",
"build": "electron-vite build",
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"./style.css": "./dist/opencor.css"
},
"version": "0.20260224.0",
"version": "0.20260224.1",
"scripts": {
"build": "vite build && bun scripts/generate.version.js",
"build:lib": "vite build --config vite.lib.config.ts && cp index.d.ts dist/index.d.ts",
Expand Down
22 changes: 1 addition & 21 deletions src/renderer/src/components/ContentsComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
:scrollable="true"
:selectOnFocus="true"
>
<TabList :id="fileTablistId" class="border-b border-b-primary shrink-0">
<TabList class="border-b border-b-primary shrink-0">
<Tab
v-for="fileTab in fileTabs"
:id="`tab_${fileTab.file.path()}`"
Expand Down Expand Up @@ -81,16 +81,6 @@ const props = defineProps<{
}>();
defineEmits<(event: 'error', message: string) => void>();

export interface IContentsComponent {
openFile(file: locApi.File): void;
closeCurrentFile(): void;
closeAllFiles(): void;
hasFile(filePath: string): boolean;
hasFiles(): boolean;
selectFile(filePath: string): void;
}

const fileTablistId = vue.ref('contentsComponentFileTablist');
const fileTabs = vue.ref<IFileTab[]>([]);
const activeFile = vue.ref<string>('');

Expand Down Expand Up @@ -201,16 +191,6 @@ vue.watch(activeFile, (newActiveFile: string) => {
electronApi?.fileSelected(newActiveFile);
});

// Various things that need to be done once we are mounted.

const crtInstance = vue.getCurrentInstance();

vue.onMounted(() => {
// Customise our IDs.

fileTablistId.value = `contentsComponentFileTablist${String(crtInstance?.uid)}`;
});

// Keyboard shortcuts.

if (common.isDesktop()) {
Expand Down
12 changes: 6 additions & 6 deletions src/renderer/src/components/MainMenu.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<Menubar ref="menuBar" :id="props.id" :model="items">
<Menubar ref="menuBarRef" :id="props.id" :model="items">
<template #item="{ item, props }">
<a v-bind="props.action">
<div class="p-menubar-item-label">{{ item.label }}</div>
Expand Down Expand Up @@ -152,13 +152,13 @@ const items = [

// A few things that can only be done when the component is mounted.

const menuBar = vue.ref<(vue.ComponentPublicInstance<typeof Menubar> & { hide: () => void }) | null>(null);
const menuBarRef = vue.ref<(InstanceType<typeof Menubar> & { hide: () => void; $el: HTMLElement }) | null>(null);

vue.onMounted(() => {
if (menuBar.value) {
if (menuBarRef.value) {
// Ensure that the menubar never gets the 'p-menubar-mobile' class, which would turn it into a hamburger menu.

const menuBarElement = menuBar.value.$el as HTMLElement;
const menuBarElement = menuBarRef.value.$el;
const mutationObserver = new MutationObserver(() => {
if (menuBarElement.classList.contains('p-menubar-mobile')) {
menuBarElement.classList.remove('p-menubar-mobile');
Expand All @@ -167,7 +167,7 @@ vue.onMounted(() => {

mutationObserver.observe(menuBarElement, { attributes: true, attributeFilter: ['class'] });

// Close the menu when clicking clicking on the menubar but outside of the main menu items.
// Close the menu when clicking on the menubar but outside of the main menu items.

const onClick = (event: MouseEvent) => {
const target = event.target as Node;
Expand All @@ -177,7 +177,7 @@ vue.onMounted(() => {
!menuBarElement.querySelector('.p-menubar-root-list')?.contains(target) &&
!Array.from(document.querySelectorAll('.p-menubar-submenu')).some((submenu) => submenu.contains(target))
) {
menuBar.value?.hide();
menuBarRef.value?.hide();
}
};

Expand Down
Loading