X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ftext%2Ftext.js;fp=web%2Fcore%2Fmodules%2Ftext%2Ftext.js;h=c760f2dd2c3345d17b1aec1ce942325b273cdb65;hp=ad89bd8ad1619b656d7992fd5c84382b9a532096;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5
diff --git a/web/core/modules/text/text.js b/web/core/modules/text/text.js
index ad89bd8ad..c760f2dd2 100644
--- a/web/core/modules/text/text.js
+++ b/web/core/modules/text/text.js
@@ -1,22 +1,13 @@
/**
- * @file
- * Text behaviors.
- */
+* DO NOT EDIT THIS FILE.
+* See the following change record for more information,
+* https://www.drupal.org/node/2815083
+* @preserve
+**/
(function ($, Drupal) {
-
- 'use strict';
-
- /**
- * Auto-hide summary textarea if empty and show hide and unhide links.
- *
- * @type {Drupal~behavior}
- *
- * @prop {Drupal~behaviorAttach} attach
- * Attaches auto-hide behavior on `text-summary` events.
- */
Drupal.behaviors.textSummary = {
- attach: function (context, settings) {
+ attach: function attach(context, settings) {
$(context).find('.js-text-summary').once('text-summary').each(function () {
var $widget = $(this).closest('.js-text-format-wrapper');
@@ -25,13 +16,10 @@
var $full = $widget.find('.js-text-full').closest('.js-form-item');
var $fullLabel = $full.find('label').eq(0);
- // Create a placeholder label when the field cardinality is greater
- // than 1.
if ($fullLabel.length === 0) {
$fullLabel = $('').prependTo($full);
}
- // Set up the edit/hide summary link.
var $link = $(' ()');
var $button = $link.find('button');
var toggleClick = true;
@@ -40,8 +28,7 @@
$summary.hide();
$button.html(Drupal.t('Edit summary'));
$link.appendTo($fullLabel);
- }
- else {
+ } else {
$summary.show();
$button.html(Drupal.t('Hide summary'));
$link.appendTo($summaryLabel);
@@ -50,12 +37,10 @@
toggleClick = !toggleClick;
}).appendTo($summaryLabel);
- // If no summary is set, hide the summary field.
if ($widget.find('.js-text-summary').val() === '') {
$link.trigger('click');
}
});
}
};
-
-})(jQuery, Drupal);
+})(jQuery, Drupal);
\ No newline at end of file