Loading core/tests/Drupal/Nightwatch/Tests/oliveroStickyHeaderToggleTest.js +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ module.exports = { 'Congratulations and welcome to the Drupal community!', ) .assert.not.visible(buttonSelector) .assert.attributeEquals(buttonSelector, 'aria-checked', 'false') .getLocationInView('footer.site-footer', () => { browser.assert.visible(buttonSelector); browser.assert.not.visible('#site-header__inner'); Loading core/themes/olivero/js/scripts.es6.js +2 −2 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ 'Drupal.olivero.stickyHeaderState', ); if (!stickyHeaderState) return null; if (!stickyHeaderState) return false; const item = JSON.parse(stickyHeaderState); const now = new Date(); Loading @@ -82,7 +82,7 @@ if (now.getTime() > item.expiry) { // If the item is expired, delete the item from storage and return null. localStorage.removeItem('Drupal.olivero.stickyHeaderState'); return null; return false; } return item.value; } Loading core/themes/olivero/js/scripts.js +2 −2 Original line number Diff line number Diff line Loading @@ -45,13 +45,13 @@ function getStickyHeaderStorage() { var stickyHeaderState = localStorage.getItem('Drupal.olivero.stickyHeaderState'); if (!stickyHeaderState) return null; if (!stickyHeaderState) return false; var item = JSON.parse(stickyHeaderState); var now = new Date(); if (now.getTime() > item.expiry) { localStorage.removeItem('Drupal.olivero.stickyHeaderState'); return null; return false; } return item.value; Loading Loading
core/tests/Drupal/Nightwatch/Tests/oliveroStickyHeaderToggleTest.js +1 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ module.exports = { 'Congratulations and welcome to the Drupal community!', ) .assert.not.visible(buttonSelector) .assert.attributeEquals(buttonSelector, 'aria-checked', 'false') .getLocationInView('footer.site-footer', () => { browser.assert.visible(buttonSelector); browser.assert.not.visible('#site-header__inner'); Loading
core/themes/olivero/js/scripts.es6.js +2 −2 Original line number Diff line number Diff line Loading @@ -73,7 +73,7 @@ 'Drupal.olivero.stickyHeaderState', ); if (!stickyHeaderState) return null; if (!stickyHeaderState) return false; const item = JSON.parse(stickyHeaderState); const now = new Date(); Loading @@ -82,7 +82,7 @@ if (now.getTime() > item.expiry) { // If the item is expired, delete the item from storage and return null. localStorage.removeItem('Drupal.olivero.stickyHeaderState'); return null; return false; } return item.value; } Loading
core/themes/olivero/js/scripts.js +2 −2 Original line number Diff line number Diff line Loading @@ -45,13 +45,13 @@ function getStickyHeaderStorage() { var stickyHeaderState = localStorage.getItem('Drupal.olivero.stickyHeaderState'); if (!stickyHeaderState) return null; if (!stickyHeaderState) return false; var item = JSON.parse(stickyHeaderState); var now = new Date(); if (now.getTime() > item.expiry) { localStorage.removeItem('Drupal.olivero.stickyHeaderState'); return null; return false; } return item.value; Loading