Summary Table

Categories Total Count
PII 0
URL 0
DNS 0
EKL 0
IP 0
PORT 0
VsID 0
CF 0
AI 0
VPD 0
PL 0
Other 0

File Content

define(['app', 'angular'], function (app, angular) {
'use strict';

app.config(function ($provide) {
$provide.decorator('ngClickDirective', function($delegate) {
var original = $delegate[0],
compile = original.compile;

original.compile = function() {
var link = compile.apply(this, arguments);

return function(scope, element, attrs) {
link.apply(this, arguments);
if(attrs.noClickDecoration != "true"){
!attrs.tabindex && attrs.$set("tabindex", 0);

if(element[0].tagName !== "BUTTON" && element[0].tagName !== "INPUT") {

if(!(attrs.role || attrs.href)) {
attrs.$set("role", "button");
}

element.bind('keypress', function (event) {
if(event.keyCode === 13 || event.keyCode === 32) {
scope.$eval(attrs.ngClick);
}
});

scope.$on("$destroy", function(){
element.unbind("keypress");
});
}
}
};
};
return $delegate;
});
});
});