Commit 7293be54ae2b7fec459d8b4582cfb9b0aee1187b

Authored by Igor Kulikov
1 parent 35204aaa

UI: Fix minor bugs/issues.

@@ -54,6 +54,6 @@ @@ -54,6 +54,6 @@
54 </md-input-container> 54 </md-input-container>
55 <md-input-container class="md-block"> 55 <md-input-container class="md-block">
56 <label translate>contact.email</label> 56 <label translate>contact.email</label>
57 - <input name="email" type="email" ng-model="contact.email">  
58 -</md-input-container> 57 + <input name="email" type="text" ng-pattern='/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\_\-0-9]+\.)+[a-zA-Z]{2,}))$/' ng-model="contact.email">
  58 +</md-input-container>
59   59  
@@ -125,7 +125,7 @@ function Grid() { @@ -125,7 +125,7 @@ function Grid() {
125 } 125 }
126 126
127 /*@ngInject*/ 127 /*@ngInject*/
128 -function GridController($scope, $state, $mdDialog, $document, $q, $timeout, $translate, $mdMedia, $templateCache, $window) { 128 +function GridController($scope, $state, $mdDialog, $document, $q, $mdUtil, $timeout, $translate, $mdMedia, $templateCache, $window) {
129 129
130 var vm = this; 130 var vm = this;
131 131
@@ -237,6 +237,10 @@ function GridController($scope, $state, $mdDialog, $document, $q, $timeout, $tra @@ -237,6 +237,10 @@ function GridController($scope, $state, $mdDialog, $document, $q, $timeout, $tra
237 vm.items.nextPageLink.limit = pageSize; 237 vm.items.nextPageLink.limit = pageSize;
238 } 238 }
239 vm.items.pending = false; 239 vm.items.pending = false;
  240 + if (vm.items.loadCallback) {
  241 + vm.items.loadCallback();
  242 + vm.items.loadCallback = null;
  243 + }
240 } 244 }
241 }, 245 },
242 function fail() { 246 function fail() {
@@ -469,7 +473,25 @@ function GridController($scope, $state, $mdDialog, $document, $q, $timeout, $tra @@ -469,7 +473,25 @@ function GridController($scope, $state, $mdDialog, $document, $q, $timeout, $tra
469 } 473 }
470 474
471 function refreshList() { 475 function refreshList() {
472 - $state.go($state.current, vm.refreshParamsFunc(), {reload: true}); 476 + let preservedTopIndex = vm.topIndex;
  477 + vm.items.data.length = 0;
  478 + vm.items.rowData.length = 0;
  479 + vm.items.nextPageLink = {
  480 + limit: preservedTopIndex + pageSize,
  481 + textSearch: $scope.searchConfig.searchText
  482 + };
  483 + vm.items.selections = {};
  484 + vm.items.selectedCount = 0;
  485 + vm.items.hasNext = true;
  486 + vm.items.pending = false;
  487 + vm.detailsConfig.isDetailsOpen = false;
  488 + vm.items.reloadPending = false;
  489 + vm.items.loadCallback = () => {
  490 + $mdUtil.nextTick(() => {
  491 + moveToIndex(preservedTopIndex);
  492 + });
  493 + };
  494 + vm.itemRows.getItemAtIndex(preservedTopIndex+pageSize);
473 } 495 }
474 496
475 function addItem($event) { 497 function addItem($event) {
@@ -22,10 +22,20 @@ @@ -22,10 +22,20 @@
22 .tb-card-item { 22 .tb-card-item {
23 @include transition(all .2s ease-in-out); 23 @include transition(all .2s ease-in-out);
24 md-card-content { 24 md-card-content {
  25 + padding-top: 0px;
25 max-height: 53px; 26 max-height: 53px;
26 } 27 }
27 - md-card-title-text {  
28 - max-height: 32px; 28 + md-card-title {
  29 + width: 100%;
  30 + md-card-title-text {
  31 + max-height: 32px;
  32 + min-width: 50%;
  33 + .md-headline {
  34 + overflow: hidden;
  35 + text-overflow: ellipsis;
  36 + white-space: nowrap;
  37 + }
  38 + }
29 } 39 }
30 } 40 }
31 41
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
30 <md-input-container class="md-block"> 30 <md-input-container class="md-block">
31 <label translate>user.email</label> 31 <label translate>user.email</label>
32 <input required name="email" 32 <input required name="email"
33 - ng-pattern='/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/' 33 + ng-pattern='/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\_\-0-9]+\.)+[a-zA-Z]{2,}))$/'
34 ng-model="user.email"> 34 ng-model="user.email">
35 <div ng-messages="theForm.email.$error"> 35 <div ng-messages="theForm.email.$error">
36 <div translate ng-message="required">user.email-required</div> 36 <div translate ng-message="required">user.email-required</div>