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
338 B
JavaScript
Raw Normal View History

2019-11-12 16:09:47 +00:00
/**
* 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');
});
};
});