On Wednesday, August 19, 2020 at 10:42:25 PM UTC-7, TW Tones wrote:
>
>
> - A Quick look at the delete tiddler button $:/core/ui/Buttons/delete
> shows it uses the button message="tm-delete-tiddler
> <https://tiddlywiki.com/#WidgetMessage%3A%20tm-delete-tiddler>"
>
> The processing for the tm-delete-tiddler message is defined here:
*$:/core/modules/widgets/navigator.js*,
which sets up an event listener that triggers: *handleDeleteTiddlerEvent*
Examining this function, we find the following lines of code:
if((this.wiki.getTiddler(originalTitle) || (tiddler.fields.text || "") !==
"")
&& !confirm($tw.language.getString("ConfirmDeleteTiddler",{variables:{title
: confirmationTitle}}))) {
return false;
}
This code checks to see if getTiddler() returns a non-null value (i.e., the
tiddler exists) or if the current text field is not blank (i.e., text has
been entered while editing). If either of these conditions is true, then it
prompts for confirmation. If you press "cancel", then the code skips the
delete action (return false). If you press "ok", the code continues on to
perform the deletion.
>From the above, it appears that it *should* be asking to confirm since the
tiddler does exist.
However, it seems that this is not what is actually happening.
I don't see where the logic is broken, but this is where it occurs.
-e
>
> - There is no mention of this behaviour and no parameters to override
> it.
> - Only changing the text stops this behaviour, adding a tag or field
> with a value does not cause the are you sure warning.
>
> It can be quite common to create tiddlers accidentally and want to simply
> delete them, so I am not surprised at this behaviour. When it is only a
> tiddler with a title then all that is deleted is the title, if there is any
> content what so ever, you may not be able to see it eg; fields, then it
> should trigger the confirmation (in my view).
>
> Perhaps you can submit and *issue* on github for a setting to be provided
> in the control panel settings to change this behaviour?
>
> In the mean time perhaps you could consider either modifying the tiddler,
> even just add space to the text. Another way to do this is to make your own
> "new tiddler button" and modify it to set the text to " " space only, and
> hide the existing one. However new here and other will not be affected?
>
> *Good catch*
>
> Regards
> Tones
>
> On Thursday, 20 August 2020 12:22:07 UTC+10, kebi wrote:
>>
>> Thanks Eric for your testing.
>> The delete button I'm talking about is not the one inside the edit
>> tiddler view, but the one in the view toolbar ($:/core/ui/Buttons/delete)
>>
>> - kebi
>>
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/7ca1f680-c563-492a-98d2-e897170f60b8o%40googlegroups.com.