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.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