mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-09 10:54:11 -04:00
Revert "Change checkboxes to GOVUK frontend"
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
function Summary (module) {
|
||||
this.module = module;
|
||||
this.$el = module.$formGroup.find('.selection-summary').first();
|
||||
this.$el = module.$formGroup.find('.selection-summary');
|
||||
this.fieldLabel = module.fieldLabel;
|
||||
this.total = module.total;
|
||||
this.addContent();
|
||||
@@ -25,7 +25,6 @@
|
||||
if (this.fieldLabel === 'folder') { this.$text.addClass('selection-summary__text--folders'); }
|
||||
|
||||
this.$el.append(this.$text);
|
||||
this.module.$formGroup.find('.govuk-hint').remove();
|
||||
};
|
||||
Summary.prototype.update = function(selection) {
|
||||
let template;
|
||||
@@ -87,13 +86,12 @@
|
||||
.focus();
|
||||
};
|
||||
CollapsibleCheckboxes.prototype.start = function(component) {
|
||||
this.$component = $(component);
|
||||
this.$formGroup = this.$component.find('.govuk-form-group').first();
|
||||
this.$fieldset = this.$formGroup.find('fieldset').first();
|
||||
this.$formGroup = $(component);
|
||||
this.$fieldset = this.$formGroup.find('fieldset');
|
||||
this.$checkboxes = this.$fieldset.find('input[type=checkbox]');
|
||||
this.fieldLabel = this.$component.data('fieldLabel');
|
||||
this.fieldLabel = this.$formGroup.data('fieldLabel');
|
||||
this.total = this.$checkboxes.length;
|
||||
this.legendText = this.$fieldset.find('legend').first().text().trim();
|
||||
this.legendText = this.$fieldset.find('legend').text().trim();
|
||||
this.expanded = false;
|
||||
|
||||
this.addHeadingHideLegend();
|
||||
@@ -115,7 +113,7 @@
|
||||
};
|
||||
CollapsibleCheckboxes.prototype.getSelection = function() { return this.$checkboxes.filter(':checked').length; };
|
||||
CollapsibleCheckboxes.prototype.addHeadingHideLegend = function() {
|
||||
const headingLevel = this.$component.data('heading-level') || '2';
|
||||
const headingLevel = this.$formGroup.data('heading-level') || '2';
|
||||
|
||||
this.$heading = $(`<h${headingLevel} class="heading-small">${this.legendText}</h${headingLevel}>`);
|
||||
this.$fieldset.before(this.$heading);
|
||||
|
||||
Reference in New Issue
Block a user