Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Commit

Permalink
Bug 1118342 - Support multi-key shortcuts when focused in add-related…
Browse files Browse the repository at this point in the history
…-bug
  • Loading branch information
tojon committed Feb 24, 2015
1 parent a44bcbb commit 95dc701
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion webapp/app/js/controllers/main.js
Expand Up @@ -127,6 +127,12 @@ treeherder.controller('MainCtrl', [
$scope.$evalAsync(
$rootScope.$broadcast('focus-this', "related-bug-input")
);

/* Treat single key shortcuts as regular text during input.
* This prevents invocation of single key hotkeys like 'c'
* during bug number entry, which would cross focus the
* comments field. We validate numbers via the markup. */
$scope.$evalAsync($scope.allowKeys());
}
});

Expand All @@ -145,7 +151,7 @@ treeherder.controller('MainCtrl', [
$rootScope.$broadcast('focus-this', "classification-comment")
);

// Unbind all shortcut keys during input
// Treat single key shortcuts as regular text during input
$scope.$evalAsync($scope.allowKeys());
}
});
Expand Down
2 changes: 1 addition & 1 deletion webapp/app/partials/main/thPinboardPanel.html
Expand Up @@ -26,7 +26,7 @@
class="add-related-bugs-form">
<input id="related-bug-input"
type="number"
class="add-related-bugs-input"
class="add-related-bugs-input mousetrap"
ng-model="$parent.newEnteredBugNumber"
placeholder="enter bug number"
focus-me="focusInput">
Expand Down

0 comments on commit 95dc701

Please sign in to comment.