Dynamic module ialog

Index

Variables

Interfaces

Classes

Functions

Variables

MessageBox: Box

The constructor function used to create message boxes.

currentZIndex: number

The css zIndex that the last dialog was displayed at.

Functions

addContext(name: string, modalContext: DialogContext)

Adds (or replaces) a dialog context.

Parameters

  • name: string

    The name of the context to add.

  • modalContext: DialogContext

close(obj: any, results?: Array<any>)

Closes the dialog associated with the specified object.

Parameters

  • obj: any

    The object whose dialog should be closed.

  • results?: Array<any> optional

getContext(name: string): DialogContext

Gets the dialog context by name or returns the default context if no name is specified.

Parameters

  • name: string

Returns

DialogContext

True context.

getDialog(obj: any): Dialog

Gets the dialog model that is associated with the specified object.

Parameters

  • obj: any

    The object for whom to retrieve the dialog.

Returns

Dialog

The dialog model.

getNextZIndex(): number

Gets the next css zIndex at which a dialog should be displayed.

Returns

number

The next usable zIndex.

install(config: Object)

Installs this module into Durandal; called by the framework. Adds app.showDialog and app.showMessage convenience methods.

Parameters

  • config: Object

isOpen(): boolean

Determines whether or not there are any dialogs open.

Returns

boolean

True if a dialog is open. false otherwise.

show(obj: any, activationData?: any, context?: string): JQueryPromise

Shows a dialog.

Parameters

  • obj: any

    The object (or moduleId) to display as a dialog.

  • activationData?: any optional
  • context?: string optional

Returns

JQueryPromise

A promise that resolves when the dialog is closed and returns any data passed at the time of closing.

showMessage(message: string, title?: string, options?: Array<string>, autoclose?: boolean, settings?: Object): JQueryPromise

Shows a message box.

Parameters

  • message: string

    The message to display in the dialog.

  • title?: string optional
  • options?: Array<string> optional
  • autoclose?: boolean optional
  • settings?: Object optional

Returns

JQueryPromise

A promise that resolves when the message box is closed and returns the selected option.

showMessage(message: string, title?: string, options?: DialogButton[], autoclose?: boolean, settings?: Object): JQueryPromise

Shows a message box.

Parameters

  • message: string

    The message to display in the dialog.

  • title?: string optional
  • options?: DialogButton[] optional
  • autoclose?: boolean optional
  • settings?: Object optional

Returns

JQueryPromise

A promise that resolves when the message box is closed and returns the selected option.