| 1 |
As well as attaching popup behavior to links, |
As well as attaching popup behavior to links, |
| 2 |
Popups API provides javascript function for creating in-window popup messages. |
Popups API provides javascript function for creating in-window popup messages. |
| 3 |
|
|
| 4 |
TODO: Add more togglable options like non-modal & auto-close. |
Popups.message(title, message) |
|
|
|
|
|
|
|
Drupal.popups.message(title, message) |
|
| 5 |
Produces a simple modal box with the title, message and "OK", "Cancel" buttons. |
Produces a simple modal box with the title, message and "OK", "Cancel" buttons. |
| 6 |
|
|
| 7 |
Drupal.popups.open(title, body, buttons, width) |
Popups.open(title, body, buttons, width) |
| 8 |
More powerful, allows you to specify what the buttons are and what they do. |
More powerful, allows you to specify what the buttons are and what they do. |
| 9 |
buttons is a hash of hash, with button title and function. |
buttons is a hash of hash, with button title and function. |
| 10 |
* Example: |
* Example: |
| 25 |
} |
} |
| 26 |
} |
} |
| 27 |
); |
); |
| 28 |
|
|
| 29 |
|
// TODO - make a more useful api function for opening a path. |
| 30 |
|
Popups.openPath = function(element, options, parent) |
| 31 |
|
* @param element |
| 32 |
|
* Element that was clicked to open the popups. |
| 33 |
|
* @param options |
| 34 |
|
* Hash of options controlling how the popups interacts with the underlying page. |
| 35 |
|
* @param parent |
| 36 |
|
* If path is being opened from inside another popup, that popup is the parent. |
| 37 |
|
|