瀏覽代碼

Sanity-check decaffeinate app.views.ListFocus

Simon Legner 1 年之前
父節點
當前提交
b07fd01ab1
共有 1 個文件被更改,包括 12 次插入24 次删除
  1. 12 24
      assets/javascripts/views/list/list_focus.js

+ 12 - 24
assets/javascripts/views/list/list_focus.js

@@ -1,27 +1,16 @@
-// TODO: This file was created by bulk-decaffeinate.
-// Sanity-check the conversion and remove this comment.
-/*
- * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
- * DS206: Consider reworking classes to avoid initClass
- * DS207: Consider shorter variations of null checks
- * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
- */
 app.views.ListFocus = class ListFocus extends app.View {
-  static initClass() {
-    this.activeClass = "focus";
-
-    this.events = { click: "onClick" };
-
-    this.shortcuts = {
-      up: "onUp",
-      down: "onDown",
-      left: "onLeft",
-      enter: "onEnter",
-      superEnter: "onSuperEnter",
-      escape: "blur",
-    };
-  }
+  static activeClass = "focus";
+
+  static events = { click: "onClick" };
+
+  static shortcuts = {
+    up: "onUp",
+    down: "onDown",
+    left: "onLeft",
+    enter: "onEnter",
+    superEnter: "onSuperEnter",
+    escape: "blur",
+  };
 
   constructor(el) {
     super(el);
@@ -194,4 +183,3 @@ app.views.ListFocus = class ListFocus extends app.View {
     }
   }
 };
-app.views.ListFocus.initClass();