Skip to content

Commit

Permalink
Allow custom CSS classes in showProveanceGraphNotFoundDialog (#238)
Browse files Browse the repository at this point in the history
Allow custom CSS classes in `showProveanceGraphNotFoundDialog`
  • Loading branch information
thinkh authored Nov 12, 2019
2 parents b2ae800 + acfbc71 commit 620ef89
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/dialogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ export {setGlobalErrorTemplate} from 'phovea_ui/src/errors';
export {errorAlert as showErrorModalDialog} from './notifications';

export interface IDialogModule {
generateDialog(title: string, primaryBtnText?: string): Dialog;
generateDialog(title: string, primaryBtnText?: string, additionalCSSClasses?: string): Dialog;

areyousure(msg?: string, options?: IAreYouSureOptions | string): Promise<boolean>;

FormDialog: {new(title: string, primaryBtnText?: string, formId?: string): FormDialog};
FormDialog: {new(title: string, primaryBtnText?: string, formId?: string, additionalCSSClasses?: string): FormDialog};
}

export function lazyDialogModule(): Promise<IDialogModule> {
Expand All @@ -26,9 +26,9 @@ export function lazyDialogModule(): Promise<IDialogModule> {
* @param {CLUEGraphManager} manager
* @param {string} id session id
*/
export function showProveanceGraphNotFoundDialog(manager: CLUEGraphManager, id: string) {
export function showProveanceGraphNotFoundDialog(manager: CLUEGraphManager, id: string, additionalCSSClasses: string = '') {
lazyDialogModule().then(({generateDialog}) => {
const dialog = generateDialog('Session Not Found!', 'Create New Temporary Session');
const dialog = generateDialog('Session Not Found!', 'Create New Temporary Session', additionalCSSClasses);
// append bg-danger to the dialog parent element
dialog.body.parentElement.parentElement.parentElement.classList.add('bg-danger');
dialog.body.innerHTML = `
Expand Down

0 comments on commit 620ef89

Please sign in to comment.