Skip to content

Commit

Permalink
fix: readium-reflowable tried to setup swipeup / down before document…
Browse files Browse the repository at this point in the history
… ready
  • Loading branch information
m-abs committed May 23, 2023
1 parent e22707c commit 1ffdf10
Show file tree
Hide file tree
Showing 4 changed files with 2,182 additions and 2,144 deletions.
20 changes: 10 additions & 10 deletions components/navigator/assets/_scripts/src/index-reflowable.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@ import flutter from "./flutter";
import "tocca";
import { isScrollModeEnabled } from "./utils";

document.scrollingElement.addEventListener("swipeup", function (event) {
event.stopPropagation();
flutter.onSwipeUp();
});

document.scrollingElement.addEventListener("swipedown", function (event) {
event.stopPropagation();
flutter.onSwipeDown();
});

/**
* Remove all child nodes from an element
* @param {Object} element The element to empty
Expand Down Expand Up @@ -285,4 +275,14 @@ document.addEventListener("DOMContentLoaded", function () {
"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"
);
document.head.appendChild(meta);

document.scrollingElement.addEventListener("swipeup", function (event) {
event.stopPropagation();
flutter.onSwipeUp();
});

document.scrollingElement.addEventListener("swipedown", function (event) {
event.stopPropagation();
flutter.onSwipeDown();
});
});
Loading

0 comments on commit 1ffdf10

Please sign in to comment.