Class ProtoPopup.Confirm
Extends
ProtoPopup.
Creates a ProtoPopup.Confirm object
Defined in: proto_popup_confirm.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
ProtoPopup.Confirm(id, config)
ProtoPopup.Confirm is based on ProtoPopup and ads 'OK' and
'Cancel' buttons to its base object.
|
| Field Attributes | Field Name and Description |
|---|---|
| <static> |
ProtoPopup.Confirm.config
The default configuration inherited from
ProtoPopup#config augmented with:
okBtnLabel: The label of the "OK" button inserted
in the popup's footer section.
|
| Method Attributes | Method Name and Description |
|---|---|
| <static> |
ProtoPopup.Confirm.get(id, config)
Class method returning (maybe first create) a draggable popup DIV
for confirm dialogs.
|
| <static> |
ProtoPopup.Confirm.makeFunction(id, config)
Class method making custom functions accepting one argument that
will be inserted in the body section of the underlying
ProtoPopup.Confirm object created behind the scenes.
|
- Methods borrowed from class ProtoPopup:
- centerIt, hide, makeButton, setHtml, show
- Events borrowed from class ProtoPopup:
- hideOnEscape
Class Detail
ProtoPopup.Confirm(id, config)
ProtoPopup.Confirm is based on ProtoPopup and ads 'OK' and
'Cancel' buttons to its base object.
- Parameters:
- {STRING} id
- A unique string identifying a popup
- {OBJECT} config
- The configuration object #.config
- Returns:
- ProtoPopup.Confirm object
Field Detail
<static>
{object}
ProtoPopup.Confirm.config
The default configuration inherited from
ProtoPopup#config augmented with:
okBtnLabel: The label of the "OK" button inserted
in the popup's footer section. Defaults to 'OK'.
cancelBtnLabel: The label of the "Cancel" button inserted in the popup's footer section. Defaults to 'Cancel'.
onOk: The callback executed when the 'OK' button is clicked. Defaults to the empty function.
onCancel: The callback executed when the 'Cancel' button is clicked. Defaults to the empty function.
okBtnBackgroundImage {STRING} - CSS property 'background-image' for the ok button. Defaults to undefined.
cancelBtnBackgroundImage {STRING} - CSS property 'background-image' for the cancel button. Defaults to undefined.
cancelBtnLabel: The label of the "Cancel" button inserted in the popup's footer section. Defaults to 'Cancel'.
onOk: The callback executed when the 'OK' button is clicked. Defaults to the empty function.
onCancel: The callback executed when the 'Cancel' button is clicked. Defaults to the empty function.
okBtnBackgroundImage {STRING} - CSS property 'background-image' for the ok button. Defaults to undefined.
cancelBtnBackgroundImage {STRING} - CSS property 'background-image' for the cancel button. Defaults to undefined.
Method Detail
<static>
ProtoPopup.Confirm.get(id, config)
Class method returning (maybe first create) a draggable popup DIV
for confirm dialogs. Given the same id argument returns the same popup
object, following the singleton pattern. See the example of
the base class' ProtoPopup.get
- Parameters:
- {STRING} id
- The name of the popup used to build its ID.
- {OBJECT} config
- The config object, see #.config.
- Returns:
- The initialized and draggable popup.
<static>
ProtoPopup.Confirm.makeFunction(id, config)
Class method making custom functions accepting one argument that
will be inserted in the body section of the underlying
ProtoPopup.Confirm object created behind the scenes.
Make a custom info() method
// make the method
var info = ProtoPopup.Confirm.makeFunction('info', {
header : 'Question'
});
// first use
info('This or That');
// second use (using the same popup, showing the same header
info('To be or not to be');
- Parameters:
- {STRING} id
- The ID of the popup.
- {OBJECT} config
- The #config object.
- Returns:
- A function accepting one argument to be inserted into the popup's body section.