Scoping corrections. Auto-detect correct iframe.
This commit is contained in:
parent
3e1bf5fce9
commit
6a63e22a6d
14
app/ui.js
14
app/ui.js
|
|
@ -1168,7 +1168,7 @@ const UI = {
|
||||||
* ------v------*/
|
* ------v------*/
|
||||||
|
|
||||||
toggleFullscreen() {
|
toggleFullscreen() {
|
||||||
var doc = document;
|
let doc = document;
|
||||||
if (window.self !== window.top) {
|
if (window.self !== window.top) {
|
||||||
doc = window.parent.document;
|
doc = window.parent.document;
|
||||||
}
|
}
|
||||||
|
|
@ -1186,11 +1186,15 @@ const UI = {
|
||||||
doc.msExitFullscreen();
|
doc.msExitFullscreen();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var doc_el = document.documentElement;
|
let doc_el = document.documentElement;
|
||||||
if (window.self !== window.top) {
|
if (window.self !== window.top) {
|
||||||
var iframeid = WebUtil.getQueryVar('iframeid', null);
|
let iframes = window.parent.document
|
||||||
if (iframeid) {
|
.getElementsByTagName('iframe');
|
||||||
doc_el = window.parent.document.getElementById(iframeid);
|
for (let i in iframes) {
|
||||||
|
if (iframes[i].contentDocument === document) {
|
||||||
|
doc_el = iframes[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (doc_el.requestFullscreen) {
|
if (doc_el.requestFullscreen) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue