Start on mobilification of repo view

This commit is contained in:
Joseph Schorr 2015-04-20 17:42:33 -04:00
parent 79caf2dab2
commit a4cacd7307
31 changed files with 265 additions and 91 deletions

View file

@ -10,12 +10,14 @@ angular.module('quay').directive('roleGroup', function () {
transclude: false,
restrict: 'C',
scope: {
'roles': '=roles',
'roles': '@roles',
'currentRole': '=currentRole',
'readOnly': '=readOnly',
'roleChanged': '&roleChanged'
},
controller: function($scope, $element) {
controller: function($scope, $element, RolesService) {
$scope.fullRoles = RolesService[$scope.roles];
$scope.setRole = function(role) {
if ($scope.currentRole == role) { return; }
if ($scope.roleChanged) {
@ -24,6 +26,14 @@ angular.module('quay').directive('roleGroup', function () {
$scope.currentRole = role;
}
};
$scope.getRoleInfo = function(role) {
var found = null;
$scope.fullRoles.forEach(function(r) {
if (r.id == role) { found = r; }
});
return found;
};
}
};
return directiveDefinitionObject;