Unified · Split
| @@ -1,28 +1,16 @@ | ||
| 1 | −// TODO: This file was created by bulk-decaffeinate. | |
| 2 | −// Sanity-check the conversion and remove this comment. | |
| 3 | −/* | |
| 4 | − * decaffeinate suggestions: | |
| 5 | − * DS102: Remove unnecessary code created because of implicit returns | |
| 6 | − * DS103: Rewrite code to no longer use __guard__, or convert again using --optional-chaining | |
| 7 | − * DS206: Consider reworking classes to avoid initClass | |
| 8 | − * DS207: Consider shorter variations of null checks | |
| 9 | − * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md | |
| 10 | − */ | |
| 11 | 1 | app.views.SidebarHover = class SidebarHover extends app.View { |
| 12 | − static initClass() { | |
| 13 | − this.itemClass = "_list-hover"; | |
| 2 | + static itemClass = "_list-hover"; | |
| 14 | 3 | |
| 15 | − this.events = { | |
| 16 | − focus: "onFocus", | |
| 17 | − blur: "onBlur", | |
| 18 | − mouseover: "onMouseover", | |
| 19 | − mouseout: "onMouseout", | |
| 20 | − scroll: "onScroll", | |
| 21 | − click: "onClick", | |
| 22 | − }; | |
| 4 | + static events = { | |
| 5 | + focus: "onFocus", | |
| 6 | + blur: "onBlur", | |
| 7 | + mouseover: "onMouseover", | |
| 8 | + mouseout: "onMouseout", | |
| 9 | + scroll: "onScroll", | |
| 10 | + click: "onClick", | |
| 11 | + }; | |
| 23 | 12 | |
| 24 | − this.routes = { after: "onRoute" }; | |
| 25 | − } | |
| 13 | + static routes = { after: "onRoute" }; | |
| 26 | 14 | |
| 27 | 15 | constructor(el) { |
| 28 | 16 | super(el); |
| @@ -72,9 +60,7 @@ app.views.SidebarHover = class SidebarHover extends app.View { · 43 unmodified lines | ||
| 72 | 60 | } |
| 73 | 61 | |
| 74 | 62 | isTarget(el) { |
| 75 | − return __guard__(el != null ? el.classList : undefined, (x) => | |
| 76 | − x.contains(this.constructor.itemClass), | |
| 77 | − ); | |
| 63 | + return el.classList?.contains(this.constructor.itemClass); | |
| 78 | 64 | } |
| 79 | 65 | |
| 80 | 66 | isSelected(el) { |
| @@ -129,16 +115,9 @@ app.views.SidebarHover = class SidebarHover extends app.View { · 48 unmodified lines | ||
| 129 | 115 | this.hide(); |
| 130 | 116 | } |
| 131 | 117 | }; |
| 132 | −app.views.SidebarHover.initClass(); | |
| 133 | 118 | |
| 134 | 119 | var isPointerEventsSupported = function () { |
| 135 | 120 | const el = document.createElement("div"); |
| 136 | 121 | el.style.cssText = "pointer-events: auto"; |
| 137 | 122 | return el.style.pointerEvents === "auto"; |
| 138 | 123 | }; |
| 139 | − | |
| 140 | −function __guard__(value, transform) { | |
| 141 | − return typeof value !== "undefined" && value !== null | |
| 142 | − ? transform(value) | |
| 143 | − : undefined; | |
| 144 | −} | |