Fossil SCM

Only show the forum editor's Stash button when saving of drafts is enabled (it currently always is).

stephan 2026-06-13 13:21 UTC forum-editor-2026
Commit b45242d8fd1e327c23d1b046a40909a6cbc4294040b3332372ec71d15d05f452
1 file changed +16 -10
--- src/fossil.page.forumpost.js
+++ src/fossil.page.forumpost.js
@@ -174,19 +174,21 @@
174174
e.button.submit = D.attr(
175175
D.button("Submit"),
176176
'title',
177177
'Save any edits to the server. Not permitted until Preview has been used.'
178178
);
179
- e.button.stash = D.attr(
180
- D.button(
181
- "Stash", e=>this.close()
182
- /* This could be called Close, but that would semantically
183
- collide with the Close [this post] button. All "Stash"
184
- does is close the widget. */
185
- ),
186
- 'title', "Close this editor and stash any edits locally."
187
- );
179
+ if( this.#draft ){
180
+ e.button.stash = D.attr(
181
+ D.button(
182
+ "Stash", e=>this.close()
183
+ /* This could be called Close, but that would semantically
184
+ collide with the Close [this post] button. All "Stash"
185
+ does is close the widget. */
186
+ ),
187
+ 'title', "Close this editor and stash any edits locally."
188
+ );
189
+ }
188190
if( opt.ondiscard instanceof Function ){
189191
e.button.discard = D.attr(
190192
D.button('Discard'),
191193
'title',
192194
'Close the editor and discard all local edits.'
@@ -325,11 +327,15 @@
325327
e.tabAttach.dataset.tabLabel = 'Attachments';
326328
this.#tabs.addTab(e.tabAttach);
327329
/* Reminder: we don't currently have a way to disable/enable
328330
an Attacher's controls during ajax traffic. */
329331
}
330
- e.buttons.append(e.button.preview, e.button.submit, e.button.stash);
332
+ e.buttons.append(e.button.preview, e.button.submit);
333
+ if( e.button.stash ){
334
+ e.buttons.append(e.button.stash);
335
+ this.#toDisable.push(e.button.stash);
336
+ }
331337
if( e.button.discard ){
332338
e.buttons.append(e.button.discard);
333339
this.#toDisable.push(e.button.discard);
334340
}
335341
336342
--- src/fossil.page.forumpost.js
+++ src/fossil.page.forumpost.js
@@ -174,19 +174,21 @@
174 e.button.submit = D.attr(
175 D.button("Submit"),
176 'title',
177 'Save any edits to the server. Not permitted until Preview has been used.'
178 );
179 e.button.stash = D.attr(
180 D.button(
181 "Stash", e=>this.close()
182 /* This could be called Close, but that would semantically
183 collide with the Close [this post] button. All "Stash"
184 does is close the widget. */
185 ),
186 'title', "Close this editor and stash any edits locally."
187 );
 
 
188 if( opt.ondiscard instanceof Function ){
189 e.button.discard = D.attr(
190 D.button('Discard'),
191 'title',
192 'Close the editor and discard all local edits.'
@@ -325,11 +327,15 @@
325 e.tabAttach.dataset.tabLabel = 'Attachments';
326 this.#tabs.addTab(e.tabAttach);
327 /* Reminder: we don't currently have a way to disable/enable
328 an Attacher's controls during ajax traffic. */
329 }
330 e.buttons.append(e.button.preview, e.button.submit, e.button.stash);
 
 
 
 
331 if( e.button.discard ){
332 e.buttons.append(e.button.discard);
333 this.#toDisable.push(e.button.discard);
334 }
335
336
--- src/fossil.page.forumpost.js
+++ src/fossil.page.forumpost.js
@@ -174,19 +174,21 @@
174 e.button.submit = D.attr(
175 D.button("Submit"),
176 'title',
177 'Save any edits to the server. Not permitted until Preview has been used.'
178 );
179 if( this.#draft ){
180 e.button.stash = D.attr(
181 D.button(
182 "Stash", e=>this.close()
183 /* This could be called Close, but that would semantically
184 collide with the Close [this post] button. All "Stash"
185 does is close the widget. */
186 ),
187 'title', "Close this editor and stash any edits locally."
188 );
189 }
190 if( opt.ondiscard instanceof Function ){
191 e.button.discard = D.attr(
192 D.button('Discard'),
193 'title',
194 'Close the editor and discard all local edits.'
@@ -325,11 +327,15 @@
327 e.tabAttach.dataset.tabLabel = 'Attachments';
328 this.#tabs.addTab(e.tabAttach);
329 /* Reminder: we don't currently have a way to disable/enable
330 an Attacher's controls during ajax traffic. */
331 }
332 e.buttons.append(e.button.preview, e.button.submit);
333 if( e.button.stash ){
334 e.buttons.append(e.button.stash);
335 this.#toDisable.push(e.button.stash);
336 }
337 if( e.button.discard ){
338 e.buttons.append(e.button.discard);
339 this.#toDisable.push(e.button.discard);
340 }
341
342

Keyboard Shortcuts

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