This repository has been archived on 2020-03-24. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
quay/static/js/directives/ng-visible.js

10 lines
No EOL
338 B
JavaScript

/**
* Adds an ng-visible attribute that hides an element if the expression evaluates to false.
*/
angular.module('quay').directive('ngVisible', function () {
return function (scope, element, attr) {
scope.$watch(attr.ngVisible, function (visible) {
element.css('visibility', visible ? 'visible' : 'hidden');
});
};
});