File tree Expand file tree Collapse file tree 5 files changed +19
-2
lines changed
scss/custom/components/category Expand file tree Collapse file tree 5 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export const listing = {
2626 listHeader : '#js-product-list-header' ,
2727 searchFiltersClearAll : '.js-search-filters-clear-all' ,
2828 searchLink : '.js-search-link' ,
29+ pagerLink : '.js-pager-link' ,
2930} ;
3031
3132export const cart = {
Original file line number Diff line number Diff line change @@ -80,6 +80,18 @@ export default () => {
8080 ) ;
8181 } ) ;
8282
83+ /**
84+ * Pager links also scroll up
85+ */
86+ $ ( 'body' ) . on ( 'click' , Theme . selectors . listing . pagerLink , ( event ) => {
87+ event . preventDefault ( ) ;
88+ document . querySelector ( Theme . selectors . listing . listTop ) ?. scrollIntoView ( { block : 'start' , behavior : 'auto' } ) ;
89+ prestashop . emit (
90+ events . updateFacets ,
91+ $ ( event . target ) ?. closest ( 'a' ) ?. get ( 0 ) ?. getAttribute ( 'href' ) ,
92+ ) ;
93+ } ) ;
94+
8395 if ( $ ( Theme . selectors . listing . list ) . length ) {
8496 window . addEventListener ( 'popstate' , ( e ) => {
8597 const { state} = e ;
@@ -99,6 +111,5 @@ export default () => {
99111 prestashop . on ( events . updateProductList , ( data : Record < string , never > ) => {
100112 updateProductListDOM ( data ) ;
101113 useQuantityInput ( ) ;
102- window . scrollTo ( 0 , 0 ) ;
103114 } ) ;
104115} ;
Original file line number Diff line number Diff line change 66
77.layout-left-column ,
88.layout-full-width {
9+ #js-product-list-top {
10+ scroll-margin : 120px ;
11+ }
12+
913 .products-selection {
1014 margin-bottom : 1.25rem ;
1115
Original file line number Diff line number Diff line change 2525 <li class =" page-item{ if $page .current} active{ /if } " { if $page .current} aria-current =" page" { /if } >
2626 <a rel =" { if $page .type === ' previous' } prev{ elseif $page .type === ' next' } next{ else } nofollow{ /if } "
2727 href =" { $page .url} "
28- class =" page-link btn-with-icon { if $page .type === ' previous' } previous { elseif $page .type === ' next' } next { /if } { [' disabled' => ! $page .clickable, ' js-search -link' => true ]|classnames} " >
28+ class =" page-link btn-with-icon { if $page .type === ' previous' } previous { elseif $page .type === ' next' } next { /if } { [' disabled' => ! $page .clickable, ' js-pager -link' => true ]|classnames} " >
2929 { if $page .type === ' previous' }
3030 <i class =" material-icons rtl-flip" aria-hidden =" true" > ; </i >
3131 <span class =" d-none d-md-flex" >{ l s= ' Previous' d= ' Shop.Theme.Actions' } </span >
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ declare type listing = {
2626 listHeader : string ,
2727 searchFiltersClearAll : string ,
2828 searchLink : string ,
29+ pagerLink : string ,
2930} ;
3031
3132declare type cart = {
You can’t perform that action at this time.
0 commit comments