Welcome to mirror list, hosted at ThFree Co, Russian Federation.

shortcuts_find_file.js « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d8bac2762a36d782f2287373dfa931e29322ca17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Generated by CoffeeScript 1.10.0
(function() {
  var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
    hasProp = {}.hasOwnProperty;

  this.ShortcutsFindFile = (function(superClass) {
    extend(ShortcutsFindFile, superClass);

    function ShortcutsFindFile(projectFindFile) {
      var _oldStopCallback;
      this.projectFindFile = projectFindFile;
      ShortcutsFindFile.__super__.constructor.call(this);
      _oldStopCallback = Mousetrap.stopCallback;
      Mousetrap.stopCallback = (function(_this) {
        return function(event, element, combo) {
          if (element === _this.projectFindFile.inputElement[0] && (combo === 'up' || combo === 'down' || combo === 'esc' || combo === 'enter')) {
            event.preventDefault();
            return false;
          }
          return _oldStopCallback(event, element, combo);
        };
      })(this);
      Mousetrap.bind('up', this.projectFindFile.selectRowUp);
      Mousetrap.bind('down', this.projectFindFile.selectRowDown);
      Mousetrap.bind('esc', this.projectFindFile.goToTree);
      Mousetrap.bind('enter', this.projectFindFile.goToBlob);
    }

    return ShortcutsFindFile;

  })(ShortcutsNavigation);

}).call(this);