mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-22 08:58:46 -04:00
Updating some of the full screen table code
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
this.$scrollableTable
|
||||
.on('scroll', this.toggleShadows)
|
||||
.on('scroll', this.maintainHeight)
|
||||
.on('focus blur', () => this.$component.toggleClass('js-focus-style'));
|
||||
|
||||
if (
|
||||
window.GOVUK.stickAtBottomWhenScrolling &&
|
||||
@@ -31,17 +30,17 @@
|
||||
window.GOVUK.stickAtBottomWhenScrolling.recalculate();
|
||||
}
|
||||
|
||||
this.maintainWidth();
|
||||
this.maintainWidth();npm
|
||||
|
||||
};
|
||||
|
||||
this.insertShims = () => {
|
||||
|
||||
const attributesForFocus = 'role aria-labelledby tabindex';
|
||||
const attributesForFocus = 'role aria-labelledby';
|
||||
let captionId = this.$table.find('caption').text().toLowerCase().replace(/[^A-Za-z]+/g, '');
|
||||
|
||||
this.$table.find('caption').attr('id', captionId);
|
||||
this.$table.wrap(`<div class="fullscreen-scrollable-table" role="region" aria-labelledby="${captionId}" tabindex="0"/>`);
|
||||
this.$table.wrap(`<div class="fullscreen-scrollable-table" role="region" aria-labelledby="${captionId}"/>`);
|
||||
|
||||
this.$component
|
||||
.append(
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
<div class="spreadsheet" data-module="fullscreen-table">
|
||||
{% call(item, row_number) list_table(
|
||||
example,
|
||||
caption="Example",
|
||||
caption="Example spreadsheet",
|
||||
caption_visible=False,
|
||||
field_headings=[''] + column_headings
|
||||
) %}
|
||||
|
||||
@@ -347,24 +347,4 @@ describe('FullscreenTable', () => {
|
||||
|
||||
});
|
||||
|
||||
describe("when the table is focused", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
// start module
|
||||
window.GOVUK.modules.start();
|
||||
|
||||
tableFrame = document.querySelector('.fullscreen-scrollable-table');
|
||||
tableFrame.focus();
|
||||
|
||||
});
|
||||
|
||||
test("it should make the parent frame a focus style", () => {
|
||||
|
||||
expect(container.classList.contains('js-focus-style')).toBe(true);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user