Commit b154a8cf authored by webchick's avatar webchick

Issue #2530706 by nod_, eiriksm: JSDoc node module

parent 524b3c0f
......@@ -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) {
......
......@@ -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');
}
......
......@@ -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>' +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment