[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 protocolUrl = protocolHandler + ':ofe%7Cu%7C' + url;
const input = document.createElement('input'); const iframe = document.createElement('iframe');
const inputTop = document.body.scrollTop + 10; iframe.style.display = 'none';
input.setAttribute( iframe.src = protocolUrl;
'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;
setTimeout(function() { document.body.appendChild(iframe);
input.onblur = null;
input.remove(); setTimeout(() => {
if (iframe) {
document.body.removeChild(iframe);
}
}, 500); }, 500);
} }
} }