Permalink
Browse files

Save gzip space by repeating element.tagName

  • Loading branch information...
1 parent 9cf352f commit 8a5870bfcf7d0aca556f6f952f016feb96728d4b @ccampbell committed Sep 18, 2012
Showing with 1 addition and 3 deletions.
  1. +1 −3 mousetrap.js
View
@@ -789,8 +789,6 @@
* @param {Element} element
* @return {boolean}
*/
- var element = e.target || e.srcElement,
- tag_name = element.tagName;
stopCallback: function(e, element) {
// if the element has the class "mousetrap" then no need to stop
@@ -799,7 +797,7 @@
}
// stop for input, select, and textarea
- return tag_name == 'INPUT' || tag_name == 'SELECT' || tag_name == 'TEXTAREA' || (element.contentEditable && element.contentEditable == 'true');
+ return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || (element.contentEditable && element.contentEditable == 'true');
}
};

0 comments on commit 8a5870b

Please sign in to comment.