mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-27 00:36:44 +03:00
Fix "View in separate window" option
This commit is contained in:
parent
d20b4aa6f2
commit
a1d829c697
2 changed files with 23 additions and 17 deletions
|
|
@ -636,18 +636,19 @@ export function windowPopupKnockout(viewModel, templateID, title, fCallback = nu
|
|||
{
|
||||
const
|
||||
win = window.open(''),
|
||||
doc = win.document,
|
||||
func = '__OpenerApplyBindingsUid' + fakeMd5() + '__',
|
||||
template = $('#' + templateID)
|
||||
;
|
||||
|
||||
window[func] = () => {
|
||||
|
||||
if (win && win.document.body && template && template[0])
|
||||
if (win && doc && doc.body && template && template[0])
|
||||
{
|
||||
const body = $(win.document.body);
|
||||
const body = $(doc.body);
|
||||
|
||||
$('#rl-content', body).html(template.html());
|
||||
$('html', win.document).addClass('external ' + $('html').attr('class'));
|
||||
$('html', doc).addClass('external ' + $('html').attr('class'));
|
||||
|
||||
require('Common/Translator').i18nToNodes(body);
|
||||
|
||||
|
|
@ -665,22 +666,27 @@ export function windowPopupKnockout(viewModel, templateID, title, fCallback = nu
|
|||
}
|
||||
};
|
||||
|
||||
win.document.open();
|
||||
win.document.write('<html><head>' +
|
||||
'<meta charset="utf-8" />' +
|
||||
'<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />' +
|
||||
'<meta name="viewport" content="user-scalable=no" />' +
|
||||
'<meta name="apple-mobile-web-app-capable" content="yes" />' +
|
||||
'<meta name="robots" content="noindex, nofollow, noodp" />' +
|
||||
'<title>' + encodeHtml(title) + '</title>' +
|
||||
'</head><body><div id="rl-content"></div></body></html>');
|
||||
win.document.close();
|
||||
doc.open();
|
||||
doc.write(trim(`
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
|
||||
<meta name="viewport" content="user-scalable=no" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="robots" content="noindex, nofollow, noodp" />
|
||||
<title>${encodeHtml(title)}</title>
|
||||
</head>
|
||||
<body><div id="rl-content"></div></body>
|
||||
</html>
|
||||
`));
|
||||
doc.close();
|
||||
|
||||
const script = win.document.createElement('script');
|
||||
const script = doc.createElement('script');
|
||||
script.type = 'text/javascript';
|
||||
script.innerHTML = `if(window&&window.opener&&window.opener['${func}]'){window.opener['${func}']();window.opener['${func}']=null}`;
|
||||
script.innerHTML = `if(window&&window.opener&&window.opener['${func}']){window.opener['${func}']();window.opener['${func}']=null}`;
|
||||
|
||||
win.document.getElementsByTagName('head')[0].appendChild(script);
|
||||
doc.getElementsByTagName('head')[0].appendChild(script);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@
|
|||
<nobr>
|
||||
<div class="btn-group pull-right" style="margin-right: -11px;">
|
||||
<div class="btn-group pull-right" data-bind="registrateBootstrapDropdown: true, visible: allowComposer || allowMessageListActions || allowMessageActions">
|
||||
<a class="btn btn-thin-2 btn-transparent last btn-dark-disabled-border dropdown-toggle buttonMore" id="more-view-dropdown-id" href="#" tabindex="-1" data-toggle="dropdown" data-tooltip-join="bottom" style="margin-left: -4px; margin-right: 2px" data-bind="command: messageVisibilityCommand, tooltip: 'MESSAGE/BUTTON_MORE', css: {'first': !allowComposer}">
|
||||
<a class="btn btn-thin-2 btn-transparent last btn-dark-disabled-border dropdown-toggle buttonMore" id="more-view-dropdown-id" href="#" tabindex="-1" data-toggle="dropdown" data-tooltip-join="bottom" style="margin-left: -4px; margin-right: 2px" data-bind="command: messageVisibilityCommand, css: {'first': !allowComposer}">
|
||||
<span data-bind="visible: !allowComposer" class="icon-ellipsis-alt"></span>
|
||||
<span data-bind="visible: allowComposer" class="caret"></span>
|
||||
</a>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue