diff --git a/js/core/GUI.js b/js/core/GUI.js index b60b8b5..7c34357 100644 --- a/js/core/GUI.js +++ b/js/core/GUI.js @@ -255,6 +255,7 @@ export class GUI // close is called by both buttons and when the user clicks on the cross: close: function () { //$.unblockUI(); + $(this).dialog('destroy').remove(); self._dialogComponent.status = PsychoJS.Status.FINISHED; } @@ -313,8 +314,6 @@ export class GUI showOK = true, onOK } = {}) { - // destroy previous dialog box: - this.destroyDialog(); let htmlCode; let titleColour; @@ -410,7 +409,7 @@ export class GUI id: "buttonOk", text: "Ok", click: function() { - $(this).dialog("close"); + $(this).dialog("destroy").remove(); // execute callback function: if (typeof onOK !== 'undefined') @@ -504,24 +503,6 @@ export class GUI } - /** - * Destroy the currently opened dialog box. - * - * @name module:core.GUI#dialog - * @function - * @public - */ - destroyDialog() - { - if ($("#expDialog").length) { - $("#expDialog").dialog("destroy"); - } - if ($("#msgDialog").length) { - $("#msgDialog").dialog("destroy"); - } - } - - /** * Listener for resource event from the [Server Manager]{@link ServerManager}. * diff --git a/js/core/PsychoJS.js b/js/core/PsychoJS.js index f70a235..9335ce3 100644 --- a/js/core/PsychoJS.js +++ b/js/core/PsychoJS.js @@ -23,7 +23,7 @@ import * as util from '../util/Util'; /** *

PsychoJS manages the lifecycle of an experiment. It initialises the PsychoJS library and its various components (e.g. the {@link ServerManager}, the {@link EventManager}), and is used by the experiment to schedule the various tasks.

- * + * * @class * @param {Object} options * @param {boolean} [options.debug= true] whether or not to log debug information in the browser console @@ -125,10 +125,10 @@ export class PsychoJS /** * Open a PsychoJS Window. - * + * *

This opens a PIXI canvas.

*

Note: we can only open one window.

- * + * * @param {Object} options * @param {string} [options.name] the name of the window * @param {boolean} [options.fullscr] whether or not to go fullscreen @@ -138,7 +138,7 @@ export class PsychoJS * @param {boolean} [options.waitBlanking] whether or not to wait for all rendering operations to be done * before flipping * @throws {Object.} exception if a window has already been opened - * + * * @public */ openWindow({ @@ -168,7 +168,7 @@ export class PsychoJS /** * Set the completion and cancellation URL to which the participant will be redirect at the end of the experiment. - * + * * @param {string} completionUrl - the completion URL * @param {string} cancellationUrl - the cancellation URL */ @@ -180,7 +180,7 @@ export class PsychoJS /** * Schedule a task. - * + * * @param task - the task to be scheduled * @param args - arguments for that task * @public @@ -198,8 +198,8 @@ export class PsychoJS */ /** * Schedule a series of task based on a condition. - * - * @param {PsychoJS.condition} condition + * + * @param {PsychoJS.condition} condition * @param {Scheduler} thenScheduler scheduler to run if the condition is true * @param {Scheduler} elseScheduler scheduler to run if the condition is false * @public @@ -213,7 +213,7 @@ export class PsychoJS /** * Start the experiment. - * + * * @param {Object} options * @param {string} [options.configURL=config.json] - the URL of the configuration file * @param {string} [options.expName=UNKNOWN] - the name of the experiment @@ -324,7 +324,7 @@ export class PsychoJS /** * Make the attributes of the given object those of PsychoJS and those of * the top level variable (e.g. window) as well. - * + * * @param {Object.} obj the object whose attributes we will mirror * @public */ @@ -344,10 +344,10 @@ export class PsychoJS /** * Close everything and exit nicely at the end of the experiment, * potentially redirecting to one of the URLs previously specified by setRedirectUrls. - * + * *

Note: if the resource manager is busy, we inform the participant * that he or she needs to wait for a bit.

- * + * * @param {Object} options * @param {string} [options.message] - optional message to be displayed in a dialog box before quitting * @param {boolean} [options.isCompleted = false] - whether or not the participant has completed the experiment @@ -387,9 +387,6 @@ export class PsychoJS // close the window: self._window.close(); - // destroy dialog boxes: - self._gui.destroyDialog(); - // remove everything from the browser window: while (document.body.hasChildNodes()) document.body.removeChild(document.body.lastChild); @@ -415,7 +412,7 @@ export class PsychoJS /** * Configure PsychoJS for the running experiment. - * + * * @async * @protected * @param {string} configURL - the URL of the configuration file @@ -515,7 +512,7 @@ export class PsychoJS /** * Capture all errors and display them in a pop-up error box. - * + * * @protected */ _captureErrors() { @@ -553,7 +550,7 @@ export class PsychoJS /** * PsychoJS status. - * + * * @enum {Symbol} * @readonly * @public