Skip to content

Commit

Permalink
feat: add fa-mouseover directive
Browse files Browse the repository at this point in the history
  • Loading branch information
zackbrown committed Aug 2, 2014
1 parent b081f26 commit b2d00d0
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
25 changes: 25 additions & 0 deletions dist/famous-angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -2704,6 +2704,31 @@ angular.module('famous.angular')
};
}]);

angular.module('famous.angular')
.directive('faMouseover', ['$parse', '$famousDecorator', function ($parse, $famousDecorator) {
return {
restrict: 'A',
scope: false,
compile: function() {
return {
post: function(scope, element, attrs) {
var isolate = $famousDecorator.ensureIsolate(scope);

if (attrs.faMouseover) {
var renderNode = (isolate.renderNode._eventInput || isolate.renderNode);

renderNode.on("mouseover", function(data) {
var fn = $parse(attrs.faMouseover);
fn(scope, {$event:data});
if(!scope.$$phase)
scope.$apply();
});
}
}
};
}
};
}]);
/**
* @ngdoc directive
* @name faPipeFrom
Expand Down
Loading

0 comments on commit b2d00d0

Please sign in to comment.