From 1c4335e05a5fb085799680dd4d9f89d2fe06a4ce Mon Sep 17 00:00:00 2001 From: Roni Laukkarinen Date: Wed, 13 Mar 2024 17:37:30 +0200 Subject: [PATCH] Clarify sticky nav functionality presented in 7.9.1, Fixes #213 --- CHANGELOG.md | 4 ++++ README.md | 6 +----- js/dev/front-end.js | 2 +- js/src/front-end.js | 7 ++++++- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ec3a063..327d9078 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### 9.4.1rc: 2024-03-13 + +* Clarify sticky nav functionality presented in 7.9.1, Fixes #213 (thanks @semidivine!) + ### 9.4.0: 2024-02-26 * Update unit tests for WordPress Coding Standards 3.0.1 diff --git a/README.md b/README.md index 2a3dd851..86ead040 100644 --- a/README.md +++ b/README.md @@ -234,11 +234,7 @@ Air has a sticky navigation baked in. ##### How to enable -You can enable the navigation by - -1. Adding sticky-nav.js to your gulpfile (already included with [Devpackages](https://github.com/digitoimistodude/devpackages) and bin/newtheme.sh start script) -2. Uncommeting sticky-nav import in global.scss -3. Restart gulp and save scripts.js once to compile working combined javascript file +You can enable the sticky navigation by uncommenting navSticky() in the js/src/front-end.js file. #### WooCommerce support diff --git a/js/dev/front-end.js b/js/dev/front-end.js index 22d61209..1798d7d4 100644 --- a/js/dev/front-end.js +++ b/js/dev/front-end.js @@ -16,7 +16,7 @@ \*****************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reframe_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! reframe.js */ \"./node_modules/reframe.js/dist/reframe.es.js\");\n/* harmony import */ var _modules_external_link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modules/external-link */ \"./js/src/modules/external-link.js\");\n/* harmony import */ var _modules_anchors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modules/anchors */ \"./js/src/modules/anchors.js\");\n/* harmony import */ var _modules_top__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modules/top */ \"./js/src/modules/top.js\");\n/* harmony import */ var _modules_a11y_skip_link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modules/a11y-skip-link */ \"./js/src/modules/a11y-skip-link.js\");\n/* harmony import */ var _modules_a11y_focus_search_field__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modules/a11y-focus-search-field */ \"./js/src/modules/a11y-focus-search-field.js\");\n/* harmony import */ var _modules_navigation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modules/navigation */ \"./js/src/modules/navigation.js\");\n/* eslint-disable max-len, no-param-reassign, no-unused-vars */\n/**\n * Air theme JavaScript.\n */\n\n// Import modules\n\n\n\n\n\n\n\n\n// Define Javascript is active by changing the body class\ndocument.body.classList.remove('no-js');\ndocument.body.classList.add('js');\ndocument.addEventListener('DOMContentLoaded', function () {\n (0,_modules_anchors__WEBPACK_IMPORTED_MODULE_2__[\"default\"])();\n (0,_modules_top__WEBPACK_IMPORTED_MODULE_3__[\"default\"])();\n (0,_modules_external_link__WEBPACK_IMPORTED_MODULE_1__.styleExternalLinks)();\n (0,_modules_external_link__WEBPACK_IMPORTED_MODULE_1__.initExternalLinkLabels)();\n (0,_modules_a11y_skip_link__WEBPACK_IMPORTED_MODULE_4__[\"default\"])();\n (0,_modules_a11y_focus_search_field__WEBPACK_IMPORTED_MODULE_5__[\"default\"])();\n\n // Init navigation\n // If you want to enable click based navigation, comment navDesktop() and uncomment navClick()\n // Remember to enable styles in sass/navigation/navigation.scss\n (0,_modules_navigation__WEBPACK_IMPORTED_MODULE_6__.navDesktop)();\n // navClick();\n (0,_modules_navigation__WEBPACK_IMPORTED_MODULE_6__.navMobile)();\n\n // Fit video embeds to container\n (0,reframe_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])('.wp-has-aspect-ratio iframe');\n});\n\n//# sourceURL=webpack://air-light/./js/src/front-end.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reframe_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! reframe.js */ \"./node_modules/reframe.js/dist/reframe.es.js\");\n/* harmony import */ var _modules_external_link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modules/external-link */ \"./js/src/modules/external-link.js\");\n/* harmony import */ var _modules_anchors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./modules/anchors */ \"./js/src/modules/anchors.js\");\n/* harmony import */ var _modules_top__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modules/top */ \"./js/src/modules/top.js\");\n/* harmony import */ var _modules_a11y_skip_link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modules/a11y-skip-link */ \"./js/src/modules/a11y-skip-link.js\");\n/* harmony import */ var _modules_a11y_focus_search_field__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modules/a11y-focus-search-field */ \"./js/src/modules/a11y-focus-search-field.js\");\n/* harmony import */ var _modules_navigation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./modules/navigation */ \"./js/src/modules/navigation.js\");\n/* eslint-disable max-len, no-param-reassign, no-unused-vars */\n/**\n * Air theme JavaScript.\n */\n\n// Import modules\n\n\n\n\n\n\n\n\n// Define Javascript is active by changing the body class\ndocument.body.classList.remove('no-js');\ndocument.body.classList.add('js');\ndocument.addEventListener('DOMContentLoaded', function () {\n (0,_modules_anchors__WEBPACK_IMPORTED_MODULE_2__[\"default\"])();\n (0,_modules_top__WEBPACK_IMPORTED_MODULE_3__[\"default\"])();\n (0,_modules_external_link__WEBPACK_IMPORTED_MODULE_1__.styleExternalLinks)();\n (0,_modules_external_link__WEBPACK_IMPORTED_MODULE_1__.initExternalLinkLabels)();\n (0,_modules_a11y_skip_link__WEBPACK_IMPORTED_MODULE_4__[\"default\"])();\n (0,_modules_a11y_focus_search_field__WEBPACK_IMPORTED_MODULE_5__[\"default\"])();\n\n // Init navigation\n // If you want to enable click based navigation, comment navDesktop() and uncomment navClick()\n // Remember to enable styles in sass/navigation/navigation.scss\n (0,_modules_navigation__WEBPACK_IMPORTED_MODULE_6__.navDesktop)();\n // navClick();\n (0,_modules_navigation__WEBPACK_IMPORTED_MODULE_6__.navMobile)();\n\n // Uncomment if you like to use a sticky navigation\n // navSticky();\n\n // Fit video embeds to container\n (0,reframe_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])('.wp-has-aspect-ratio iframe');\n});\n\n//# sourceURL=webpack://air-light/./js/src/front-end.js?"); /***/ }), diff --git a/js/src/front-end.js b/js/src/front-end.js index 6a770d12..bd15939f 100644 --- a/js/src/front-end.js +++ b/js/src/front-end.js @@ -10,7 +10,9 @@ import initAnchors from './modules/anchors'; import backToTop from './modules/top'; import initA11ySkipLink from './modules/a11y-skip-link'; import initA11yFocusSearchField from './modules/a11y-focus-search-field'; -import { navDesktop, navClick, navMobile } from './modules/navigation'; +import { + navSticky, navClick, navDesktop, navMobile, +} from './modules/navigation'; // Define Javascript is active by changing the body class document.body.classList.remove('no-js'); @@ -31,6 +33,9 @@ document.addEventListener('DOMContentLoaded', () => { // navClick(); navMobile(); + // Uncomment if you like to use a sticky navigation + // navSticky(); + // Fit video embeds to container reframe('.wp-has-aspect-ratio iframe'); });