public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Aaron Lauterer <a.lauterer@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>,
	Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH manager] ui: PBSEdit: cleanup iframe for paperkey
Date: Mon, 13 Mar 2023 09:30:44 +0100	[thread overview]
Message-ID: <580d7569-5766-3378-c542-e165516ff1d9@proxmox.com> (raw)
In-Reply-To: <37db403c-d472-d57d-2d52-2fa4c254a6a6@proxmox.com>



On 3/11/23 17:49, Thomas Lamprecht wrote:
> Am 10/03/2023 um 15:36 schrieb Aaron Lauterer:
>> Otherwise the iframe used to print the paperkey will remain even after
>> the encryption key window is closed.
> 
> thanks for noticing!
> 
>> Additionally clean before creating a new one as otherwise we might end
>> up with multiple iframes.
> 
> having to do both seems wrong. Why not add a on close or on destroy listener
> on the window which handles that always correctly in a single place?
> 
>>
>> Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
>> ---
>>   www/manager6/storage/PBSEdit.js | 9 ++++++++-
>>   1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/www/manager6/storage/PBSEdit.js b/www/manager6/storage/PBSEdit.js
>> index 5b6b6bb8..dbc88668 100644
>> --- a/www/manager6/storage/PBSEdit.js
>> +++ b/www/manager6/storage/PBSEdit.js
[...]
>> @@ -181,6 +187,7 @@ ${prettifiedKey}
>>   
>>   	printFrame.src = "data:text/html;base64," + btoa(html);
>>   	document.body.appendChild(printFrame);
>> +	return printFrame;
> 
> You could replace the whole patch with adding the following line here:
> 
> me.on('destroy', () => document.body.removeChild(printFrame));
> 
> can also apply directly with a Reported-by tag if you see nothing off with this,
> whatever you prefer?

Sure go ahead. Your approach is a lot cleaner. :)

> 
>>       },
>>   });
>>   
> 




  reply	other threads:[~2023-03-13  8:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 14:36 Aaron Lauterer
2023-03-11 16:49 ` Thomas Lamprecht
2023-03-13  8:30   ` Aaron Lauterer [this message]
2023-03-13  9:50     ` Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=580d7569-5766-3378-c542-e165516ff1d9@proxmox.com \
    --to=a.lauterer@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal