Class Index | File Index

Classes


Class JSDialog


Defined in: toolkit.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
JSDialog(preferences, title, template, behavior)
A class to create dialogs.
Method Summary
Method Attributes Method Name and Description
 
appendButtons(buttonsPanel)
Appends dialog buttons to given panel.
 
buildHtmlFromTemplate(templateHtml)
 
Called when the user closes the dialog with no validation.
 
Closes the dialog and discard the associated DOM.
 
displayView(parentView)
Default implementation of the DialogView.displayView function.
 
Releases any resource or listener associated with this component, when it's disposed.
 
Returns the close button of this dialog.
 
getInput(name)
Returns the input that corresponds to the given name within this dialog.
 
 
setTitle(title)
Sets dialog title
 
Called when the user presses the OK button.
Class Detail
JSDialog(preferences, title, template, behavior)
A class to create dialogs.
Author: Renaud Pawlak.
Parameters:
preferences
the current user preferences
{string} title
the dialog's title (may contain HTML)
{string|HTMLElement} template
template element (view HTML will be this element's innerHTML) or HTML string (if null or undefined, then the component creates an empty div for the root node)
{{applier: function(JSDialog)|disposer: function(JSDialog)|size?: "small"|"medium"|"default"}} behavior Optional
- applier: an optional dialog application function - disposer: an optional dialog function to release associated resources, listeners, ... - size: override style with "small" or "medium"
Method Detail
appendButtons(buttonsPanel)
Appends dialog buttons to given panel. Caution : this method is called from constructor.
Parameters:
{HTMLElement} buttonsPanel
Dialog buttons panel

buildHtmlFromTemplate(templateHtml)
Parameters:
{string} templateHtml

cancel()
Called when the user closes the dialog with no validation.

close()
Closes the dialog and discard the associated DOM.

displayView(parentView)
Default implementation of the DialogView.displayView function.
Parameters:
parentView

dispose()
Releases any resource or listener associated with this component, when it's disposed. Override to perform custom clean - Don't forget to call super.dispose().

getCloseButton()
Returns the close button of this dialog.

getInput(name)
Returns the input that corresponds to the given name within this dialog.
Parameters:
name

{boolean} isDisplayed()
Returns:
{boolean} true if this dialog is currently shown, false otherwise

setTitle(title)
Sets dialog title
Parameters:
{string} title

validate()
Called when the user presses the OK button. Override to implement custom behavior when the dialog is validated by the user.

© Copyright 2024 Emmanuel PUYBARET / eTeks
Distributed under GNU General Public License
Documentation generated by JsDoc Toolkit 2.4.0 on Thu Apr 04 2024 17:30:26 GMT+0200 (CEST)