You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.2 KiB
JavaScript
45 lines
1.2 KiB
JavaScript
// Generated by CoffeeScript 1.4.0
|
|
(function() {
|
|
|
|
angular.module('myApp.directives', []).directive('appVersion', [
|
|
'version', function(version) {
|
|
return function(scope, elm, attrs) {
|
|
return elm.text(version);
|
|
};
|
|
}
|
|
]).directive('hoverShow', function() {
|
|
return {
|
|
link: function(scope, elm, attrs) {
|
|
elm.bind('mouseover', {
|
|
attrs: attrs
|
|
}, function(ev) {
|
|
return elm.closest('.projects').find('.' + ev.data.attrs.hoverShow).show();
|
|
});
|
|
return elm.bind('mouseout', {
|
|
attrs: attrs
|
|
}, function(ev) {
|
|
return elm.closest('.projects').find('.' + ev.data.attrs.hoverShow).hide();
|
|
});
|
|
}
|
|
};
|
|
}).directive('customScroll', function(){
|
|
return {
|
|
link: function(scope, elm, attrs) {
|
|
$(elm).mCustomScrollbar({
|
|
theme: 'dark-2'
|
|
});
|
|
}
|
|
}
|
|
}).directive('copyToClipboard', [function () {
|
|
return {
|
|
restrict: 'A',
|
|
link: function (scope, iElement, iAttrs) {
|
|
iElement.on('click', function(){
|
|
window.prompt("Copy to clipboard: Ctrl+C, Enter", iElement[0].innerText);
|
|
})
|
|
}
|
|
};
|
|
}]);
|
|
|
|
}).call(this);
|