diff --git a/frontend/app/scripts/directives/updatableUser.js b/frontend/app/scripts/directives/updatableUser.js index 1722831dd6..40a5e4c258 100644 --- a/frontend/app/scripts/directives/updatableUser.js +++ b/frontend/app/scripts/directives/updatableUser.js @@ -1,25 +1,25 @@ -(function() { +(function () { 'use strict'; angular.module('theHiveDirectives') - .directive('updatableUser', function(UserSrv, QuerySrv, UtilsSrv, AuthenticationSrv, NotificationSrv) { + .directive('updatableUser', function (UserSrv, QuerySrv, UtilsSrv, AuthenticationSrv, NotificationSrv) { return { restrict: 'E', - link: function(scope, element, attrs, ctrl, transclude) { + link: function (scope, element, attrs, ctrl, transclude) { var cached = false; UtilsSrv.updatableLink(scope, element, attrs, ctrl, transclude); - scope.setValue = function(value) { + scope.setValue = function (value) { scope.value = value; }; scope.getUserInfo = UserSrv.getCache; - scope.$watch('updatable.updating', function(value) { + scope.$watch('updatable.updating', function (value) { - if(value === true && !cached) { + if (value === true && !cached) { var assignableUsers = []; - if(_.isFunction(scope.query)) { + if (_.isFunction(scope.query)) { assignableUsers = scope.query.apply(this, scope.queryParams); } else { assignableUsers = scope.query; @@ -32,12 +32,12 @@ }, sort: ['+name'] }) - .then(function(users) { - scope.userList = users; - }) - .catch(function(err) { - NotificationSrv.error('Fetching users', err.data, err.status); - }); + .then(function (users) { + scope.userList = users; + }) + .catch(function (err) { + NotificationSrv.error('Fetching users', err.data, err.status); + }); cached = true; } @@ -47,6 +47,7 @@ scope: { value: '=?', query: '=', + blankText: '@', queryParams: '=', onUpdate: '&', active: '=?', diff --git a/frontend/app/views/directives/updatable-user.html b/frontend/app/views/directives/updatable-user.html index a64a013626..fd9d33a7c6 100644 --- a/frontend/app/views/directives/updatable-user.html +++ b/frontend/app/views/directives/updatable-user.html @@ -1,6 +1,7 @@