Fossil SCM
While the forum editor is open, also disable the post's Close, Delete, and Attach buttons because those will change the current page. Presumably nobody wants to close or delete during an edit, and attachment can be done via the editor form.
Commit
778b397274e6e892fc0f5e554fa6eadef6035feccc91fd0158d91a47c32e379f
Parent
935bd936ac947c6…
1 file changed
+5
-4
+5
-4
| --- src/fossil.page.forumpost.js | ||
| +++ src/fossil.page.forumpost.js | ||
| @@ -1349,14 +1349,15 @@ | ||
| 1349 | 1349 | button because it would redirect mid-edit. We wouldn't lose |
| 1350 | 1350 | the edits but would lose any pending attachments. We work |
| 1351 | 1351 | around this by disabling this selection and adding a new |
| 1352 | 1352 | status selection widget in the editor, inheriting this |
| 1353 | 1353 | one's value. */ |
| 1354 | - const eStatusChange = eThePost.querySelector( | |
| 1355 | - ':scope > fieldset.forum-status-selection' | |
| 1356 | - ); | |
| 1357 | - if( eStatusChange ) eToDisable.push(eStatusChange); | |
| 1354 | + eThePost.querySelectorAll( | |
| 1355 | + 'fieldset.forum-status-selection,'+ | |
| 1356 | + '.forumpost-single-controls input[type=button],'+ | |
| 1357 | + '.forumpost-single-controls input[type=submit]' | |
| 1358 | + ).forEach(ee=>eToDisable.push(ee)); | |
| 1358 | 1359 | })/*for-each form*/; |
| 1359 | 1360 | |
| 1360 | 1361 | }/* /forumpost and /forumthread */ |
| 1361 | 1362 | |
| 1362 | 1363 | document.body.querySelectorAll('.remove-on-load').forEach(e=>e.remove()); |
| 1363 | 1364 |
| --- src/fossil.page.forumpost.js | |
| +++ src/fossil.page.forumpost.js | |
| @@ -1349,14 +1349,15 @@ | |
| 1349 | button because it would redirect mid-edit. We wouldn't lose |
| 1350 | the edits but would lose any pending attachments. We work |
| 1351 | around this by disabling this selection and adding a new |
| 1352 | status selection widget in the editor, inheriting this |
| 1353 | one's value. */ |
| 1354 | const eStatusChange = eThePost.querySelector( |
| 1355 | ':scope > fieldset.forum-status-selection' |
| 1356 | ); |
| 1357 | if( eStatusChange ) eToDisable.push(eStatusChange); |
| 1358 | })/*for-each form*/; |
| 1359 | |
| 1360 | }/* /forumpost and /forumthread */ |
| 1361 | |
| 1362 | document.body.querySelectorAll('.remove-on-load').forEach(e=>e.remove()); |
| 1363 |
| --- src/fossil.page.forumpost.js | |
| +++ src/fossil.page.forumpost.js | |
| @@ -1349,14 +1349,15 @@ | |
| 1349 | button because it would redirect mid-edit. We wouldn't lose |
| 1350 | the edits but would lose any pending attachments. We work |
| 1351 | around this by disabling this selection and adding a new |
| 1352 | status selection widget in the editor, inheriting this |
| 1353 | one's value. */ |
| 1354 | eThePost.querySelectorAll( |
| 1355 | 'fieldset.forum-status-selection,'+ |
| 1356 | '.forumpost-single-controls input[type=button],'+ |
| 1357 | '.forumpost-single-controls input[type=submit]' |
| 1358 | ).forEach(ee=>eToDisable.push(ee)); |
| 1359 | })/*for-each form*/; |
| 1360 | |
| 1361 | }/* /forumpost and /forumthread */ |
| 1362 | |
| 1363 | document.body.querySelectorAll('.remove-on-load').forEach(e=>e.remove()); |
| 1364 |