From 07442bf84141cf766d05f014385a2ada4d5b6442 Mon Sep 17 00:00:00 2001 From: geoandri Date: Fri, 31 Mar 2017 12:32:55 +0300 Subject: Add wikiEdit to constructor --- app/assets/javascripts/shortcuts_wiki.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/shortcuts_wiki.js b/app/assets/javascripts/shortcuts_wiki.js index bf4479f29c8..d6d78e70f6d 100644 --- a/app/assets/javascripts/shortcuts_wiki.js +++ b/app/assets/javascripts/shortcuts_wiki.js @@ -1,14 +1,14 @@ -/* eslint-disable class-methods-use-this*/ /* global Mousetrap */ /* global ShortcutsNavigation */ export default class ShortcutsWiki extends ShortcutsNavigation { constructor() { super(); - Mousetrap.bind('e', this.editWiki); + this.$wikiEdit = $('.wiki-edit'); + Mousetrap.bind('e', this.editWiki.bind(this)); } editWiki() { - gl.utils.visitUrl($('.wiki-edit').attr('href')); + gl.utils.visitUrl(this.$wikiEdit.attr('href')); } } -- cgit v1.2.1