Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Creates the dialog panel if necessary, resets its content, then shows it on the screen. This function returns an API that allows the dialog box to be configured (more information below).

Example UsageArgumentsReturn Value
api = ds.openDialog(id, opts);id - a unique DOM identifier
opts - options for the dialog (see below) 
an API to configure the dialog

...

Closes the dialog panel. This function is idempotent.

Example UsageArgumentsReturn Value
ds.closeDialog();nonenone

Note that the user action of pressing one of the dialog buttons closes the dialog panel implicitly. Typically, closeDialog() should be invoked when navigating away from the view, to make sure the dialog is cleaned up if it was left open by the user.

createDiv

Creates a detached <div> element, returning a D3 selection. Optionally, a CSS class may be specified to be applied to the element. This is a convenience function to help in the construction of content for the dialog.

Example UsageArgumentsReturn Value
content = ds.createDiv();
content.append('p').text('Some text');
cssClsD3 selection of a detached div element.