X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ffilter%2Ffilter.es6.js;h=330a53ff4d745e0fa48a3f33a1d5ad375c3f0cc9;hb=9424afc6c1f518c301bf87a23c047d1873435d05;hp=97c5501a51694de22d0b8d25776b1a985ec61b59;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;p=yaffs-website diff --git a/web/core/modules/filter/filter.es6.js b/web/core/modules/filter/filter.es6.js index 97c5501a5..330a53ff4 100644 --- a/web/core/modules/filter/filter.es6.js +++ b/web/core/modules/filter/filter.es6.js @@ -3,7 +3,7 @@ * Attaches behavior for the Filter module. */ -(function ($, Drupal) { +(function($, Drupal) { /** * Displays the guidelines of the selected text format automatically. * @@ -17,18 +17,25 @@ function updateFilterGuidelines(event) { const $this = $(event.target); const 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') + $(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'); }, }; -}(jQuery, Drupal)); +})(jQuery, Drupal);