[ACA-2260] Open in Office - action breaks application in IE (#1014)

* ie office luncher workaround

* open office without location navigation

* check instance before remove
This commit is contained in:
Cilibiu Bogdan 2019-03-13 18:26:54 +02:00 committed by Denys Vuika
parent d9b2565783
commit becd71adff

View File

@ -112,22 +112,16 @@ export class AosEditOnlineService {
) {
const protocolUrl = protocolHandler + ':ofe%7Cu%7C' + url;
const input = document.createElement('input');
const inputTop = document.body.scrollTop + 10;
input.setAttribute(
'style',
'z-index: 1000; background-color: rgba(0, 0, 0, 0); ' +
'border: none; outline: none; position: absolute; left: 10px; top: ' +
inputTop +
'px;'
);
document.getElementsByTagName('body')[0].appendChild(input);
input.focus();
location.href = protocolUrl;
const iframe = document.createElement('iframe');
iframe.style.display = 'none';
iframe.src = protocolUrl;
setTimeout(function() {
input.onblur = null;
input.remove();
document.body.appendChild(iframe);
setTimeout(() => {
if (iframe) {
document.body.removeChild(iframe);
}
}, 500);
}
}