diff options
Diffstat (limited to 'core/modules/text/text.js')
-rw-r--r-- | core/modules/text/text.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/modules/text/text.js b/core/modules/text/text.js index 25a31e422113..6bd1b9c2408c 100644 --- a/core/modules/text/text.js +++ b/core/modules/text/text.js @@ -10,7 +10,6 @@ attach: function attach(context, settings) { $(context).find('.js-text-summary').once('text-summary').each(function () { var $widget = $(this).closest('.js-text-format-wrapper'); - var $summary = $widget.find('.js-text-summary-wrapper'); var $summaryLabel = $summary.find('label').eq(0); var $full = $widget.children('.js-form-type-textarea'); @@ -20,7 +19,7 @@ $fullLabel = $('<label></label>').prependTo($full); } - var $link = $('<span class="field-edit-link"> (<button type="button" class="link link-edit-summary">' + Drupal.t('Hide summary') + '</button>)</span>'); + var $link = $("<span class=\"field-edit-link\"> (<button type=\"button\" class=\"link link-edit-summary\">".concat(Drupal.t('Hide summary'), "</button>)</span>")); var $button = $link.find('button'); var toggleClick = true; $link.on('click', function (e) { @@ -33,6 +32,7 @@ $button.html(Drupal.t('Hide summary')); $link.appendTo($summaryLabel); } + e.preventDefault(); toggleClick = !toggleClick; }).appendTo($summaryLabel); |