X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ffilter%2Ffilter.js;fp=web%2Fcore%2Fmodules%2Ffilter%2Ffilter.js;h=596fc95037302c318e3b5e3a18d447353fd5eda4;hp=b79104733edcd927db8adedac6b0604630a30207;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/filter/filter.js b/web/core/modules/filter/filter.js index b79104733..596fc9503 100644 --- a/web/core/modules/filter/filter.js +++ b/web/core/modules/filter/filter.js @@ -1,39 +1,20 @@ /** - * @file - * Attaches behavior for the Filter module. - */ +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ (function ($, Drupal) { - - 'use strict'; - - /** - * Displays the guidelines of the selected text format automatically. - * - * @type {Drupal~behavior} - * - * @prop {Drupal~behaviorAttach} attach - * Attaches behavior for updating filter guidelines. - */ Drupal.behaviors.filterGuidelines = { - attach: function (context) { - + attach: function attach(context) { function updateFilterGuidelines(event) { var $this = $(event.target); var value = $this.val(); - $this.closest('.filter-wrapper') - .find('.filter-guidelines-item').hide() - .filter('.filter-guidelines-' + value).show(); + $this.closest('.filter-wrapper').find('.filter-guidelines-item').hide().filter('.filter-guidelines-' + value).show(); } - $(context).find('.filter-guidelines').once('filter-guidelines') - .find(':header').hide() - .closest('.filter-wrapper').find('select.filter-list') - .on('change.filterGuidelines', updateFilterGuidelines) - // Need to trigger the namespaced event to avoid triggering formUpdated - // when initializing the select. - .trigger('change.filterGuidelines'); + $(context).find('.filter-guidelines').once('filter-guidelines').find(':header').hide().closest('.filter-wrapper').find('select.filter-list').on('change.filterGuidelines', updateFilterGuidelines).trigger('change.filterGuidelines'); } }; - -})(jQuery, Drupal); +})(jQuery, Drupal); \ No newline at end of file