##// END OF EJS Templates
mousetrap: add a stub for custom suppression logic for kb handling
ergo -
r835:ab3d6802 default
parent child Browse files
Show More
@@ -1,6 +1,18 b''
1 1 // Global keyboard bindings
2 2
3 3 function setRCMouseBindings(repoName, repoLandingRev) {
4
5 /** custom callback for supressing mousetrap from firing */
6 Mousetrap.stopCallback = function(e, element) {
7 // if the element has the class "mousetrap" then no need to stop
8 if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {
9 return false;
10 }
11
12 // stop for input, select, and textarea
13 return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;
14 };
15
4 16 // general help "?"
5 17 Mousetrap.bind(['?'], function(e) {
6 18 $('#help_kb').modal({});
General Comments 0
You need to be logged in to leave comments. Login now