This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
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');
});
};
});