Commit b165014a authored by webchick's avatar webchick

Issue #2503985 by eiriksm, nod_, jhodgdon: JSDoc block_content module

parent 10ecc78b
......@@ -8,7 +8,15 @@
"use strict";
/**
* Sets summaries about revision and translation of block content.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Attaches summary behaviour block content form tabs.
*
* Specifically, it updates summaries to the revision information and the
* translation options.
*/
Drupal.behaviors.blockContentDetailsSummaries = {
attach: function (context) {
......@@ -17,10 +25,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');
}
......
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