Skip to content

Commit

Permalink
chore(release): 1.1.0 [skip ci]
Browse files Browse the repository at this point in the history
# [1.1.0](v1.0.1-alpha...v1.1.0-alpha) (2021-12-20)

### Features

* **deps:** make dependencies explicit ([829da49](829da49)), closes [#147](#147)
  • Loading branch information
semantic-release-bot committed Dec 20, 2021
1 parent 829da49 commit e9672b6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 25 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
50 changes: 25 additions & 25 deletions package/moj/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = $('<button class="moj-search-toggle__button" type="button" aria-haspopup="true" aria-expanded="false">'+this.options.toggleButton.text+'</button>');
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);

Expand Down Expand Up @@ -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 = $('<button class="moj-search-toggle__button" type="button" aria-haspopup="true" aria-expanded="false">'+this.options.toggleButton.text+'</button>');
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;
}));

0 comments on commit e9672b6

Please sign in to comment.