fix: The content format is not reset on create a new or clone document

This commit is contained in:
Ribas160 2025-12-14 09:08:48 +02:00
parent 5a067e893f
commit ed9b3d1aa0
No known key found for this signature in database
GPG key ID: ED4AE99DCA25A6BB
3 changed files with 11 additions and 2 deletions

View file

@ -4632,7 +4632,11 @@ jQuery.PrivateBin = (function($) {
*/
me.setFormat = function(format)
{
$formatter.parent().find(`a[data-format="${format}"]`).click();
if (Helper.isBootstrap5()) {
$formatter.find(`select`).val(format);
} else {
$formatter.parent().find(`a[data-format="${format}"]`).click();
}
}
/**
@ -5792,6 +5796,10 @@ jQuery.PrivateBin = (function($) {
AttachmentViewer.removeAttachment();
TopNav.resetInput();
// reset format
PasteViewer.setFormat('plaintext');
TopNav.setFormat('plaintext');
TopNav.showCreateButtons();
// newPaste could be called when user is on document clone editing view