Have questions? Stuck? Please check our FAQ for some common questions and answers.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

DialogService

DialogService is an Angular Factory in the Layer module implemented by dialog.js. It provides an API to create (and show) a dialog panel with title, arbitrary content, and action buttons.

Here is the dialog in action in the Application View:

Function Descriptions

openDialog

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

 


closeDialog

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.


 
  • No labels