File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
src/bundle/Resources/public/js/scripts Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 33 const SELECTOR_TAB = '.ibexa-tabs__tab' ;
44 const SELECTOR_TAB_ACTIVE = '.ibexa-tabs__tab--active' ;
55 const CLASS_TAB_ACTIVE = 'ibexa-tabs__tab--active' ;
6- const contentColumn = doc . querySelector ( '.ibexa-main-container__content-column' ) ;
76 const switchActiveTabs = ( currentTab , previousTab ) => {
87 if ( previousTab ) {
98 previousTab . classList . remove ( CLASS_TAB_ACTIVE ) ;
3736
3837 switchActiveTabs ( activeHashTab , currentActiveTab ) ;
3938
40- setTimeout ( ( ) => {
41- contentColumn . scrollTo ( 0 , 0 ) ;
42- } , 0 ) ;
39+ doc . body . dispatchEvent ( new CustomEvent ( 'ibexa:tabs:hash-tab-activated' ) ) ;
4340 } ;
4441
4542 setActiveHashTab ( ) ;
Original file line number Diff line number Diff line change @@ -220,6 +220,14 @@ import { checkIsContainer } from './helpers/content.type.helper';
220220 if ( publishedContentId ) {
221221 emdedItemsUpdateChannel . postMessage ( { contentId : publishedContentId } ) ;
222222 }
223+
224+ doc . body . addEventListener ( 'ibexa:tabs:hash-tab-activated' , ( ) => {
225+ const contentColumn = doc . querySelector ( '.ibexa-main-container__content-column' ) ;
226+
227+ setTimeout ( ( ) => {
228+ contentColumn . scrollTo ( 0 , 0 ) ;
229+ } , 0 ) ;
230+ } ) ;
223231} ) (
224232 window ,
225233 window . document ,
You can’t perform that action at this time.
0 commit comments