Fossil SCM

Delay the initial filepage loadFile() until a windows.load event. This seems to eliminate what appears to have been a race between that call and the filepage init code.

stephan 2020-05-08 14:00 fileedit-ajaxify
Commit 07d0bcc598fdbbfd09580290b1091e66d6d87849f0d883a60751283b5e7997d8
1 file changed +2 -1
+2 -1
--- src/fileedit.c
+++ src/fileedit.c
@@ -1812,11 +1812,12 @@
18121812
18131813
CX("</div>"/*#fileedit-tab-commit*/);
18141814
18151815
/* Dynamically populate the editor... */
18161816
blob_appendf(&endScript,
1817
- "fossil.page.loadFile('%j','%j');",
1817
+ "window.addEventListener('load',"
1818
+ "()=>fossil.page.loadFile('%j','%j'), false);\n",
18181819
zFilename, cimi.zParentUuid);
18191820
18201821
end_footer:
18211822
if(stmt.pStmt){
18221823
db_finalize(&stmt);
18231824
--- src/fileedit.c
+++ src/fileedit.c
@@ -1812,11 +1812,12 @@
1812
1813 CX("</div>"/*#fileedit-tab-commit*/);
1814
1815 /* Dynamically populate the editor... */
1816 blob_appendf(&endScript,
1817 "fossil.page.loadFile('%j','%j');",
 
1818 zFilename, cimi.zParentUuid);
1819
1820 end_footer:
1821 if(stmt.pStmt){
1822 db_finalize(&stmt);
1823
--- src/fileedit.c
+++ src/fileedit.c
@@ -1812,11 +1812,12 @@
1812
1813 CX("</div>"/*#fileedit-tab-commit*/);
1814
1815 /* Dynamically populate the editor... */
1816 blob_appendf(&endScript,
1817 "window.addEventListener('load',"
1818 "()=>fossil.page.loadFile('%j','%j'), false);\n",
1819 zFilename, cimi.zParentUuid);
1820
1821 end_footer:
1822 if(stmt.pStmt){
1823 db_finalize(&stmt);
1824

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button