diff --git a/src/ui/static/resources/js/components/element-height/element-height.inspector.js b/src/ui/static/resources/js/components/element-height/element-height.inspector.js index 40d638adf..bf7350a97 100644 --- a/src/ui/static/resources/js/components/element-height/element-height.inspector.js +++ b/src/ui/static/resources/js/components/element-height/element-height.inspector.js @@ -48,8 +48,6 @@ element.find('.section').css({'height': (h - scope.subsHeight - scope.subsSection) + 'px'}); element.find('.sub-pane').css({'height': (h - scope.subsHeight - scope.subsSubPane) + 'px'}); element.find('.tab-pane').css({'height': (h - scope.subsHeight - scope.subsSubPane - scope.subsSection -100) + 'px'}); -// var subPaneHeight = element.find('.sub-pane').height(); -// element.find('.table-body-container').css({'height': (subPaneHeight - scope.subsTblBody) + 'px'}); } }, true); diff --git a/src/ui/static/resources/js/components/log/list-log.directive.js b/src/ui/static/resources/js/components/log/list-log.directive.js index ae0f60fce..481b1c28c 100644 --- a/src/ui/static/resources/js/components/log/list-log.directive.js +++ b/src/ui/static/resources/js/components/log/list-log.directive.js @@ -143,7 +143,9 @@ } - function listLog() { + listLog.$inject = ['$timeout']; + + function listLog($timeout) { var directive = { 'restrict': 'E', 'templateUrl': '/static/resources/js/components/log/list-log.directive.html', @@ -162,6 +164,12 @@ element.find('#txtSearchInput').on('keydown', function(e) { if($(this).is(':focus') && e.keyCode === 13) { ctrl.search({'op': ctrl.op, 'username': ctrl.username}); + } else { + $timeout(function() { + if(ctrl.username.length === 0) { + ctrl.search({'op': ctrl.op, 'username': ctrl.username}); + } + }); } }); } diff --git a/src/ui/static/resources/js/components/project-member/add-project-member.directive.js b/src/ui/static/resources/js/components/project-member/add-project-member.directive.js index a872ba04b..7018ad5b3 100644 --- a/src/ui/static/resources/js/components/project-member/add-project-member.directive.js +++ b/src/ui/static/resources/js/components/project-member/add-project-member.directive.js @@ -88,8 +88,10 @@ } } + + addProjectMember.$inject = ['$timeout']; - function addProjectMember() { + function addProjectMember($timeout) { var directive = { 'restrict': 'E', 'templateUrl': '/static/resources/js/components/project-member/add-project-member.directive.html', @@ -109,6 +111,13 @@ function link(scope, element, attrs, ctrl) { scope.form.$setPristine(); scope.form.$setUntouched(); + scope.$watch('vm.isOpen', function(current) { + if(current) { + $timeout(function() { + element.find('[name=uUsername]:input').focus(); + }); + } + }); } } diff --git a/src/ui/static/resources/js/components/project-member/list-project-member.directive.js b/src/ui/static/resources/js/components/project-member/list-project-member.directive.js index 6fa330532..ba582dcae 100644 --- a/src/ui/static/resources/js/components/project-member/list-project-member.directive.js +++ b/src/ui/static/resources/js/components/project-member/list-project-member.directive.js @@ -96,7 +96,9 @@ } - function listProjectMember() { + listProjectMember.$inject = ['$timeout']; + + function listProjectMember($timeout) { var directive = { 'restrict': 'E', 'templateUrl': '/static/resources/js/components/project-member/list-project-member.directive.html', @@ -116,6 +118,12 @@ element.find('#txtSearchInput').on('keydown', function(e) { if($(this).is(':focus') && e.keyCode === 13) { ctrl.retrieve(); + } else { + $timeout(function() { + if(ctrl.username.length === 0) { + ctrl.retrieve(); + } + }); } }); } diff --git a/src/ui/static/resources/js/components/project/add-project.directive.html b/src/ui/static/resources/js/components/project/add-project.directive.html index 31987a983..76afdc46f 100644 --- a/src/ui/static/resources/js/components/project/add-project.directive.html +++ b/src/ui/static/resources/js/components/project/add-project.directive.html @@ -12,7 +12,7 @@ See the License for the specific language governing permissions and limitations under the License. --> -
+
diff --git a/src/ui/static/resources/js/components/project/add-project.directive.js b/src/ui/static/resources/js/components/project/add-project.directive.js index 8325f56c6..0a96d3961 100644 --- a/src/ui/static/resources/js/components/project/add-project.directive.js +++ b/src/ui/static/resources/js/components/project/add-project.directive.js @@ -97,18 +97,31 @@ } } - function addProject() { + addProject.$inject = ['$timeout']; + + function addProject($timeout) { var directive = { 'restrict': 'E', 'templateUrl': '/static/resources/js/components/project/add-project.directive.html', 'controller': AddProjectController, + 'link': link, 'scope' : { 'isOpen': '=' }, 'controllerAs': 'vm', 'bindToController': true }; - return directive; + return directive; + + function link(scope, element, attrs, ctrl) { + scope.$watch('vm.isOpen', function(current) { + if(current) { + $timeout(function() { + element.find(':input[name=uProjectName]').focus(); + }); + } + }); + } } })(); diff --git a/src/ui/static/resources/js/components/replication/list-replication.directive.js b/src/ui/static/resources/js/components/replication/list-replication.directive.js index 2079e5278..166afdcc0 100644 --- a/src/ui/static/resources/js/components/replication/list-replication.directive.js +++ b/src/ui/static/resources/js/components/replication/list-replication.directive.js @@ -290,6 +290,8 @@ } + listReplication.inject = ['$timeout', 'I18nService']; + function listReplication($timeout, I18nService) { var directive = { 'restrict': 'E', @@ -398,12 +400,24 @@ element.find('#txtSearchPolicyInput').on('keydown', function(e) { if($(this).is(':focus') && e.keyCode === 13) { ctrl.searchReplicationPolicy(); + } else { + $timeout(function() { + if(ctrl.replicationPolicyName.length === 0) { + ctrl.searchReplicationPolicy(); + } + }); } }); element.find('#txtSearchJobInput').on('keydown', function(e) { if($(this).is(':focus') && e.keyCode === 13) { ctrl.searchReplicationJob(); + } else { + $timeout(function() { + if(ctrl.replicationJobName.length === 0) { + ctrl.searchReplicationJob(); + } + }); } }); diff --git a/src/ui/static/resources/js/components/repository/list-repository.directive.js b/src/ui/static/resources/js/components/repository/list-repository.directive.js index 918f80eac..44fcefbab 100644 --- a/src/ui/static/resources/js/components/repository/list-repository.directive.js +++ b/src/ui/static/resources/js/components/repository/list-repository.directive.js @@ -192,7 +192,9 @@ } - function listRepository() { + listRepository.$inject = ['$timeout']; + + function listRepository($timeout) { var directive = { 'restrict': 'E', 'templateUrl': '/static/resources/js/components/repository/list-repository.directive.html', @@ -212,6 +214,12 @@ element.find('#txtSearchInput').on('keydown', function(e) { if($(this).is(':focus') && e.keyCode === 13) { ctrl.retrieve(); + } else { + $timeout(function() { + if(ctrl.filterInput.length === 0) { + ctrl.retrieve(); + } + }); } }); } diff --git a/src/ui/static/resources/js/components/system-management/destination.directive.js b/src/ui/static/resources/js/components/system-management/destination.directive.js index 541c15516..8943aad00 100644 --- a/src/ui/static/resources/js/components/system-management/destination.directive.js +++ b/src/ui/static/resources/js/components/system-management/destination.directive.js @@ -103,7 +103,9 @@ } } - function destination() { + destination.$inject = ['$timeout']; + + function destination($timeout) { var directive = { 'restrict': 'E', 'templateUrl': '/static/resources/js/components/system-management/destination.directive.html', @@ -119,6 +121,12 @@ element.find('#txtSearchInput').on('keydown', function(e) { if($(this).is(':focus') && e.keyCode === 13) { ctrl.retrieve(); + } else { + $timeout(function() { + if(ctrl.destinationName.length === 0) { + ctrl.retrieve(); + } + }); } }); } diff --git a/src/ui/static/resources/js/components/system-management/replication.directive.js b/src/ui/static/resources/js/components/system-management/replication.directive.js index 923bf85f1..522c8f672 100644 --- a/src/ui/static/resources/js/components/system-management/replication.directive.js +++ b/src/ui/static/resources/js/components/system-management/replication.directive.js @@ -106,7 +106,9 @@ } } - function replication() { + replication.$inject = ['$timeout']; + + function replication($timeout) { var directive = { 'restrict': 'E', 'templateUrl': '/static/resources/js/components/system-management/replication.directive.html', @@ -122,6 +124,12 @@ element.find('#txtSearchInput').on('keydown', function(e) { if($(this).is(':focus') && e.keyCode === 13) { ctrl.retrieve(); + } else { + $timeout(function() { + if(ctrl.replicationName.length === 0) { + ctrl.retrieve(); + } + }); } }); } diff --git a/src/ui/static/resources/js/components/user/list-user.directive.js b/src/ui/static/resources/js/components/user/list-user.directive.js index 77b1903db..68d63ee29 100644 --- a/src/ui/static/resources/js/components/user/list-user.directive.js +++ b/src/ui/static/resources/js/components/user/list-user.directive.js @@ -93,7 +93,9 @@ } } - function listUser() { + listUser.$inject = ['$timeout']; + + function listUser($timeout) { var directive = { 'restrict': 'E', 'templateUrl': '/static/resources/js/components/user/list-user.directive.html', @@ -111,6 +113,12 @@ element.find('#txtSearchInput').on('keydown', function(e) { if($(this).is(':focus') && e.keyCode === 13) { ctrl.retrieve(); + } else { + $timeout(function() { + if(ctrl.username.length === 0) { + ctrl.retrieve(); + } + }); } }); } diff --git a/src/ui/static/resources/js/layout/project/project.controller.js b/src/ui/static/resources/js/layout/project/project.controller.js index 674c360b1..9f65fb38f 100644 --- a/src/ui/static/resources/js/layout/project/project.controller.js +++ b/src/ui/static/resources/js/layout/project/project.controller.js @@ -119,8 +119,8 @@ $scope.$on('addedSuccess', function(e, val) { vm.retrieve(); - }); - + }); + function showAddProject() { vm.isOpen = vm.isOpen ? false : true; } @@ -144,6 +144,12 @@ var keyCode = $event.which || $event.keyCode; if(keyCode === 13) { vm.retrieve(); + } else { + $timeout(function() { + if(vm.projectName.length === 0) { + vm.retrieve(); + } + }); } } diff --git a/src/ui/views/project.htm b/src/ui/views/project.htm index 7be0c4593..f093f29a9 100644 --- a/src/ui/views/project.htm +++ b/src/ui/views/project.htm @@ -12,12 +12,25 @@ See the License for the specific language governing permissions and limitations under the License. --> +
-
-
+
-
+