Last active
August 12, 2018 06:28
-
-
Save rjoydip-zz/968c0d6aae34e2fd57b0bb4f807dac34 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.directive('imageSwap', [function() { | |
return { | |
restrict: 'EA', | |
link: function(scope, elem, attrs, ctrl) { | |
var profileMainImage = []; | |
var innerHtml = attrs.src; | |
var id = attrs.id; | |
if (id) { | |
elem.bind('click', function() { | |
profileMainImage['alt'] = attrs.videoUrl; | |
profileMainImage['src'] = innerHtml; | |
if (attrs.videoUrl !== undefined) scope.openVideoModal(attrs.videoUrl, attrs.id, elem.parent('div')); | |
if (id !== undefined) scope.reportFakeVideo(attrs.id); | |
if (id !== undefined) scope.reportGoodVideo(attrs.id); | |
}); | |
} | |
} | |
}; | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment