summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2015-08-29 06:27:44 (GMT)
committerwebchick2015-08-29 06:27:44 (GMT)
commitb154a8cf4ecbc0e129e95727c6da03aeb42bf750 (patch)
treec410bc7351f41d7de8d1d2a78bcd88150b091c71
parent524b3c0f02efa939b919259d219193403469daba (diff)
Issue #2530706 by nod_, eiriksm: JSDoc node module
-rw-r--r--core/modules/node/content_types.js4
-rw-r--r--core/modules/node/node.js13
-rw-r--r--core/modules/node/node.preview.js16
3 files changed, 27 insertions, 6 deletions
diff --git a/core/modules/node/content_types.js b/core/modules/node/content_types.js
index 77ab168..068555d 100644
--- a/core/modules/node/content_types.js
+++ b/core/modules/node/content_types.js
@@ -8,8 +8,12 @@
"use strict";
/**
+ * Behaviors for setting summaries on content type form.
*
* @type {Drupal~behavior}
+ *
+ * @prop {Drupal~behaviorAttach} attach
+ * Attaches summary behaviors on content type edit forms.
*/
Drupal.behaviors.contentTypes = {
attach: function (context) {
diff --git a/core/modules/node/node.js b/core/modules/node/node.js
index ebb22ff..5dcdc05 100644
--- a/core/modules/node/node.js
+++ b/core/modules/node/node.js
@@ -8,8 +8,12 @@
"use strict";
/**
+ * Behaviors for tabs in the node edit form.
*
* @type {Drupal~behavior}
+ *
+ * @prop {Drupal~behaviorAttach} attach
+ * Attaches summary behavior for tabs in the node edit form.
*/
Drupal.behaviors.nodeDetailsSummaries = {
attach: function (context) {
@@ -18,10 +22,11 @@
var $revisionContext = $(context);
var revisionCheckbox = $revisionContext.find('.form-item-revision input');
- // Return 'New revision' if the 'Create new revision' checkbox is checked,
- // or if the checkbox doesn't exist, but the revision log does. For users
- // without the "Administer content" permission the checkbox won't appear,
- // but the revision log will if the content type is set to auto-revision.
+ // Return 'New revision' if the 'Create new revision' checkbox is
+ // checked, or if the checkbox doesn't exist, but the revision log does.
+ // For users without the "Administer content" permission the checkbox
+ // won't appear, but the revision log will if the content type is set to
+ // auto-revision.
if (revisionCheckbox.is(':checked') || (!revisionCheckbox.length && $revisionContext.find('.form-item-revision-log textarea').length)) {
return Drupal.t('New revision');
}
diff --git a/core/modules/node/node.preview.js b/core/modules/node/node.preview.js
index d69cf3b..ec48832 100644
--- a/core/modules/node/node.preview.js
+++ b/core/modules/node/node.preview.js
@@ -8,10 +8,17 @@
"use strict";
/**
- * Disabling all links (except local fragment identifiers such as href="#frag")
- * in node previews to prevent users from leaving the page.
+ * Disables all non-relevant links in node previews.
+ *
+ * Destroys links (except local fragment identifiers such as href="#frag") in
+ * node previews to prevent users from leaving the page.
*
* @type {Drupal~behavior}
+ *
+ * @prop {Drupal~behaviorAttach} attach
+ * Attaches confirmation prompt for clicking links in node preview mode.
+ * @prop {Drupal~behaviorDetach} detach
+ * Detaches confirmation prompt for clicking links in node preview mode.
*/
Drupal.behaviors.nodePreviewDestroyLinks = {
attach: function (context) {
@@ -61,6 +68,9 @@
* Switch view mode.
*
* @type {Drupal~behavior}
+ *
+ * @prop {Drupal~behaviorAttach} attach
+ * Attaches automatic submit on `formUpdated.preview` events.
*/
Drupal.behaviors.nodePreviewSwitchViewMode = {
attach: function (context) {
@@ -74,8 +84,10 @@
};
/**
+ * Theme function for node preview modal.
*
* @return {string}
+ * Markup for the node preview modal.
*/
Drupal.theme.nodePreviewModal = function () {
return '<p>' +