Skip to content

Commit

Permalink
fix undefined panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred Heusschen committed Dec 21, 2019
1 parent f980671 commit 61e51fc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dist/_version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default '8.4.3';
export default '8.4.4';
16 changes: 7 additions & 9 deletions dist/core/scrollbugfix/mmenu.scrollbugfix.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,18 @@ export default function () {
// Scroll the current opened panel to the top when opening the menu.
this.bind('open:start', function () {
var panel = DOM.children(_this.node.pnls, '.mm-panel_opened')[0];
if (!panel) {
return;
if (panel) {
panel.scrollTop = 0;
}
panel.scrollTop = 0;
});
// Fix issue after device rotation change.
window.addEventListener('orientationchange', function (evnt) {
var panel = DOM.children(_this.node.pnls, '.mm-panel_opened')[0];
if (!panel) {
return;
if (panel) {
panel.scrollTop = 0;
// Apparently, changing the overflow-scrolling property triggers some event :)
panel.style['-webkit-overflow-scrolling'] = 'auto';
panel.style['-webkit-overflow-scrolling'] = 'touch';
}
panel.scrollTop = 0;
// Apparently, changing the overflow-scrolling property triggers some event :)
panel.style['-webkit-overflow-scrolling'] = 'auto';
panel.style['-webkit-overflow-scrolling'] = 'touch';
});
}
Loading

0 comments on commit 61e51fc

Please sign in to comment.