0
myDirectives.directive("mouseholdevent", function() { return { restrict: 'A', link: function (scope, element) { var el = element[0]; el.mousehold = true; var setint = ''; var rightClick = false; ele(element).mousedown(function (e) { setint = setInterval(function() { if (rightClick) { clearInterval(setint); } else { if (element.hasClass("zoom_out")) { scope.zoomOutOnCanvasImage(); } else if (element.hasClass("zoom_in")) { scope.zoomInOnCanvasImage(); } } }, 100); }); ele(element).on("mouseleave mouseup contextmenu", function() { rightClick = true; clearInterval(setint); }); } }; });