diff --git a/core/misc/collapse.js b/core/misc/collapse.js index 174bf9b..91b10fd 100644 --- a/core/misc/collapse.js +++ b/core/misc/collapse.js @@ -45,6 +45,10 @@ /** * Initialize and setup summary events and markup. + * + * @fires event:summaryUpdated + * + * @listens event:summaryUpdated */ setupSummary: function () { this.$summary = $(''); diff --git a/core/misc/dialog/dialog.position.js b/core/misc/dialog/dialog.position.js index 3834783..007ef24 100644 --- a/core/misc/dialog/dialog.position.js +++ b/core/misc/dialog/dialog.position.js @@ -3,6 +3,12 @@ * Positioning extensions for dialogs. */ +/** + * Triggers when content inside a dialog changes. + * + * @event dialogContentResize + */ + (function ($, Drupal, drupalSettings, debounce, displace) { "use strict"; @@ -17,6 +23,8 @@ * jQuery UI dialog. Although not a built-in jQuery UI option, this can * be disabled by setting autoResize: false in the options array when creating * a new Drupal.dialog(). + * + * @fires event:dialogContentResize */ function resetSize(event) { var positionOptions = ['width', 'height', 'minWidth', 'minHeight', 'maxHeight', 'maxWidth', 'position']; diff --git a/core/misc/displace.js b/core/misc/displace.js index cbf9563..3dde5ba 100644 --- a/core/misc/displace.js +++ b/core/misc/displace.js @@ -18,7 +18,7 @@ */ /** - * Event triggering when layout of the page changes. + * Triggers when layout of the page changes. * * This is used to position fixed element on the page during page resize and * Toolbar toggling. @@ -62,7 +62,7 @@ /** * Informs listeners of the current offset dimensions. * - * @fires drupalViewportOffsetChange + * @fires event:drupalViewportOffsetChange * * @param {bool} [broadcast] * When true or undefined, causes the recalculated offsets values to be diff --git a/core/misc/form.js b/core/misc/form.js index ceef143..afc23ec 100644 --- a/core/misc/form.js +++ b/core/misc/form.js @@ -3,6 +3,15 @@ * Form features. */ +/** + * Triggers when a value in the form changed + * + * The event triggers when content is typed or pasted in a text field, before + * the change event triggers. + * + * @event formUpdated + */ + (function ($, Drupal, debounce) { "use strict"; @@ -18,6 +27,10 @@ /** * Sets the summary for all matched elements. * + * @fires event:summaryUpdated + * + * @listens event:formUpdated + * * @param {function} callback * Either a function that will be called each time the summary is * retrieved or a string (which is returned each time). @@ -104,6 +117,8 @@ /** * Sends a 'formUpdated' event each time a form element is modified. + * + * @fires event:formUpdated */ function triggerFormUpdated(element) { $(element).trigger('formUpdated'); @@ -130,6 +145,10 @@ * Triggers the 'formUpdated' event on form elements when they are modified. */ Drupal.behaviors.formUpdated = { + + /** + * @fires event:formUpdated + */ attach: function (context) { var $context = $(context); var contextIsForm = $context.is('form'); diff --git a/core/misc/tabbingmanager.js b/core/misc/tabbingmanager.js index de5bf64..62dee65 100644 --- a/core/misc/tabbingmanager.js +++ b/core/misc/tabbingmanager.js @@ -3,6 +3,30 @@ * Manages page tabbing modifications made by modules. */ +/** + * Allow modules to respond to the constrain event. + * + * @event drupalTabbingConstrained + */ + +/** + * Allow modules to respond to the tabbingContext release event. + * + * @event drupalTabbingContextReleased + */ + +/** + * Allow modules to respond to the constrain event. + * + * @event drupalTabbingContextActivated + */ + +/** + * Allow modules to respond to the constrain event. + * + * @event drupalTabbingContextDeactivated + */ + (function ($, Drupal) { "use strict"; @@ -32,6 +56,8 @@ * Makes elements outside of the specified set of elements unreachable via * the tab key. * + * @fires event:drupalTabbingConstrained + * * @param {jQuery} elements * The set of elements to which tabbing should be constrained. Can also * be a jQuery-compatible selector string. @@ -255,6 +281,8 @@ * * Once a TabbingContext object is released, it can never be activated * again. + * + * @fires event:drupalTabbingContextReleased */ release: function () { if (!this.released) { @@ -268,6 +296,8 @@ /** * Activates this TabbingContext. + * + * @fires event:drupalTabbingContextActivated */ activate: function () { // A released TabbingContext object can never be activated again. @@ -281,6 +311,8 @@ /** * Deactivates this TabbingContext. + * + * @fires event:drupalTabbingContextDeactivated */ deactivate: function () { if (this.active) { diff --git a/core/misc/tabledrag.js b/core/misc/tabledrag.js index a06bb48..b3440c7 100644 --- a/core/misc/tabledrag.js +++ b/core/misc/tabledrag.js @@ -3,6 +3,12 @@ * Provide dragging capabilities to admin uis. */ +/** + * Triggers when weights columns are toggled. + * + * @event columnschange + */ + (function ($, Drupal, drupalSettings) { "use strict"; @@ -233,6 +239,8 @@ /** * Hide or display weight columns. Triggers an event on change. * + * @fires event:columnschange + * * @param {bool} displayWeight * 'true' will show weight columns. */ diff --git a/core/misc/tableheader.js b/core/misc/tableheader.js index 2aef865..606186f 100644 --- a/core/misc/tableheader.js +++ b/core/misc/tableheader.js @@ -97,6 +97,8 @@ * * @name Drupal.TableHeader * + * @listens event:columnschange + * * @param {HTMLElement} table * DOM object for the table to add a sticky header to. */ diff --git a/core/misc/vertical-tabs.js b/core/misc/vertical-tabs.js index f291405..ab57435 100644 --- a/core/misc/vertical-tabs.js +++ b/core/misc/vertical-tabs.js @@ -3,6 +3,15 @@ * Define vertical tabs functionality. */ +/** + * Triggers when form values inside a vertical tab changes. + * + * This is used to update the summary in vertical tabs in order to know what + * are the important fields' values. + * + * @event summaryUpdated + */ + (function ($) { "use strict"; @@ -85,6 +94,10 @@ * * @constructor * + * @fires event:summaryUpdated + * + * @listens event:summaryUpdated + * * @param {object} settings * An object with the following keys: * - title: The name of the tab.