Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add destroyOnHide for DialogService pubSub payloads #1362

Merged
merged 1 commit into from
Jun 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion aikau/src/main/resources/alfresco/services/DialogService.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@
* @property {object} [customFormConfig=null] Any additional configuration that can be applied to a [Form]{@link module:alfresco/forms/Form} (please note that the following form configuration
* attributes will always be overridden by specific form dialog configuration: "additionalCssClasses", "displayButtons", "widgets", "value", "warnings" and "warningsPosition")
* @property {boolean} [noMinWidth=false] Indicates whether the minimum width restriction should be lifted
* @property {boolean} [destroyOnHide=false] Indicates the dialog should be completely torn down and its widgets destroyed immediately after being hidden.
*/

/**
Expand All @@ -177,6 +178,7 @@
* @property {boolean} [fullScreenMode=false] Whether or not to create the dialog the size of the screen
* @property {boolean} [fullScreenPadding=10] The padding to leave around the dialog when in full screen mode
* @property {boolean} [noMinWidth=false] Indicates whether the minimum width restriction should be lifted
* @property {boolean} [destroyOnHide=false] Indicates the dialog should be completely torn down and its widgets destroyed immediately after being hidden.
*/

define(["dojo/_base/declare",
Expand Down Expand Up @@ -955,10 +957,15 @@ define(["dojo/_base/declare",
});

// If there are no dialogs "left" then set the dialogs-showing CSS state to "false"
if(this._activeDialogs.length === 0) {
if (this._activeDialogs.length === 0) {
domClass.remove(document.documentElement, "alfresco-dialog-AlfDialog--dialogs-visible");
domStyle.set(document.body, "margin-right", "0");
}

// If the request payload specified destroyOnHide do the cleanup early
if (payload.destroyOnHide) {
this.cleanUpAnyPreviousDialog(payload);
}
}));
},

Expand Down