Skip to content

Commit 2624a63

Browse files
committed
cleanup and doc
1 parent cbd8ab0 commit 2624a63

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

lib/GameWindow.js

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
var DOM;
2323

2424
var constants, windowLevels, screenLevels;
25-
var CB_EXECUTED, WIN_LOADING, lockedUpdate;
25+
var CB_EXECUTED, WIN_LOADING;
2626

2727
if (!J) throw new Error('GameWindow: JSUS not found');
2828
DOM = J.require('DOM');
@@ -36,9 +36,6 @@
3636

3737
WIN_LOADING = windowLevels.LOADING;
3838

39-
// Allows just one update at the time to the counter of loading frames.
40-
lockedUpdate = false;
41-
4239
GameWindow.prototype = DOM;
4340
GameWindow.prototype.constructor = GameWindow;
4441

@@ -62,10 +59,7 @@
6259
var iframeWin;
6360
iframeWin = iframe.contentWindow;
6461

65-
function completed(event) {
66-
var iframeDoc;
67-
iframeDoc = J.getIFrameDocument(iframe);
68-
62+
function completed() {
6963
// Detaching the function to avoid double execution.
7064
iframe.removeEventListener('load', completed, false);
7165
iframeWin.removeEventListener('load', completed, false);
@@ -853,16 +847,22 @@
853847
*
854848
* Appends a configurable div element at to "top" of the page
855849
*
856-
* @param {object} opts Optional. Configuration options: TODO
850+
* @param {object} opts Optional. Configuration options:
857851
*
858-
* - toggleBtn
859-
* - toggleBtnLabel
860-
* - toggleBtnRoot:
861-
* - force: destroys current Info Panel
852+
* - root: The HTML element (or its id) under which the Info Panel
853+
* will be appended. Default: above the main frame, or below the
854+
* the header, or under document.body.
855+
* - innerHTML: the content of the Info Panel.
856+
* - force: It destroys current frame, if existing.
857+
* - toggleBtn: If TRUE, it creates a button to toggle the Info Panel.
858+
* Default: TRUE.
859+
* - toggleBtnRoot: the HTML element (or its id) under which the button
860+
* to toggle the Info Panel will be appended. Default: the header.
861+
* - toggleBtnLabel: The text on the button to toggle the Info Panel.
862+
* Default: 'Info'.
862863
*
863-
* @param {boolean} force Optional. Will create the frame even if an
864-
* existing one is found. Deprecated, use force flag in options.
865-
* Default: FALSE
864+
* @param {boolean} force Optional. Deprecated, use force flag in
865+
* options. Default: FALSE
866866
*
867867
* @return {InfoPanel} A reference to the InfoPanel object
868868
*
@@ -898,6 +898,7 @@
898898

899899
root = opts.root;
900900
if (root) {
901+
if ('string' === typeof root) root = W.gid(root);
901902
if (!J.isElement(root)) {
902903
throw new Error('GameWindow.generateInfoPanel: root must be ' +
903904
'undefined or HTMLElement. Found: ' + root);
@@ -2365,8 +2366,6 @@
23652366
* @param {GameWindow} that A reference to the GameWindow instance
23662367
* @param {number} update The number to add to the counter
23672368
*
2368-
* @see GameWindow.lockedUpdate
2369-
*
23702369
* @api private
23712370
*/
23722371
function updateAreLoading(that, update) {

lib/InfoPanel.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* # InfoPanel
3-
* Copyright(c) 2017 Stefano Balietti <ste@nodegame.org>
3+
* Copyright(c) 2021 Stefano Balietti <ste@nodegame.org>
44
* MIT Licensed
55
*
66
* Adds a configurable extra panel at the top of the screen
@@ -336,4 +336,4 @@
336336
})(
337337
('undefined' !== typeof node) ? node : module.parent.exports.node,
338338
('undefined' !== typeof window) ? window : module.parent.exports.window
339-
);;
339+
);

0 commit comments

Comments
 (0)