Unified · Split
| @@ -1,25 +1,14 @@ | ||
| 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 | − * DS206: Consider reworking classes to avoid initClass | |
| 7 | − * DS207: Consider shorter variations of null checks | |
| 8 | − * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md | |
| 9 | − */ | |
| 10 | 1 | app.views.ListFold = class ListFold extends app.View { |
| 11 | − static initClass() { | |
| 12 | − this.targetClass = "_list-dir"; | |
| 13 | − this.handleClass = "_list-arrow"; | |
| 14 | − this.activeClass = "open"; | |
| 2 | + static targetClass = "_list-dir"; | |
| 3 | + static handleClass = "_list-arrow"; | |
| 4 | + static activeClass = "open"; | |
| 15 | 5 | |
| 16 | − this.events = { click: "onClick" }; | |
| 6 | + static events = { click: "onClick" }; | |
| 17 | 7 | |
| 18 | − this.shortcuts = { | |
| 19 | − left: "onLeft", | |
| 20 | − right: "onRight", | |
| 21 | − }; | |
| 22 | − } | |
| 8 | + static shortcuts = { | |
| 9 | + left: "onLeft", | |
| 10 | + right: "onRight", | |
| 11 | + }; | |
| 23 | 12 | |
| 24 | 13 | open(el) { |
| 25 | 14 | if (el && !el.classList.contains(this.constructor.activeClass)) { |
| @@ -59,11 +48,7 @@ app.views.ListFold = class ListFold extends app.View { · 33 unmodified lines | ||
| 59 | 48 | |
| 60 | 49 | onLeft() { |
| 61 | 50 | const cursor = this.getCursor(); |
| 62 | − if ( | |
| 63 | − cursor != null | |
| 64 | − ? cursor.classList.contains(this.constructor.activeClass) | |
| 65 | − : undefined | |
| 66 | − ) { | |
| 51 | + if (cursor?.classList?.contains(this.constructor.activeClass)) { | |
| 67 | 52 | this.close(cursor); |
| 68 | 53 | } |
| 69 | 54 | } |
| @@ -109,4 +94,3 @@ app.views.ListFold = class ListFold extends app.View { · 39 unmodified lines | ||
| 109 | 94 | } |
| 110 | 95 | } |
| 111 | 96 | }; |
| 112 | −app.views.ListFold.initClass(); | |