|
1 | 1 | import {computed, css, html, JDOMComponent, state} from 'jdomjs' |
2 | 2 |
|
3 | | -import {Attribute, CustomElement, State} from 'jdomjs/src/decorators.ts' |
| 3 | +import {Attribute, Computed, CustomElement, State, Watch} from 'jdomjs/src/decorators.ts' |
4 | 4 | import { Awaiting, ForEach } from 'jdomjs/src/template/helper/components.js' |
5 | 5 | import {api, router} from "../../main.ts"; |
6 | 6 | import { WebContainer } from '@webcontainer/api'; |
@@ -101,6 +101,7 @@ export default class EditorView extends JDOMComponent.unshadowed { |
101 | 101 | this.paste.value = out |
102 | 102 | this.pasteNameEdit.value = out.title |
103 | 103 | this.loading.value = false |
| 104 | + document.title = `${out.title || 'Editor'} - Pastefy Codebox` |
104 | 105 | } |
105 | 106 |
|
106 | 107 | getFile(name) { |
@@ -137,6 +138,7 @@ export default class EditorView extends JDOMComponent.unshadowed { |
137 | 138 | } |
138 | 139 | this.savedIndicator.value = true |
139 | 140 | setTimeout(() => this.savedIndicator.value = false, 3000) |
| 141 | + document.title = `${this.paste.value?.title || 'Editor'} - Pastefy Codebox` |
140 | 142 | } |
141 | 143 |
|
142 | 144 | async initWebContainer() { |
@@ -231,6 +233,8 @@ export default class EditorView extends JDOMComponent.unshadowed { |
231 | 233 |
|
232 | 234 | render() { |
233 | 235 | document.querySelector('meta[name="theme-color"]')?.setAttribute('content', '#1c202a') |
| 236 | + document.title = 'Editor - Pastefy Codebox' |
| 237 | + |
234 | 238 | this.frame = document.createElement('iframe') |
235 | 239 | const termDiv = document.createElement('div') |
236 | 240 | termDiv.classList.add('terminal') |
|
0 commit comments