File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -319,6 +319,7 @@ <h1 class="create-post-page__title">Create Post</h1>
319319
320320 saveTitleDraft ( ) {
321321 if ( ! this . titleEl ) return ;
322+ if ( ! this . postType ) return ;
322323 try {
323324 const value = this . titleEl . value ;
324325 if ( value ) localStorage . setItem ( this . titleDraftKey ( ) , value ) ;
@@ -328,6 +329,7 @@ <h1 class="create-post-page__title">Create Post</h1>
328329
329330 restoreTitleDraft ( { allowEmpty = false } = { } ) {
330331 if ( ! this . titleEl ) return ;
332+ if ( ! this . postType ) return ;
331333 let saved = null ;
332334 try { saved = localStorage . getItem ( this . titleDraftKey ( ) ) ; } catch ( _ ) { }
333335 if ( saved !== null ) this . titleEl . value = saved ;
Original file line number Diff line number Diff line change 2020< div class ="wysiwyg-v3-container ">
2121 < div class ="wysiwyg-v3 " data-wysiwyg ="v3 " data-wysiwyg-preset ="{{ preset|default:'full' }} " x-data ="{ jsReady: false } " x-init ="
2222 $nextTick(() => {
23- autoInit('{{textarea_id}}');
24- jsReady = true;
23+ const initFunc = () => {
24+ let tries = 0;
25+ if(typeof autoInit === 'function') {
26+ autoInit('{{textarea_id}}');
27+ jsReady = true;
28+ }
29+ else if(tries<=3) {
30+ tries++;
31+ setTimeout(initFunc, 500);
32+ }
33+ else {
34+ console.error('Unable to load wysiwyg editor.')
35+ }
36+ }
37+ initFunc();
2538 }) "
2639 >
2740 < textarea
You can’t perform that action at this time.
0 commit comments