mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-02 23:20:56 -04:00
Removed links to the sticky javascript, but didn't remove altogether
This commit is contained in:
@@ -9,8 +9,9 @@ if (window.GOVUK.hasConsentFor('analytics', consentData)) {
|
||||
|
||||
$(() => $("time.timeago").timeago());
|
||||
|
||||
$(() => GOVUK.stickAtTopWhenScrolling.init());
|
||||
$(() => GOVUK.stickAtBottomWhenScrolling.init());
|
||||
// Removing sticky footer functionality
|
||||
// $(() => GOVUK.stickAtTopWhenScrolling.init());
|
||||
// $(() => GOVUK.stickAtBottomWhenScrolling.init());
|
||||
|
||||
var showHideContent = new GOVUK.ShowHideContent();
|
||||
showHideContent.init();
|
||||
|
||||
@@ -285,9 +285,9 @@
|
||||
if (['move-to-existing-folder', 'add-new-template'].indexOf(this.currentState) !== -1) {
|
||||
mode = 'dialog';
|
||||
}
|
||||
GOVUK.stickAtBottomWhenScrolling.setMode(mode);
|
||||
// GOVUK.stickAtBottomWhenScrolling.setMode(mode);
|
||||
// make sticky JS recalculate its cache of the element's position
|
||||
GOVUK.stickAtBottomWhenScrolling.recalculate();
|
||||
// GOVUK.stickAtBottomWhenScrolling.recalculate();
|
||||
|
||||
if (currentStateObj && ('setFocus' in currentStateObj)) {
|
||||
scrollTop = $(window).scrollTop();
|
||||
@@ -299,10 +299,12 @@
|
||||
this.nothingSelectedButtons = $(`
|
||||
<div id="nothing_selected">
|
||||
<div class="js-stick-at-bottom-when-scrolling">
|
||||
<button class="usa-button usa-button--event" value="add-new-template" aria-expanded="false">
|
||||
New template
|
||||
</button>
|
||||
<button class="usa-button usa-button--event" value="add-new-folder" aria-expanded="false">New folder</button>
|
||||
<div class="usa-button-group">
|
||||
<button class="usa-button usa-button--event" value="add-new-template" aria-expanded="false">
|
||||
New template
|
||||
</button>
|
||||
<button class="usa-button usa-button--event" value="add-new-folder" aria-expanded="false">New folder</button>
|
||||
</div>
|
||||
<div class="template-list-selected-counter">
|
||||
<span class="template-list-selected-counter__count" aria-hidden="true">
|
||||
${this.selectionStatus.default}
|
||||
@@ -315,10 +317,12 @@
|
||||
this.itemsSelectedButtons = $(`
|
||||
<div id="items_selected">
|
||||
<div class="js-stick-at-bottom-when-scrolling">
|
||||
<button class="usa-button usa-button--event" value="move-to-existing-folder" aria-expanded="false">
|
||||
Move<span class="usa-sr-only"> selection to folder</span>
|
||||
</button>
|
||||
<button class="usa-button usa-button--event" value="move-to-new-folder" aria-expanded="false">Add to new folder</button>
|
||||
<div class="usa-button-group">
|
||||
<button class="usa-button usa-button--event" value="move-to-existing-folder" aria-expanded="false">
|
||||
Move<span class="usa-sr-only"> selection to folder</span>
|
||||
</button>
|
||||
<button class="usa-button usa-button--event" value="move-to-new-folder" aria-expanded="false">Add to new folder</button>
|
||||
</div>
|
||||
<div class="template-list-selected-counter" aria-hidden="true">
|
||||
<span class="template-list-selected-counter__count" aria-hidden="true">
|
||||
${this.selectionStatus.selected(1)}
|
||||
|
||||
@@ -195,3 +195,23 @@ td.table-empty-message {
|
||||
border: 1px solid color("gray-60");
|
||||
}
|
||||
}
|
||||
|
||||
.usa-hint {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.js-stick-at-bottom-when-scrolling {
|
||||
margin: 0 0 units(5);
|
||||
padding: units(2) 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
overflow: visible;
|
||||
button {
|
||||
margin-right: units(2);
|
||||
}
|
||||
.template-list-selected-counter {
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
{% block head %}
|
||||
{%- for font in font_paths %}
|
||||
<link rel="preload" href="{{ asset_url(font, with_querystring_hash=False) }}" as="font" type="font/woff2" crossorigin>
|
||||
<link href="{{ asset_url(font, with_querystring_hash=False) }}" as="font" type="font/woff2" crossorigin>
|
||||
{%- endfor %}
|
||||
<link rel="stylesheet" media="screen" href="{{ asset_url('stylesheets/main.css') }}" />
|
||||
<link rel="stylesheet" media="print" href="{{ asset_url('stylesheets/print.css') }}" />
|
||||
|
||||
@@ -108,7 +108,8 @@ const javascripts = () => {
|
||||
paths.src + 'javascripts/govuk/cookie-functions.js',
|
||||
paths.src + 'javascripts/consent.js',
|
||||
paths.src + 'javascripts/cookieMessage.js',
|
||||
paths.src + 'javascripts/stick-to-window-when-scrolling.js',
|
||||
// Removing sticky footer functionality
|
||||
// paths.src + 'javascripts/stick-to-window-when-scrolling.js',
|
||||
paths.src + 'javascripts/copyToClipboard.js',
|
||||
paths.src + 'javascripts/autofocus.js',
|
||||
paths.src + 'javascripts/enhancedTextbox.js',
|
||||
|
||||
@@ -299,19 +299,20 @@ describe('TemplateFolderForm', () => {
|
||||
|
||||
});
|
||||
|
||||
test("should make the current controls sticky", () => {
|
||||
// Removing sticky functionality
|
||||
// test("should make the current controls sticky", () => {
|
||||
|
||||
// the class the sticky JS hooks into should be present
|
||||
expect(formControls.querySelector('#nothing_selected .js-stick-at-bottom-when-scrolling')).not.toBeNull();
|
||||
// // the class the sticky JS hooks into should be present
|
||||
// expect(formControls.querySelector('#nothing_selected .js-stick-at-bottom-when-scrolling')).not.toBeNull();
|
||||
|
||||
// .recalculate should have been called so the sticky JS picks up the controls
|
||||
expect(GOVUK.stickAtBottomWhenScrolling.recalculate.mock.calls.length).toEqual(1);
|
||||
// // .recalculate should have been called so the sticky JS picks up the controls
|
||||
// expect(GOVUK.stickAtBottomWhenScrolling.recalculate.mock.calls.length).toEqual(1);
|
||||
|
||||
// mode should have been set to 'default' as the controls only have one part
|
||||
expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls.length).toEqual(1);
|
||||
expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls[0][0]).toEqual('default');
|
||||
// // mode should have been set to 'default' as the controls only have one part
|
||||
// expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls.length).toEqual(1);
|
||||
// expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls[0][0]).toEqual('default');
|
||||
|
||||
});
|
||||
// });
|
||||
|
||||
});
|
||||
|
||||
@@ -421,19 +422,20 @@ describe('TemplateFolderForm', () => {
|
||||
|
||||
});
|
||||
|
||||
test("should make the current controls sticky", () => {
|
||||
// Removing sticky functionality
|
||||
// test("should make the current controls sticky", () => {
|
||||
|
||||
// the classes the sticky JS hooks into should be present for both parts
|
||||
expect(formControls.querySelectorAll('#add_new_template_form .js-stick-at-bottom-when-scrolling').length).toEqual(2);
|
||||
// // the classes the sticky JS hooks into should be present for both parts
|
||||
// expect(formControls.querySelectorAll('#add_new_template_form .js-stick-at-bottom-when-scrolling').length).toEqual(2);
|
||||
|
||||
// .recalculate should have been called so the sticky JS picks up the controls
|
||||
expect(GOVUK.stickAtBottomWhenScrolling.recalculate.mock.calls.length).toEqual(1);
|
||||
// // .recalculate should have been called so the sticky JS picks up the controls
|
||||
// expect(GOVUK.stickAtBottomWhenScrolling.recalculate.mock.calls.length).toEqual(1);
|
||||
|
||||
// the mode should be set to 'dialog' so both parts can be sticky
|
||||
expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls.length).toEqual(1);
|
||||
expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls[0][0]).toEqual('dialog');
|
||||
// // the mode should be set to 'dialog' so both parts can be sticky
|
||||
// expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls.length).toEqual(1);
|
||||
// expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls[0][0]).toEqual('dialog');
|
||||
|
||||
});
|
||||
// });
|
||||
|
||||
describe("When the 'Cancel' link is clicked after choosing to add a new template", () => {
|
||||
|
||||
@@ -533,13 +535,13 @@ describe('TemplateFolderForm', () => {
|
||||
|
||||
});
|
||||
|
||||
test("should make the current controls sticky", () => {
|
||||
test("", () => {
|
||||
|
||||
// the class the sticky JS hooks into should be present
|
||||
expect(formControls.querySelector('#add_new_folder_form .js-stick-at-bottom-when-scrolling')).not.toBeNull();
|
||||
|
||||
// .recalculate should have been called so the sticky JS picks up the controls
|
||||
expect(GOVUK.stickAtBottomWhenScrolling.recalculate.mock.calls.length).toEqual(1);
|
||||
expect(GOVUK.stickAtBottomWhenScrolling.recalculate.mock.calls.length).toEqual(0);
|
||||
|
||||
// mode should have been set to 'default' as the controls only have one part
|
||||
expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls.length).toEqual(1);
|
||||
@@ -607,19 +609,20 @@ describe('TemplateFolderForm', () => {
|
||||
|
||||
});
|
||||
|
||||
test("should make the current controls sticky", () => {
|
||||
// Removing sticky functionality
|
||||
// test("should make the current controls sticky", () => {
|
||||
|
||||
// the class the sticky JS hooks into should be present
|
||||
expect(formControls.querySelector('#items_selected .js-stick-at-bottom-when-scrolling')).not.toBeNull();
|
||||
// // the class the sticky JS hooks into should be present
|
||||
// expect(formControls.querySelector('#items_selected .js-stick-at-bottom-when-scrolling')).not.toBeNull();
|
||||
|
||||
// .recalculate should have been called so the sticky JS picks up the controls
|
||||
expect(GOVUK.stickAtBottomWhenScrolling.recalculate.mock.calls.length).toEqual(1);
|
||||
// // .recalculate should have been called so the sticky JS picks up the controls
|
||||
// expect(GOVUK.stickAtBottomWhenScrolling.recalculate.mock.calls.length).toEqual(1);
|
||||
|
||||
// mode should have been set to 'default' as the controls only have one part
|
||||
expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls.length).toEqual(1);
|
||||
expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls[0][0]).toEqual('default');
|
||||
// // mode should have been set to 'default' as the controls only have one part
|
||||
// expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls.length).toEqual(1);
|
||||
// expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls[0][0]).toEqual('default');
|
||||
|
||||
});
|
||||
// });
|
||||
|
||||
describe("'Clear selection' link", () => {
|
||||
|
||||
@@ -755,19 +758,20 @@ describe('TemplateFolderForm', () => {
|
||||
|
||||
});
|
||||
|
||||
test("should make the current controls sticky", () => {
|
||||
// Removing sticky functionality
|
||||
// test("should make the current controls sticky", () => {
|
||||
|
||||
// the classes the sticky JS hooks into should be present for both parts
|
||||
expect(formControls.querySelectorAll('#move_to_folder_radios .js-stick-at-bottom-when-scrolling').length).toEqual(2);
|
||||
// // the classes the sticky JS hooks into should be present for both parts
|
||||
// expect(formControls.querySelectorAll('#move_to_folder_radios .js-stick-at-bottom-when-scrolling').length).toEqual(2);
|
||||
|
||||
// .recalculate should have been called so the sticky JS picks up the controls
|
||||
expect(GOVUK.stickAtBottomWhenScrolling.recalculate.mock.calls.length).toEqual(1);
|
||||
// // .recalculate should have been called so the sticky JS picks up the controls
|
||||
// expect(GOVUK.stickAtBottomWhenScrolling.recalculate.mock.calls.length).toEqual(1);
|
||||
|
||||
// the mode should be set to 'dialog' so both parts can be sticky
|
||||
expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls.length).toEqual(1);
|
||||
expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls[0][0]).toEqual('dialog');
|
||||
// // the mode should be set to 'dialog' so both parts can be sticky
|
||||
// expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls.length).toEqual(1);
|
||||
// expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls[0][0]).toEqual('dialog');
|
||||
|
||||
});
|
||||
// });
|
||||
|
||||
describe("When the 'Cancel' link is clicked after choosing to move a template or folder", () => {
|
||||
|
||||
@@ -857,19 +861,20 @@ describe('TemplateFolderForm', () => {
|
||||
|
||||
});
|
||||
|
||||
test("should make the current controls sticky", () => {
|
||||
// Removing sticky functionality
|
||||
// test("should make the current controls sticky", () => {
|
||||
|
||||
// the class the sticky JS hooks into should be present
|
||||
expect(formControls.querySelector('#move_to_new_folder_form .js-stick-at-bottom-when-scrolling')).not.toBeNull();
|
||||
// // the class the sticky JS hooks into should be present
|
||||
// expect(formControls.querySelector('#move_to_new_folder_form .js-stick-at-bottom-when-scrolling')).not.toBeNull();
|
||||
|
||||
// .recalculate should have been called so the sticky JS picks up the controls
|
||||
expect(GOVUK.stickAtBottomWhenScrolling.recalculate.mock.calls.length).toEqual(1);
|
||||
// // .recalculate should have been called so the sticky JS picks up the controls
|
||||
// expect(GOVUK.stickAtBottomWhenScrolling.recalculate.mock.calls.length).toEqual(1);
|
||||
|
||||
// mode should have been set to 'default' as the controls only have one part
|
||||
expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls.length).toEqual(1);
|
||||
expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls[0][0]).toEqual('default');
|
||||
// // mode should have been set to 'default' as the controls only have one part
|
||||
// expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls.length).toEqual(1);
|
||||
// expect(GOVUK.stickAtBottomWhenScrolling.setMode.mock.calls[0][0]).toEqual('default');
|
||||
|
||||
});
|
||||
// });
|
||||
|
||||
describe("When the 'Cancel' link is clicked after choosing to add a template or folder to a new folder", () => {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user