Skip to content

Commit b243d6d

Browse files
committed
feat(pages): make texts selectable on read-only pages
1 parent ee3d305 commit b243d6d

3 files changed

Lines changed: 15 additions & 0 deletions

File tree

apps/client/src/code/pages/page/notes/note.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,14 @@ export class PageNote extends PageElem() implements IPageRegion {
458458
}),
459459

460460
cursor: computed(() => {
461+
if (this.page.react.readOnly) {
462+
if (this.react.link.url) {
463+
return 'pointer';
464+
} else {
465+
return 'auto';
466+
}
467+
}
468+
461469
if (this.react.editing) {
462470
return 'auto';
463471
}

apps/client/src/components/TextEditor.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,3 +325,9 @@ defineProps<Props>();
325325
}
326326
}
327327
</style>
328+
329+
<style>
330+
.display-page.readonly-page .text-editor * {
331+
user-select: text;
332+
}
333+
</style>

apps/client/src/layouts/PagesLayout/MainContent/DisplayPage/DisplayPage.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<div
33
class="display-page"
4+
:class="{ 'readonly-page': page.react.readOnly }"
45
:data-page-id="page.id"
56
>
67
<DisplayScreens />

0 commit comments

Comments
 (0)