Skip to content

Commit

Permalink
Merge pull request #11286 from nikkuAg/scroll-bug
Browse files Browse the repository at this point in the history
Disable scroll on main page if side panel is open
  • Loading branch information
rtibbles authored Sep 25, 2023
2 parents 8c711ec + 449a4f1 commit 1c886dd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions kolibri/plugins/learn/assets/src/views/TopicsContentPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,22 @@
}
},
showViewResourcesSidePanel(newVal, oldVal) {
if (newVal === true) {
this.stopMainScroll(true);
} else {
this.stopMainScroll(false);
}
if (newVal && !oldVal) {
this.getSidebarInfo();
}
},
sidePanelContent(newVal) {
if (newVal !== null) {
this.stopMainScroll(true);
} else {
this.stopMainScroll(false);
}
},
},
created() {
this.initializeState();
Expand Down Expand Up @@ -645,6 +657,14 @@
goToAllLibraries() {
this.$router.push({ name: PageNames.EXPLORE_LIBRARIES });
},
stopMainScroll(sidePanelVisible) {
const mainWrapperElement = this.$refs.mainWrapper;
if (sidePanelVisible) {
mainWrapperElement.style.position = 'fixed';
} else {
mainWrapperElement.style.position = null;
}
},
},
$trs: {
kolibriTitleMessage: {
Expand Down

0 comments on commit 1c886dd

Please sign in to comment.