summaryrefslogtreecommitdiffstatshomepage
path: root/core/misc/dialog
diff options
context:
space:
mode:
authorNathaniel Catchpole <catch@35733.no-reply.drupal.org>2016-02-22 10:51:47 +0900
committerNathaniel Catchpole <catch@35733.no-reply.drupal.org>2016-02-22 10:51:47 +0900
commitf33c6be7b50ec987bf8b4aa6b716f07c4a53c9f0 (patch)
tree446d49cc1e2f0cb0bb8421b83f71789597a5d5c8 /core/misc/dialog
parente08394a6fd75158fb170acb3c9532c31dc539c7a (diff)
downloaddrupal-f33c6be7b50ec987bf8b4aa6b716f07c4a53c9f0.tar.gz
drupal-f33c6be7b50ec987bf8b4aa6b716f07c4a53c9f0.zip
Issue #2559697 by theMusician, eiriksm, AjitS, dimaro: JSDoc misc/
Diffstat (limited to 'core/misc/dialog')
-rw-r--r--core/misc/dialog/dialog.ajax.js27
-rw-r--r--core/misc/dialog/dialog.js2
-rw-r--r--core/misc/dialog/dialog.position.js3
3 files changed, 31 insertions, 1 deletions
diff --git a/core/misc/dialog/dialog.ajax.js b/core/misc/dialog/dialog.ajax.js
index bfe2980639d..16f72f00ab9 100644
--- a/core/misc/dialog/dialog.ajax.js
+++ b/core/misc/dialog/dialog.ajax.js
@@ -11,6 +11,9 @@
* Initialize dialogs for Ajax purposes.
*
* @type {Drupal~behavior}
+ *
+ * @prop {Drupal~behaviorAttach} attach
+ * Attaches the behaviors for dialog ajax functionality.
*/
Drupal.behaviors.dialog = {
attach: function (context, settings) {
@@ -90,10 +93,14 @@
* Command to open a dialog.
*
* @param {Drupal.Ajax} ajax
+ * The Drupal Ajax object.
* @param {object} response
+ * Object holding the server response.
* @param {number} [status]
+ * The HTTP status code.
*
* @return {bool|undefined}
+ * Returns false if there was no selector property in the response object.
*/
Drupal.AjaxCommands.prototype.openDialog = function (ajax, response, status) {
if (!response.selector) {
@@ -146,10 +153,15 @@
* If no selector is given, it defaults to trying to close the modal.
*
* @param {Drupal.Ajax} [ajax]
+ * The ajax object.
* @param {object} response
+ * Object holding the server response.
* @param {string} response.selector
+ * The selector of the dialog.
* @param {bool} response.persist
+ * Whether to persist the dialog element or not.
* @param {number} [status]
+ * The HTTP status code.
*/
Drupal.AjaxCommands.prototype.closeDialog = function (ajax, response, status) {
var $dialog = $(response.selector);
@@ -170,11 +182,17 @@
* JQuery UI specific way of setting dialog options.
*
* @param {Drupal.Ajax} [ajax]
+ * The Drupal Ajax object.
* @param {object} response
+ * Object holding the server response.
* @param {string} response.selector
+ * Selector for the dialog element.
* @param {string} response.optionsName
+ * Name of a key to set.
* @param {string} response.optionValue
+ * Value to set.
* @param {number} [status]
+ * The HTTP status code.
*/
Drupal.AjaxCommands.prototype.setDialogOption = function (ajax, response, status) {
var $dialog = $(response.selector);
@@ -187,9 +205,13 @@
* Binds a listener on dialog creation to handle the cancel link.
*
* @param {jQuery.Event} e
+ * The event triggered.
* @param {Drupal.dialog~dialogDefinition} dialog
+ * The dialog instance.
* @param {jQuery} $element
- * @param {object} settings
+ * The jQuery collection of the dialog element.
+ * @param {object} [settings]
+ * Dialog settings.
*/
$(window).on('dialog:aftercreate', function (e, dialog, $element, settings) {
$element.on('click.dialog', '.dialog-cancel', function (e) {
@@ -203,8 +225,11 @@
* Removes all 'dialog' listeners.
*
* @param {jQuery.Event} e
+ * The event triggered.
* @param {Drupal.dialog~dialogDefinition} dialog
+ * The dialog instance.
* @param {jQuery} $element
+ * jQuery collection of the dialog element.
*/
$(window).on('dialog:beforeclose', function (e, dialog, $element) {
$element.off('.dialog');
diff --git a/core/misc/dialog/dialog.js b/core/misc/dialog/dialog.js
index 197fae22731..ea1e52c8dc9 100644
--- a/core/misc/dialog/dialog.js
+++ b/core/misc/dialog/dialog.js
@@ -55,10 +55,12 @@
* Polyfill HTML5 dialog element with jQueryUI.
*
* @param {HTMLElement} element
+ * The element that holds the dialog.
* @param {object} options
* jQuery UI options to be passed to the dialog.
*
* @return {Drupal.dialog~dialogDefinition}
+ * The dialog instance.
*/
Drupal.dialog = function (element, options) {
var undef;
diff --git a/core/misc/dialog/dialog.position.js b/core/misc/dialog/dialog.position.js
index c0dd9df0e1a..76786460a3b 100644
--- a/core/misc/dialog/dialog.position.js
+++ b/core/misc/dialog/dialog.position.js
@@ -27,6 +27,7 @@
* @function Drupal.dialog~resetSize
*
* @param {jQuery.Event} event
+ * The event triggered.
*
* @fires event:dialogContentResize
*/
@@ -67,8 +68,10 @@
* @function Drupal.dialog~resetPosition
*
* @param {object} options
+ * Options object.
*
* @return {object}
+ * Altered options object.
*/
function resetPosition(options) {
var offsets = displace.offsets;