Fossil SCM
Slight forum editor animation tweaks. Add some arguably superfluous "just in case" error handling.
Commit
77b92673aa45e93a7db49850c6e646b16166f2f82392c8663564521bf7e1815c
Parent
22648d1832fb7a2…
2 files changed
+2
-2
+3
-2
+2
-2
| --- src/default.css | ||
| +++ src/default.css | ||
| @@ -2128,16 +2128,16 @@ | ||
| 2128 | 2128 | flex-grow: 2; |
| 2129 | 2129 | line-height: initial/*work around an inherited alignment quirk*/; |
| 2130 | 2130 | } |
| 2131 | 2131 | |
| 2132 | 2132 | .animate-entrance { |
| 2133 | - animation: slideFadeIn 0.5s ease-out forwards; | |
| 2133 | + animation: slideFadeIn 0.25s linear forwards; | |
| 2134 | 2134 | transform-origin: top; |
| 2135 | 2135 | overflow: hidden /*prevent content bleeding during expansion*/; |
| 2136 | 2136 | } |
| 2137 | 2137 | .animate-exit { |
| 2138 | - animation: slideFadeOut 0.5s ease-in forwards; | |
| 2138 | + animation: slideFadeOut 0.25s linear forwards; | |
| 2139 | 2139 | transform-origin: top; |
| 2140 | 2140 | overflow: hidden; |
| 2141 | 2141 | } |
| 2142 | 2142 | @keyframes slideFadeIn { |
| 2143 | 2143 | 0% { |
| 2144 | 2144 |
| --- src/default.css | |
| +++ src/default.css | |
| @@ -2128,16 +2128,16 @@ | |
| 2128 | flex-grow: 2; |
| 2129 | line-height: initial/*work around an inherited alignment quirk*/; |
| 2130 | } |
| 2131 | |
| 2132 | .animate-entrance { |
| 2133 | animation: slideFadeIn 0.5s ease-out forwards; |
| 2134 | transform-origin: top; |
| 2135 | overflow: hidden /*prevent content bleeding during expansion*/; |
| 2136 | } |
| 2137 | .animate-exit { |
| 2138 | animation: slideFadeOut 0.5s ease-in forwards; |
| 2139 | transform-origin: top; |
| 2140 | overflow: hidden; |
| 2141 | } |
| 2142 | @keyframes slideFadeIn { |
| 2143 | 0% { |
| 2144 |
| --- src/default.css | |
| +++ src/default.css | |
| @@ -2128,16 +2128,16 @@ | |
| 2128 | flex-grow: 2; |
| 2129 | line-height: initial/*work around an inherited alignment quirk*/; |
| 2130 | } |
| 2131 | |
| 2132 | .animate-entrance { |
| 2133 | animation: slideFadeIn 0.25s linear forwards; |
| 2134 | transform-origin: top; |
| 2135 | overflow: hidden /*prevent content bleeding during expansion*/; |
| 2136 | } |
| 2137 | .animate-exit { |
| 2138 | animation: slideFadeOut 0.25s linear forwards; |
| 2139 | transform-origin: top; |
| 2140 | overflow: hidden; |
| 2141 | } |
| 2142 | @keyframes slideFadeIn { |
| 2143 | 0% { |
| 2144 |
+3
-2
| --- src/fossil.page.forumpost.js | ||
| +++ src/fossil.page.forumpost.js | ||
| @@ -753,10 +753,11 @@ | ||
| 753 | 753 | if( this.#opt.edit.uuid === j.uuid |
| 754 | 754 | && !j.statusModified && 0===j.attachedCount ){ |
| 755 | 755 | this.reportError("No changes made."); |
| 756 | 756 | }else{ |
| 757 | 757 | window.location = F.repoUrl('forumpost/'+j.uuid); |
| 758 | + setTimeout(()=>this.close(), 500/*just in case not redirected*/); | |
| 758 | 759 | } |
| 759 | 760 | } |
| 760 | 761 | }else{ |
| 761 | 762 | this.reportError( |
| 762 | 763 | "Saving worked but we're ignoring it and staying here." |
| @@ -1175,11 +1176,11 @@ | ||
| 1175 | 1176 | /* onsubmit() and ondiscard() callback */ |
| 1176 | 1177 | restoreEditReplyElement(ePost, eBtnReply, fpe); |
| 1177 | 1178 | //console.debug("ondiscard/onsubmit", fpe, artifact); |
| 1178 | 1179 | if( response/*onsubmit()*/ ){ |
| 1179 | 1180 | window.location = F.repoUrl('forumpost/'+response.uuid); |
| 1180 | - fpe.close(); | |
| 1181 | + setTimeout(()=>fpe.close(), 500/*just in case not redirected*/); | |
| 1181 | 1182 | }else{/*ondiscard()*/ |
| 1182 | 1183 | } |
| 1183 | 1184 | }; |
| 1184 | 1185 | const fpe = new F.ForumPostEditor(F.nu({ |
| 1185 | 1186 | hiddenFields: form.querySelectorAll( |
| @@ -1245,19 +1246,19 @@ | ||
| 1245 | 1246 | eBtnEdit.innerText = "Editing..."; |
| 1246 | 1247 | fetchPost(fpid) |
| 1247 | 1248 | .then(artifact=>{ |
| 1248 | 1249 | const ondone = (fpe, response)=>{ |
| 1249 | 1250 | /* onsubmit() and ondiscard() callback */ |
| 1250 | - //console.debug("ondiscard/onsubmit", fpe); | |
| 1251 | 1251 | if( response/*onsubmit()*/ ){ |
| 1252 | 1252 | if( fpid === response.uuid |
| 1253 | 1253 | && !response.statusModified |
| 1254 | 1254 | && 0===response.attachedCount ){ |
| 1255 | 1255 | fpe.reportError("No changes made."); |
| 1256 | 1256 | }else{ |
| 1257 | 1257 | restoreEditReplyElement(ePost, eBtnEdit, fpe); |
| 1258 | 1258 | window.location = F.repoUrl('forumpost/'+response.uuid); |
| 1259 | + setTimeout(()=>fpe.close(), 500/*just in case not redirected*/); | |
| 1259 | 1260 | } |
| 1260 | 1261 | }else{ |
| 1261 | 1262 | /*ondiscard()*/ |
| 1262 | 1263 | restoreEditReplyElement(ePost, eBtnEdit, fpe); |
| 1263 | 1264 | } |
| 1264 | 1265 |
| --- src/fossil.page.forumpost.js | |
| +++ src/fossil.page.forumpost.js | |
| @@ -753,10 +753,11 @@ | |
| 753 | if( this.#opt.edit.uuid === j.uuid |
| 754 | && !j.statusModified && 0===j.attachedCount ){ |
| 755 | this.reportError("No changes made."); |
| 756 | }else{ |
| 757 | window.location = F.repoUrl('forumpost/'+j.uuid); |
| 758 | } |
| 759 | } |
| 760 | }else{ |
| 761 | this.reportError( |
| 762 | "Saving worked but we're ignoring it and staying here." |
| @@ -1175,11 +1176,11 @@ | |
| 1175 | /* onsubmit() and ondiscard() callback */ |
| 1176 | restoreEditReplyElement(ePost, eBtnReply, fpe); |
| 1177 | //console.debug("ondiscard/onsubmit", fpe, artifact); |
| 1178 | if( response/*onsubmit()*/ ){ |
| 1179 | window.location = F.repoUrl('forumpost/'+response.uuid); |
| 1180 | fpe.close(); |
| 1181 | }else{/*ondiscard()*/ |
| 1182 | } |
| 1183 | }; |
| 1184 | const fpe = new F.ForumPostEditor(F.nu({ |
| 1185 | hiddenFields: form.querySelectorAll( |
| @@ -1245,19 +1246,19 @@ | |
| 1245 | eBtnEdit.innerText = "Editing..."; |
| 1246 | fetchPost(fpid) |
| 1247 | .then(artifact=>{ |
| 1248 | const ondone = (fpe, response)=>{ |
| 1249 | /* onsubmit() and ondiscard() callback */ |
| 1250 | //console.debug("ondiscard/onsubmit", fpe); |
| 1251 | if( response/*onsubmit()*/ ){ |
| 1252 | if( fpid === response.uuid |
| 1253 | && !response.statusModified |
| 1254 | && 0===response.attachedCount ){ |
| 1255 | fpe.reportError("No changes made."); |
| 1256 | }else{ |
| 1257 | restoreEditReplyElement(ePost, eBtnEdit, fpe); |
| 1258 | window.location = F.repoUrl('forumpost/'+response.uuid); |
| 1259 | } |
| 1260 | }else{ |
| 1261 | /*ondiscard()*/ |
| 1262 | restoreEditReplyElement(ePost, eBtnEdit, fpe); |
| 1263 | } |
| 1264 |
| --- src/fossil.page.forumpost.js | |
| +++ src/fossil.page.forumpost.js | |
| @@ -753,10 +753,11 @@ | |
| 753 | if( this.#opt.edit.uuid === j.uuid |
| 754 | && !j.statusModified && 0===j.attachedCount ){ |
| 755 | this.reportError("No changes made."); |
| 756 | }else{ |
| 757 | window.location = F.repoUrl('forumpost/'+j.uuid); |
| 758 | setTimeout(()=>this.close(), 500/*just in case not redirected*/); |
| 759 | } |
| 760 | } |
| 761 | }else{ |
| 762 | this.reportError( |
| 763 | "Saving worked but we're ignoring it and staying here." |
| @@ -1175,11 +1176,11 @@ | |
| 1176 | /* onsubmit() and ondiscard() callback */ |
| 1177 | restoreEditReplyElement(ePost, eBtnReply, fpe); |
| 1178 | //console.debug("ondiscard/onsubmit", fpe, artifact); |
| 1179 | if( response/*onsubmit()*/ ){ |
| 1180 | window.location = F.repoUrl('forumpost/'+response.uuid); |
| 1181 | setTimeout(()=>fpe.close(), 500/*just in case not redirected*/); |
| 1182 | }else{/*ondiscard()*/ |
| 1183 | } |
| 1184 | }; |
| 1185 | const fpe = new F.ForumPostEditor(F.nu({ |
| 1186 | hiddenFields: form.querySelectorAll( |
| @@ -1245,19 +1246,19 @@ | |
| 1246 | eBtnEdit.innerText = "Editing..."; |
| 1247 | fetchPost(fpid) |
| 1248 | .then(artifact=>{ |
| 1249 | const ondone = (fpe, response)=>{ |
| 1250 | /* onsubmit() and ondiscard() callback */ |
| 1251 | if( response/*onsubmit()*/ ){ |
| 1252 | if( fpid === response.uuid |
| 1253 | && !response.statusModified |
| 1254 | && 0===response.attachedCount ){ |
| 1255 | fpe.reportError("No changes made."); |
| 1256 | }else{ |
| 1257 | restoreEditReplyElement(ePost, eBtnEdit, fpe); |
| 1258 | window.location = F.repoUrl('forumpost/'+response.uuid); |
| 1259 | setTimeout(()=>fpe.close(), 500/*just in case not redirected*/); |
| 1260 | } |
| 1261 | }else{ |
| 1262 | /*ondiscard()*/ |
| 1263 | restoreEditReplyElement(ePost, eBtnEdit, fpe); |
| 1264 | } |
| 1265 |