Skip to content

Commit b50c2af

Browse files
committed
Merge branch '4.6'
2 parents 8a1971d + c87fe82 commit b50c2af

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/bundle/Resources/public/js/scripts/admin.location.tab.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
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);
@@ -37,9 +36,7 @@
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();

src/bundle/Resources/public/js/scripts/admin.location.view.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)