summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2015-08-29 06:37:31 (GMT)
committerwebchick2015-08-29 06:37:31 (GMT)
commitcee2a4887c7ab08790ca414b28920ff54cc7f4e2 (patch)
tree617eb2eeb78d430be443185399005bc90036eb79
parent608bdebf2076719b814a517c04b91c8826968c69 (diff)
Issue #2513560 by eiriksm, bohemier, nod_: JSDoc file module
-rw-r--r--core/modules/file/file.js31
1 files changed, 28 insertions, 3 deletions
diff --git a/core/modules/file/file.js b/core/modules/file/file.js
index 5a4aea8..7d5d919 100644
--- a/core/modules/file/file.js
+++ b/core/modules/file/file.js
@@ -12,9 +12,14 @@
"use strict";
/**
- * Attach behaviors to managed file element upload fields.
+ * Attach behaviors to the file fields passed in the settings.
*
* @type {Drupal~behavior}
+ *
+ * @prop {Drupal~behaviorAttach} attach
+ * Attaches validation for file extensions.
+ * @prop {Drupal~behaviorDetach} detach
+ * Detaches validation for file extensions.
*/
Drupal.behaviors.fileValidateAutoAttach = {
attach: function (context, settings) {
@@ -50,9 +55,14 @@
};
/**
- * Attach behaviors to managed file element upload fields.
+ * Attach behaviors to file element auto upload.
*
* @type {Drupal~behavior}
+ *
+ * @prop {Drupal~behaviorAttach} attach
+ * Attaches triggers for the upload button.
+ * @prop {Drupal~behaviorDetach} detach
+ * Detaches auto file upload trigger.
*/
Drupal.behaviors.fileAutoUpload = {
attach: function (context) {
@@ -69,6 +79,11 @@
* Attach behaviors to the file upload and remove buttons.
*
* @type {Drupal~behavior}
+ *
+ * @prop {Drupal~behaviorAttach} attach
+ * Attaches form submit events.
+ * @prop {Drupal~behaviorDetach} detach
+ * Detaches form submit events.
*/
Drupal.behaviors.fileButtons = {
attach: function (context) {
@@ -84,9 +99,14 @@
};
/**
- * Attach behaviors to links within managed file elements.
+ * Attach behaviors to links within managed file elements for preview windows.
*
* @type {Drupal~behavior}
+ *
+ * @prop {Drupal~behaviorAttach} attach
+ * Attaches triggers.
+ * @prop {Drupal~behaviorDetach} detach
+ * Detaches triggers.
*/
Drupal.behaviors.filePreviewLinks = {
attach: function (context) {
@@ -110,6 +130,7 @@
* @name Drupal.file.validateExtension
*
* @param {jQuery.Event} event
+ * The event triggered. For example `change.fileValidate`.
*/
validateExtension: function (event) {
event.preventDefault();
@@ -146,6 +167,7 @@
* @name Drupal.file.triggerUploadButton
*
* @param {jQuery.Event} event
+ * The event triggered. For example `change.autoFileUpload`.
*/
triggerUploadButton: function (event) {
$(event.target).closest('.js-form-managed-file').find('.js-form-submit').trigger('mousedown');
@@ -157,6 +179,7 @@
* @name Drupal.file.disableFields
*
* @param {jQuery.Event} event
+ * The event triggered, most likely a `mousedown` event.
*/
disableFields: function (event) {
var $clickedButton = $(this).findOnce('ajax');
@@ -194,6 +217,7 @@
* @name Drupal.file.progressBar
*
* @param {jQuery.Event} event
+ * The event triggered, most likely a `mousedown` event.
*/
progressBar: function (event) {
var $clickedButton = $(this);
@@ -221,6 +245,7 @@
* @name Drupal.file.openInNewWindow
*
* @param {jQuery.Event} event
+ * The event triggered, most likely a `click` event.
*/
openInNewWindow: function (event) {
event.preventDefault();