Skip to content

Commit

Permalink
Merge pull request #65 from adobecom/MWPW-129766
Browse files Browse the repository at this point in the history
fix(paginator): handles AEM and Milo markup discrepancies [MWPW-129766]
  • Loading branch information
cmiqueo authored Apr 27, 2023
2 parents 3cc11cd + 85ccbec commit 57cd1bc
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 22 deletions.
2 changes: 1 addition & 1 deletion dist/app.css

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions dist/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Chimera UI Libraries - Build 4/24/2023, 07:22:01
* Chimera UI Libraries - Build 4/26/2023, 18:21:30
*
*/
/******/ (function(modules) { // webpackBootstrap
Expand Down Expand Up @@ -875,7 +875,9 @@ var getGlobalNavHeight = exports.getGlobalNavHeight = function getGlobalNavHeigh
if (!header) return offSet;

var isBacom = header.getAttribute('daa-lh') && header.getAttribute('daa-lh').includes('bacom');
return isBacom || header.classList.contains('feds-header-wrapper--sticky') ? header.offsetHeight + offSet : offSet;
var headerWrapper = isBacom ? header : document.querySelector('.feds-header-wrapper');

return isBacom || headerWrapper.classList.contains('feds-header-wrapper--sticky') ? header.offsetHeight + offSet : offSet;
};

/***/ }),
Expand Down Expand Up @@ -53600,7 +53602,7 @@ var Paginator = function Paginator(props) {
} else {
nextPage = parseInt(target.firstChild.nodeValue, BASE_10);
}
var caasWrapper = target.closest('.consonant-Wrapper');
var caasWrapper = target.closest('.section') || target.closest('.consonant-Wrapper');
if (caasWrapper && caasWrapper.getBoundingClientRect().y < 0 && typeof caasWrapper.scrollIntoView === 'function') {
window.scrollTo({ left: 0, top: caasWrapper.offsetTop - globalNavHeight, behavior: 'smooth' });
}
Expand Down
6 changes: 3 additions & 3 deletions dist/main.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/main.source.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions html/MWPW-129766.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@

<body class="page basicpage spectrum spectrum--lightest">
<!-- Custom fake global nav -->
<header class="feds-header-wrapper feds-header-wrapper--sticky">
<div class="feds-header-wrapper feds-header-wrapper--sticky">
<header>
<div class="feds-navBar">
<ul>
<li>Adobe</li>
Expand All @@ -90,7 +91,8 @@
<li>Customer Success Stories</li>
</ul>
</div>
</header>
</header>
</div>

<div class="page-heading">
<h2>CaaS Test Page</h2>
Expand Down
10 changes: 1 addition & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build": "webpack",
"postbuild": "minify dist/main.js > dist/main.min.js",
"lint": "eslint react/src/js/components/Consonant --fix",
"release": "HUSKY_SKIP_HOOKS=1 release-it --ci",
"release": "release-it --ci",
"test:coverage": "jest --coverage",
"test:unit": "jest",
"test:e2e-local": "wdio run wdio.conf.js env=LOCAL",
Expand Down Expand Up @@ -98,7 +98,6 @@
"eslint-plugin-react": "^7.18.3",
"eslint-plugin-react-hooks": "^4.1.2",
"extract-text-webpack-plugin": "^3.0.1",
"husky": "^4.3.8",
"ignore-loader": "^0.1.2",
"inject-loader": "^3.0.1",
"jest": "^24.0.0",
Expand Down Expand Up @@ -126,13 +125,6 @@
"wdio-chromedriver-service": "^8.0.1",
"webpack": "^3.9.1"
},
"husky": {
"hooks": {
"prepare-commit-msg": "exec < /dev/tty && npx cz --hook || true",
"pre-commit": "npm run build && git add . && enforce-branch-name '.*'",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
Expand Down
4 changes: 3 additions & 1 deletion react/src/js/components/Consonant/Helpers/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,9 @@ export const getGlobalNavHeight = () => {
if (!header) return offSet;

const isBacom = header.getAttribute('daa-lh') && header.getAttribute('daa-lh').includes('bacom');
return isBacom || header.classList.contains('feds-header-wrapper--sticky')
const headerWrapper = isBacom ? header : document.querySelector('.feds-header-wrapper');

return isBacom || headerWrapper.classList.contains('feds-header-wrapper--sticky')
? header.offsetHeight + offSet
: offSet;
};
2 changes: 1 addition & 1 deletion react/src/js/components/Consonant/Pagination/Paginator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const Paginator = (props) => {
} else {
nextPage = parseInt(target.firstChild.nodeValue, BASE_10);
}
const caasWrapper = target.closest('.consonant-Wrapper');
const caasWrapper = target.closest('.section') || target.closest('.consonant-Wrapper');
if (caasWrapper
&& caasWrapper.getBoundingClientRect().y < 0
&& typeof caasWrapper.scrollIntoView === 'function') {
Expand Down

0 comments on commit 57cd1bc

Please sign in to comment.