1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-15 18:57:04 +00:00

Add option to enable or disable double tap

This commit is contained in:
Frédéric Guillot 2023-01-14 16:49:21 -08:00
parent 6612e42668
commit 2e047dff98
34 changed files with 101 additions and 52 deletions

View file

@ -27,6 +27,7 @@ type SettingsForm struct {
ShowReadingTime bool
CustomCSS string
EntrySwipe bool
DoubleTap bool
DisplayMode string
DefaultReadingSpeed int
CJKReadingSpeed int
@ -47,6 +48,7 @@ func (s *SettingsForm) Merge(user *model.User) *model.User {
user.ShowReadingTime = s.ShowReadingTime
user.Stylesheet = s.CustomCSS
user.EntrySwipe = s.EntrySwipe
user.DoubleTap = s.DoubleTap
user.DisplayMode = s.DisplayMode
user.CJKReadingSpeed = s.CJKReadingSpeed
user.DefaultReadingSpeed = s.DefaultReadingSpeed
@ -112,6 +114,7 @@ func NewSettingsForm(r *http.Request) *SettingsForm {
ShowReadingTime: r.FormValue("show_reading_time") == "1",
CustomCSS: r.FormValue("custom_css"),
EntrySwipe: r.FormValue("entry_swipe") == "1",
DoubleTap: r.FormValue("double_tap") == "1",
DisplayMode: r.FormValue("display_mode"),
DefaultReadingSpeed: int(defaultReadingSpeed),
CJKReadingSpeed: int(cjkReadingSpeed),

View file

@ -38,6 +38,7 @@ func (h *handler) showSettingsPage(w http.ResponseWriter, r *http.Request) {
ShowReadingTime: user.ShowReadingTime,
CustomCSS: user.Stylesheet,
EntrySwipe: user.EntrySwipe,
DoubleTap: user.DoubleTap,
DisplayMode: user.DisplayMode,
DefaultReadingSpeed: user.DefaultReadingSpeed,
CJKReadingSpeed: user.CJKReadingSpeed,

View file

@ -760,7 +760,7 @@ template {
display: none;
}
.touch-item {
.entry-swipe {
transition-property: transform;
transition-duration: 0s;
transition-timing-function: ease-out;

View file

@ -26,11 +26,11 @@ class TouchHandler {
}
findElement(element) {
if (element.classList.contains("touch-item")) {
if (element.classList.contains("entry-swipe")) {
return element;
}
return DomHelper.findParent(element, "touch-item");
return DomHelper.findParent(element, "entry-swipe");
}
onTouchStart(event) {
@ -93,7 +93,7 @@ class TouchHandler {
}
listen() {
let elements = document.querySelectorAll(".touch-item");
let elements = document.querySelectorAll(".entry-swipe");
let hasPassiveOption = DomHelper.hasPassiveEventListenerOption();
elements.forEach((element) => {