History

Use pointer-events w/o fallback

https://caniuse.com/pointer-events

Simon Legner committed 2 years ago

Commit fe329d61 parent aeb9f801 file · +0 −13Browse files

Unified · Split

assets/javascripts/views/sidebar/sidebar_hover.js+0−13
@@ -12,13 +12,6 @@ app.views.SidebarHover = class SidebarHover extends app.View { · 11 unmodified lines
12 12
13 static routes = { after: "onRoute" };13 static routes = { after: "onRoute" };
14 14
15 constructor(el) {
16 super(el);
17 if (!isPointerEventsSupported()) {
18 delete this.constructor.events.mouseover;
19 }
20 }
21
22 show(el) {15 show(el) {
23 if (el !== this.cursor) {16 if (el !== this.cursor) {
24 this.hide();17 this.hide();
@@ -115,9 +108,3 @@ app.views.SidebarHover = class SidebarHover extends app.View { · 90 unmodified lines
115 this.hide();108 this.hide();
116 }109 }
117};110};
118
119var isPointerEventsSupported = function () {
120 const el = document.createElement("div");
121 el.style.cssText = "pointer-events: auto";
122 return el.style.pointerEvents === "auto";
123};