Skip to content

Commit

Permalink
refactor(ngEventDirs): remove a useless call
Browse files Browse the repository at this point in the history
The event names are already lower-case.
  • Loading branch information
thorn0 authored and btford committed Sep 11, 2014
1 parent 58adaa6 commit 5cf1d89
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ng/directive/ngEventDirs.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,14 @@ var forceAsyncEvents = {
};
forEach(
'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste'.split(' '),
function(name) {
var directiveName = directiveNormalize('ng-' + name);
function(eventName) {
var directiveName = directiveNormalize('ng-' + eventName);
ngEventDirectives[directiveName] = ['$parse', '$rootScope', function($parse, $rootScope) {
return {
restrict: 'A',
compile: function($element, attr) {
var fn = $parse(attr[directiveName]);
return function ngEventHandler(scope, element) {
var eventName = lowercase(name);
element.on(eventName, function(event) {
var callback = function() {
fn(scope, {$event:event});
Expand Down

0 comments on commit 5cf1d89

Please sign in to comment.