Add wikiEdit to constructor

This commit is contained in:
geoandri 2017-03-31 12:32:55 +03:00 committed by George Andrinopoulos
parent b96abc7d26
commit 07442bf841

View file

@ -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'));
}
}