Unified · Split
| @@ -1,30 +1,19 @@ | ||
| 1 | −// TODO: This file was created by bulk-decaffeinate. | |
| 2 | −// Sanity-check the conversion and remove this comment. | |
| 3 | −/* | |
| 4 | − * decaffeinate suggestions: | |
| 5 | − * DS101: Remove unnecessary use of Array.from | |
| 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.DocList = class DocList extends app.View { |
| 11 | − static initClass() { | |
| 12 | − this.className = "_list"; | |
| 13 | − this.attributes = { role: "navigation" }; | |
| 14 | − | |
| 15 | − this.events = { | |
| 16 | − open: "onOpen", | |
| 17 | − close: "onClose", | |
| 18 | − click: "onClick", | |
| 19 | − }; | |
| 20 | − | |
| 21 | − this.routes = { after: "afterRoute" }; | |
| 22 | − | |
| 23 | − this.elements = { | |
| 24 | − disabledTitle: "._list-title", | |
| 25 | − disabledList: "._disabled-list", | |
| 26 | − }; | |
| 27 | − } | |
| 2 | + static className = "_list"; | |
| 3 | + static attributes = { role: "navigation" }; | |
| 4 | + | |
| 5 | + static events = { | |
| 6 | + open: "onOpen", | |
| 7 | + close: "onClose", | |
| 8 | + click: "onClick", | |
| 9 | + }; | |
| 10 | + | |
| 11 | + static routes = { after: "afterRoute" }; | |
| 12 | + | |
| 13 | + static elements = { | |
| 14 | + disabledTitle: "._list-title", | |
| 15 | + disabledList: "._disabled-list", | |
| 16 | + }; | |
| 28 | 17 | |
| 29 | 18 | init() { |
| 30 | 19 | this.lists = {}; |
| @@ -57,7 +46,7 @@ app.views.DocList = class DocList extends app.View { · 26 unmodified lines | ||
| 57 | 46 | |
| 58 | 47 | render() { |
| 59 | 48 | let html = ""; |
| 60 | − for (var doc of Array.from(app.docs.all())) { | |
| 49 | + for (var doc of app.docs.all()) { | |
| 61 | 50 | html += this.tmpl("sidebarDoc", doc, { |
| 62 | 51 | fullName: app.docs.countAllBy("name", doc.name) > 1, |
| 63 | 52 | }); |
| @@ -87,7 +76,7 @@ app.views.DocList = class DocList extends app.View { · 23 unmodified lines | ||
| 87 | 76 | appendDisabledList() { |
| 88 | 77 | let doc; |
| 89 | 78 | let html = ""; |
| 90 | − const docs = [].concat(...Array.from(app.disabledDocs.all() || [])); | |
| 79 | + const docs = [].concat(...(app.disabledDocs.all() || [])); | |
| 91 | 80 | |
| 92 | 81 | while ((doc = docs.shift())) { |
| 93 | 82 | if (doc.version != null) { |
| @@ -258,4 +247,3 @@ app.views.DocList = class DocList extends app.View { · 164 unmodified lines | ||
| 258 | 247 | } |
| 259 | 248 | } |
| 260 | 249 | }; |
| 261 | −app.views.DocList.initClass(); | |