mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-10 01:09:43 +02:00
Merge #432: pop a session, a file preview or a web tab out into a native wrapper's own window
# Conflicts: # src/web/public/app.js # src/web/public/settings-ui.js
This commit is contained in:
@@ -4334,6 +4334,12 @@ Object.assign(CodemanApp.prototype, {
|
||||
*/
|
||||
detachFilePreview() {
|
||||
if (!this.filePreviewDetachUrl) return;
|
||||
const hosted = this.openInHostWindow?.(this.filePreviewDetachUrl) ?? null;
|
||||
if (hosted !== null) {
|
||||
if (hosted) this.closeFilePreview();
|
||||
else this.showToast('Could not open a new window for this preview', 'error');
|
||||
return;
|
||||
}
|
||||
const win = window.open(this.filePreviewDetachUrl, '_blank');
|
||||
if (!win) {
|
||||
this.showToast('Pop-up blocked: allow pop-ups for this site to detach previews', 'error');
|
||||
|
||||
Reference in New Issue
Block a user