Skip to content

Commit

Permalink
feat: allow dragging files on opened document
Browse files Browse the repository at this point in the history
  • Loading branch information
davidenke committed Oct 11, 2024
1 parent 20b637b commit 973ae3a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/components/root/root.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
font-style: normal;
}

:host(:not([has-document])) {
cursor: default;
user-select: none;
}

main {
display: flex;
flex-flow: row nowrap;
Expand All @@ -31,16 +26,28 @@ main {
justify-content: center;
}

xlp-title-bar {
:host(:not([has-document])) {
cursor: default;
user-select: none;
}

:host(:not([has-document])) xlp-title-bar {
z-index: 1;
}

xlp-tool-bar {
:host([has-document]) xlp-tool-bar {
position: fixed;
inset: 10px 10px auto auto;
z-index: 1;
}

:host([has-document]) xlp-select-file {
position: fixed;
inset: 0;
z-index: 2;
}

xlp-preview {
:host([has-document]) xlp-preview {
flex: 1;
min-height: 100svh;
min-width: 0;
Expand Down
1 change: 1 addition & 0 deletions src/components/root/root.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ export class Root extends LitElement {
`,
() => html`
<xlp-preview>${unsafeHTML(this.contents)}</xlp-preview>
<xlp-select-file background @path="${this.loadFile}"><xlp-icon>upload_file</xlp-icon></xlp-select-file>
<xlp-tool-bar role="navigation" hide-after="2000">
<xlp-numeric-stepper
@change="${this.setVisibilityLevel}"
Expand Down

0 comments on commit 973ae3a

Please sign in to comment.