From e9672b603f7ef00b5db7f9121c507593c0ae7176 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 20 Dec 2021 14:30:10 +0000 Subject: [PATCH] chore(release): 1.1.0 [skip ci] # [1.1.0](https://github.com/ministryofjustice/moj-frontend/compare/v1.0.1-alpha...v1.1.0-alpha) (2021-12-20) ### Features * **deps:** make dependencies explicit ([829da49](https://github.com/ministryofjustice/moj-frontend/commit/829da490085ffbe3751040932e4b91b149bd772c)), closes [#147](https://github.com/ministryofjustice/moj-frontend/issues/147) --- CHANGELOG.md | 7 +++++++ package/moj/all.js | 50 +++++++++++++++++++++++----------------------- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 439625b0..d8ab44ed 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.1.0](https://github.com/ministryofjustice/moj-frontend/compare/v1.0.1-alpha...v1.1.0-alpha) (2021-12-20) + + +### Features + +* **deps:** make dependencies explicit ([829da49](https://github.com/ministryofjustice/moj-frontend/commit/829da490085ffbe3751040932e4b91b149bd772c)), closes [#147](https://github.com/ministryofjustice/moj-frontend/issues/147) + ## [1.0.1](https://github.com/ministryofjustice/moj-frontend/compare/v1.0.0-alpha...v1.0.1-alpha) (2021-11-24) diff --git a/package/moj/all.js b/package/moj/all.js index da46ba9d..338f38c5 100755 --- a/package/moj/all.js +++ b/package/moj/all.js @@ -1029,6 +1029,31 @@ if('contentEditable' in document.documentElement) { } +MOJFrontend.SearchToggle = function(options) { + this.options = options; + + if (this.options.search.container.data('moj-search-toggle-initialised')) { + return + } + + this.options.search.container.data('moj-search-toggle-initialised', true); + + this.toggleButton = $(''); + this.toggleButton.on('click', $.proxy(this, 'onToggleButtonClick')); + this.options.toggleButton.container.append(this.toggleButton); +}; + +MOJFrontend.SearchToggle.prototype.onToggleButtonClick = function() { + if(this.toggleButton.attr('aria-expanded') == 'false') { + this.toggleButton.attr('aria-expanded', 'true'); + this.options.search.container.removeClass('moj-js-hidden'); + this.options.search.container.find('input').first().focus(); + } else { + this.options.search.container.addClass('moj-js-hidden'); + this.toggleButton.attr('aria-expanded', 'false'); + } +}; + MOJFrontend.SortableTable = function(params) { this.table = $(params.table); @@ -1154,30 +1179,5 @@ MOJFrontend.SortableTable.prototype.getCellValue = function(cell) { return val; }; -MOJFrontend.SearchToggle = function(options) { - this.options = options; - - if (this.options.search.container.data('moj-search-toggle-initialised')) { - return - } - - this.options.search.container.data('moj-search-toggle-initialised', true); - - this.toggleButton = $(''); - this.toggleButton.on('click', $.proxy(this, 'onToggleButtonClick')); - this.options.toggleButton.container.append(this.toggleButton); -}; - -MOJFrontend.SearchToggle.prototype.onToggleButtonClick = function() { - if(this.toggleButton.attr('aria-expanded') == 'false') { - this.toggleButton.attr('aria-expanded', 'true'); - this.options.search.container.removeClass('moj-js-hidden'); - this.options.search.container.find('input').first().focus(); - } else { - this.options.search.container.addClass('moj-js-hidden'); - this.toggleButton.attr('aria-expanded', 'false'); - } -}; - return MOJFrontend; }));