Unified · Split
| @@ -1,20 +1,9 @@ | ||
| 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.Results = class Results extends app.View { |
| 11 | − static initClass() { | |
| 12 | − this.className = "_list"; | |
| 2 | + static className = "_list"; | |
| 13 | 3 | |
| 14 | − this.events = { click: "onClick" }; | |
| 4 | + static events = { click: "onClick" }; | |
| 15 | 5 | |
| 16 | − this.routes = { after: "afterRoute" }; | |
| 17 | − } | |
| 6 | + static routes = { after: "afterRoute" }; | |
| 18 | 7 | |
| 19 | 8 | constructor(sidebar, search) { |
| 20 | 9 | super(); |
| @@ -42,9 +31,7 @@ app.views.Results = class Results extends app.View { · 21 unmodified lines | ||
| 42 | 31 | |
| 43 | 32 | onResults(entries, flags) { |
| 44 | 33 | if (flags.initialResults) { |
| 45 | − if (this.listFocus != null) { | |
| 46 | − this.listFocus.blur(); | |
| 47 | − } | |
| 34 | + this.listFocus?.blur(); | |
| 48 | 35 | } |
| 49 | 36 | if (flags.initialResults) { |
| 50 | 37 | this.empty(); |
| @@ -70,16 +57,12 @@ app.views.Results = class Results extends app.View { · 19 unmodified lines | ||
| 70 | 57 | |
| 71 | 58 | focusFirst() { |
| 72 | 59 | if (!app.isMobile()) { |
| 73 | − if (this.listFocus != null) { | |
| 74 | − this.listFocus.focusOnNextFrame(this.el.firstElementChild); | |
| 75 | − } | |
| 60 | + this.listFocus?.focusOnNextFrame(this.el.firstElementChild); | |
| 76 | 61 | } |
| 77 | 62 | } |
| 78 | 63 | |
| 79 | 64 | openFirst() { |
| 80 | − if (this.el.firstElementChild != null) { | |
| 81 | − this.el.firstElementChild.click(); | |
| 82 | − } | |
| 65 | + this.el.firstElementChild?.click(); | |
| 83 | 66 | } |
| 84 | 67 | |
| 85 | 68 | onDocEnabled(doc) { |
| @@ -109,4 +92,3 @@ app.views.Results = class Results extends app.View { · 23 unmodified lines | ||
| 109 | 92 | } |
| 110 | 93 | } |
| 111 | 94 | }; |
| 112 | −app.views.Results.initClass(); | |