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
5 * DS102: Remove unnecessary code created because of implicit returns5 * DS102: Remove unnecessary code created because of implicit returns
6 * DS103: Rewrite code to no longer use __guard__, or convert again using --optional-chaining6 * DS103: Rewrite code to no longer use __guard__, or convert again using --optional-chaining
7 * DS205: Consider reworking code to avoid use of IIFEs7 * DS205: Consider reworking code to avoid use of IIFEs
8 * DS206: Consider reworking classes to avoid initClass
9 * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md8 * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
10 */9 */
11app.Shortcuts = class Shortcuts {10app.Shortcuts = class Shortcuts extends Events {
12 static initClass() {
13 $.extend(this.prototype, Events);
14 }
15
16 constructor() {11 constructor() {
12 super();
17 this.onKeydown = this.onKeydown.bind(this);13 this.onKeydown = this.onKeydown.bind(this);
18 this.onKeypress = this.onKeypress.bind(this);14 this.onKeypress = this.onKeypress.bind(this);
19 this.isMac = $.isMac();15 this.isMac = $.isMac();
@@ -306,7 +302,6 @@ app.Shortcuts = class Shortcuts { · 286 unmodified lines
306 }302 }
307 }303 }
308};304};
309app.Shortcuts.initClass();
310 305
311function __guard__(value, transform) {306function __guard__(value, transform) {
312 return typeof value !== "undefined" && value !== null307 return typeof value !== "undefined" && value !== null