History

class Shortcuts extends Events

Simon Legner committed 2 years ago

Commit bf65fae1 parent b6a5e381 file · +2 −7Browse files

Unified · Split

assets/javascripts/app/shortcuts.js+2−7
@@ -5,15 +5,11 @@ · 4 unmodified lines
55 * DS102: Remove unnecessary code created because of implicit returns
66 * DS103: Rewrite code to no longer use __guard__, or convert again using --optional-chaining
77 * DS205: Consider reworking code to avoid use of IIFEs
8− * DS206: Consider reworking classes to avoid initClass
98 * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
109 */
11−app.Shortcuts = class Shortcuts {
12− static initClass() {
13− $.extend(this.prototype, Events);
14− }
15−
10+app.Shortcuts = class Shortcuts extends Events {
1611 constructor() {
12+ super();
1713 this.onKeydown = this.onKeydown.bind(this);
1814 this.onKeypress = this.onKeypress.bind(this);
1915 this.isMac = $.isMac();
@@ -306,7 +302,6 @@ app.Shortcuts = class Shortcuts { · 286 unmodified lines
306302 }
307303 }
308304 };
309−app.Shortcuts.initClass();
310305
311306 function __guard__(value, transform) {
312307 return typeof value !== "undefined" && value !== null