Updates for refinements of UX.

This commit is contained in:
kunw 2016-11-02 18:01:07 +08:00
parent 35217b251c
commit 10f69d5250
13 changed files with 118 additions and 17 deletions

View File

@ -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);

View File

@ -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});
}
});
}
});
}

View File

@ -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();
});
}
});
}
}

View File

@ -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();
}
});
}
});
}

View File

@ -12,7 +12,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="well well-custom" style="position: absolute; margin-left: 10px; margin-top: 5px; width: 96%;">
<div class="well well-custom" style="position: absolute; margin-left: 10px; margin-top: 5px; width: 94%;">
<form name="form" class="css-form form-custom" novalidate>
<div class="row">
<div class="col-xs-10 col-md-10">

View File

@ -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();
});
}
});
}
}
})();

View File

@ -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();
}
});
}
});

View File

@ -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();
}
});
}
});
}

View File

@ -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();
}
});
}
});
}

View File

@ -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();
}
});
}
});
}

View File

@ -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();
}
});
}
});
}

View File

@ -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();
}
});
}
}

View File

@ -12,12 +12,25 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<style>
.custom-section {
padding: 15px;
margin-top: 20px;
background-color: #FFFFFF;
min-height: 672px;
width: 100%;
height: 950px;
}
.custom-sub-pane {
height: 800px;
}
}
</style>
<div class="container-fluid container-fluid-custom" element-height ng-controller="ProjectController as vm">
<modal-dialog modal-title="// vm.modalTitle //" modal-message="// vm.modalMessage //" confirm-only="vm.confirmOnly" action="vm.action()"></modal-dialog>
<div class="container container-custom">
<div class="row extend-height">
<div class="col-xs-12 col-md-12 extend-height">
<div class="section">
<div class="custom-section">
<h4 class="page-header">
<span ng-if="vm.isPublic === 0">// 'my_projects' | tr //</span>
<a ng-if="vm.isPublic === 1" href="javascript:void(0);" ng-click="vm.togglePublicity({isPublic: 0})">// 'my_projects' | tr //</a>
@ -39,7 +52,7 @@
</div>
<add-project ng-show="vm.isOpen" is-open="vm.isOpen"></add-project>
<div class="each-tab-pane">
<div class="sub-pane">
<div class="custom-sub-pane">
<div class="table-head-container">
<table class="table table-pane table-header">
<thead>