Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 869fdb1

Browse files
committed
improve example + improve starting speed (and better js profiling)
1 parent 56a553a commit 869fdb1

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

examples/demo/demo.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,6 @@ const config: JWEditorConfig & { loadables: Loadables<Layout> } = {
3939
};
4040
editor.configure(config);
4141

42-
editor.start();
42+
setTimeout(() => {
43+
editor.start();
44+
});

examples/jabberwockipedia/jabberwockipedia.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ import '../utils/fontawesomeAssets';
66
const target = document.getElementById('example');
77
const editor = new BasicEditor({ editable: target });
88
editor.load(DevTools);
9-
editor.start();
9+
10+
setTimeout(() => {
11+
editor.start();
12+
});

examples/layout/layout.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,20 @@ editor.configure(Theme, {
9797
.get(Parser)
9898
.parse(
9999
'text/html',
100-
`<div style="background: lightblue; height: 100%;"><t-placeholder/></div>`,
100+
`<div style="background: lightblue; min-height: 100%;"><t-placeholder/></div>`,
101101
);
102102
},
103103
},
104104
{
105105
id: 'iframe',
106106
label: 'Theme color red in iframe',
107107
render: async (editor: JWEditor): Promise<VNode[]> => {
108-
return editor.plugins
109-
.get(Parser)
110-
.parse(
111-
'text/html',
112-
`<t-iframe style="border: 0; width: 100%;"><div style="background: #ffaaaa; height: 100%;"><t-placeholder/></div></t-iframe>`,
113-
);
108+
return editor.plugins.get(Parser).parse(
109+
'text/html',
110+
`<t-iframe style="border-width: 80px 14px 40px; border-radius: 16px; border-style: solid; border-color: #000; background-color: white; width: 400px; height: 600px; margin: auto; display: block;">
111+
<div style="background: #ffaaaa; min-height: 100%;"><t-placeholder/></div>
112+
</t-iframe>`,
113+
);
114114
},
115115
},
116116
],

0 commit comments

Comments
 (0)