Skip to content

Commit 55c34a3

Browse files
committed
frame appearing all at once with new loads
1 parent 2fc1965 commit 55c34a3

File tree

4 files changed

+42
-34
lines changed

4 files changed

+42
-34
lines changed

build/nodegame-window.js

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,6 +1766,9 @@
17661766
// Keep track of nested call to loadFrame.
17671767
updateAreLoading(this, 1);
17681768

1769+
// Hide iframe content while loading.
1770+
iframe.style.visibility = 'hidden';
1771+
17691772
// Add the onLoad event listener:
17701773
if (!loadCache || !frameReady) {
17711774
onLoad(iframe, function() {
@@ -2950,7 +2953,7 @@
29502953

29512954
/**
29522955
* # listeners
2953-
* Copyright(c) 2015 Stefano Balietti
2956+
* Copyright(c) 2021 Stefano Balietti
29542957
* MIT Licensed
29552958
*
29562959
* GameWindow listeners
@@ -2961,22 +2964,22 @@
29612964

29622965
"use strict";
29632966

2964-
var J = node.JSUS;
2965-
2966-
function getElement(idOrObj, prefix) {
2967-
var el;
2968-
if ('string' === typeof idOrObj) {
2969-
el = W.getElementById(idOrObj);
2970-
}
2971-
else if (J.isElement(idOrObj)) {
2972-
el = idOrObj;
2973-
}
2974-
else {
2975-
throw new TypeError(prefix + ': idOrObj must be string ' +
2976-
' or HTML Element.');
2977-
}
2978-
return el;
2979-
}
2967+
// var J = node.JSUS;
2968+
2969+
// function getElement(idOrObj, prefix) {
2970+
// var el;
2971+
// if ('string' === typeof idOrObj) {
2972+
// el = W.getElementById(idOrObj);
2973+
// }
2974+
// else if (J.isElement(idOrObj)) {
2975+
// el = idOrObj;
2976+
// }
2977+
// else {
2978+
// throw new TypeError(prefix + ': idOrObj must be string ' +
2979+
// ' or HTML Element.');
2980+
// }
2981+
// return el;
2982+
// }
29802983

29812984
var GameWindow = node.GameWindow;
29822985

build/nodegame-window.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/GameWindow.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,6 +1766,11 @@
17661766
// Keep track of nested call to loadFrame.
17671767
updateAreLoading(this, 1);
17681768

1769+
// Hide iframe content while loading.
1770+
// This way if the page is manipulated in the step callback,
1771+
// the user still sees it appearing all at once.
1772+
iframe.style.visibility = 'hidden';
1773+
17691774
// Add the onLoad event listener:
17701775
if (!loadCache || !frameReady) {
17711776
onLoad(iframe, function() {

listeners/listeners.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* # listeners
3-
* Copyright(c) 2015 Stefano Balietti
3+
* Copyright(c) 2021 Stefano Balietti
44
* MIT Licensed
55
*
66
* GameWindow listeners
@@ -11,22 +11,22 @@
1111

1212
"use strict";
1313

14-
var J = node.JSUS;
14+
// var J = node.JSUS;
1515

16-
function getElement(idOrObj, prefix) {
17-
var el;
18-
if ('string' === typeof idOrObj) {
19-
el = W.getElementById(idOrObj);
20-
}
21-
else if (J.isElement(idOrObj)) {
22-
el = idOrObj;
23-
}
24-
else {
25-
throw new TypeError(prefix + ': idOrObj must be string ' +
26-
' or HTML Element.');
27-
}
28-
return el;
29-
}
16+
// function getElement(idOrObj, prefix) {
17+
// var el;
18+
// if ('string' === typeof idOrObj) {
19+
// el = W.getElementById(idOrObj);
20+
// }
21+
// else if (J.isElement(idOrObj)) {
22+
// el = idOrObj;
23+
// }
24+
// else {
25+
// throw new TypeError(prefix + ': idOrObj must be string ' +
26+
// ' or HTML Element.');
27+
// }
28+
// return el;
29+
// }
3030

3131
var GameWindow = node.GameWindow;
3232

0 commit comments

Comments
 (0)