Switch avatars to be built out of CSS and only overlayed with the gravatar when a non-default exists
This commit is contained in:
parent
2d8d0c6fd3
commit
27a9b84587
94 changed files with 663 additions and 303 deletions
17
static/js/directives/ng-image-watch.js
Normal file
17
static/js/directives/ng-image-watch.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* Adds a ng-image-watch attribute, which is a callback invoked when the image is loaded or fails.
|
||||
*/
|
||||
angular.module('quay').directive('ngImageWatch', function () {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function postLink($scope, $element, $attr) {
|
||||
$element.bind('error', function() {
|
||||
$scope.$eval($attr.ngImageWatch)(false);
|
||||
});
|
||||
|
||||
$element.bind('load', function() {
|
||||
$scope.$eval($attr.ngImageWatch)(true);
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
Reference in a new issue