Skip to content
代码片段 群组 项目
未验证 提交 f682bf5b 编辑于 作者: Mark Florian's avatar Mark Florian
浏览文件

chore: Remove dead code due to unused arguments

- The skipResetBindings constructor parameter was removed in
  4ee29e89, so all related code can be
  removed.
- The ShortcutsEpic.openSidebarDropdown static method's only parameter
  was removed in
  https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75302, so
  there's no point passing anything to it.
- The ShortcutsTestCase.openSidebarDropdown static method never expected
  any parameters since creation in
  https://gitlab.com/gitlab-org/gitlab/-/merge_requests/109527, so
  there's no point passing anything to it.
上级 f9f66a45
No related branches found
No related tags found
无相关合并请求
......@@ -11,7 +11,6 @@ import { updateRefPortionOfTitle } from '~/repository/utils/title';
import Shortcuts from './shortcuts';
const defaults = {
skipResetBindings: false,
fileBlobPermalinkUrl: null,
fileBlobPermalinkUrlElement: null,
};
......@@ -24,7 +23,7 @@ function eventHasModifierKeys(event) {
export default class ShortcutsBlob extends Shortcuts {
constructor(opts) {
const options = { ...defaults, ...opts };
super(options.skipResetBindings);
super();
this.options = options;
this.shortcircuitPermalinkButton();
......
......@@ -22,7 +22,6 @@ export default () => {
// eslint-disable-next-line no-new
new ShortcutsBlob({
skipResetBindings: true,
fileBlobPermalinkUrl,
fileBlobPermalinkUrlElement,
});
......
......@@ -101,7 +101,6 @@ export default {
fileBlobPermalinkUrlElement && fileBlobPermalinkUrlElement.getAttribute('href');
// eslint-disable-next-line no-new
new ShortcutsBlob({
skipResetBindings: true,
fileBlobPermalinkUrl,
fileBlobPermalinkUrlElement,
});
......
import $ from 'jquery';
import Mousetrap from 'mousetrap';
import {
keysFor,
......@@ -12,11 +11,7 @@ export default class ShortcutsEpic extends ShortcutsIssuable {
constructor() {
super();
const $issuableSidebar = $('.js-issuable-update');
Mousetrap.bind(keysFor(ISSUABLE_CHANGE_LABEL), () =>
ShortcutsEpic.openSidebarDropdown($issuableSidebar.find('.js-labels-block')),
);
Mousetrap.bind(keysFor(ISSUABLE_CHANGE_LABEL), ShortcutsEpic.openSidebarDropdown);
Mousetrap.bind(keysFor(ISSUABLE_COMMENT_OR_REPLY), ShortcutsIssuable.replyWithSelectedText);
Mousetrap.bind(keysFor(ISSUABLE_EDIT_DESCRIPTION), ShortcutsIssuable.editIssue);
}
......
import $ from 'jquery';
import Mousetrap from 'mousetrap';
import { keysFor, ISSUABLE_CHANGE_LABEL } from '~/behaviors/shortcuts/keybindings';
import ShortcutsIssuable from '~/behaviors/shortcuts/shortcuts_issuable';
......@@ -7,11 +6,7 @@ export default class ShortcutsTestCase extends ShortcutsIssuable {
constructor() {
super();
const $issuableSidebar = $('.issuable-sidebar');
Mousetrap.bind(keysFor(ISSUABLE_CHANGE_LABEL), () =>
ShortcutsTestCase.openSidebarDropdown($issuableSidebar.find('.js-labels-block')),
);
Mousetrap.bind(keysFor(ISSUABLE_CHANGE_LABEL), ShortcutsTestCase.openSidebarDropdown);
}
static openSidebarDropdown() {
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册