fix loading state excluding other state during the loading (#1991)

This commit is contained in:
Eugenio Romano
2017-06-20 18:51:21 +01:00
committed by Eugenio Romano
parent 201741aeee
commit 0669575cb8

View File

@@ -29,6 +29,7 @@
</thead> </thead>
<tbody> <tbody>
<ng-container *ngIf="!loading">
<tr *ngFor="let row of data.getRows(); let idx = index" tabindex="0" <tr *ngFor="let row of data.getRows(); let idx = index" tabindex="0"
class="alfresco-datatable__row" class="alfresco-datatable__row"
[class.alfresco-datatable__row--selected]="row.isSelected" [class.alfresco-datatable__row--selected]="row.isSelected"
@@ -53,38 +54,39 @@
</ul> </ul>
</td> </td>
<td *ngIf="multiselect"> <td *ngIf="multiselect">
<md-checkbox [(ngModel)]="row.isSelected"></md-checkbox> <md-checkbox [(ngModel)]="row.isSelected"></md-checkbox>
</td> </td>
<td *ngFor="let col of data.getColumns()" <td *ngFor="let col of data.getColumns()"
class="mdl-data-table__cell--non-numeric non-selectable data-cell {{col.cssClass}}" class="mdl-data-table__cell--non-numeric non-selectable data-cell {{col.cssClass}}"
(click)="onRowClick(row, $event)" (click)="onRowClick(row, $event)"
[context-menu]="getContextMenuActions(row, col)" [context-menu]="getContextMenuActions(row, col)"
[context-menu-enabled]="contextMenu"> [context-menu-enabled]="contextMenu">
<div *ngIf="!col.template" class="cell-container"> <div *ngIf="!col.template" class="cell-container">
<ng-container [ngSwitch]="col.type"> <ng-container [ngSwitch]="col.type">
<div *ngSwitchCase="'image'" class="cell-value"> <div *ngSwitchCase="'image'" class="cell-value">
<i *ngIf="isIconValue(row, col)" class="material-icons icon-cell">{{asIconValue(row, col)}}</i> <i *ngIf="isIconValue(row, col)" class="material-icons icon-cell">{{asIconValue(row,
<img *ngIf="!isIconValue(row, col)" col)}}</i>
class="image-cell" <img *ngIf="!isIconValue(row, col)"
alt="{{ iconAltTextKey(data.getValue(row, col)) | translate }}" class="image-cell"
src="{{ data.getValue(row, col) }}" alt="{{ iconAltTextKey(data.getValue(row, col)) | translate }}"
(error)="onImageLoadingError($event)"> src="{{ data.getValue(row, col) }}"
</div> (error)="onImageLoadingError($event)">
<div *ngSwitchCase="'icon'" class="cell-value"> </div>
<img class="image-cell" <div *ngSwitchCase="'icon'" class="cell-value">
alt="{{ iconAltTextKey(data.getValue(row, col)) | translate }}" <img class="image-cell"
src="{{ data.getValue(row, col) }}" alt="{{ iconAltTextKey(data.getValue(row, col)) | translate }}"
(error)="onImageLoadingError($event)"> src="{{ data.getValue(row, col) }}"
</div> (error)="onImageLoadingError($event)">
<div *ngSwitchCase="'date'" class="cell-value" </div>
[attr.data-automation-id]="'date_' + data.getValue(row, col)"> <div *ngSwitchCase="'date'" class="cell-value"
<alfresco-datatable-cell [data]="data" [column]="col" [row]="row"></alfresco-datatable-cell> [attr.data-automation-id]="'date_' + data.getValue(row, col)">
</div> <alfresco-datatable-cell [data]="data" [column]="col" [row]="row"></alfresco-datatable-cell>
<div *ngSwitchCase="'text'" class="cell-value" </div>
[attr.data-automation-id]="'text_' + data.getValue(row, col)"> <div *ngSwitchCase="'text'" class="cell-value"
<alfresco-datatable-cell [data]="data" [column]="col" [row]="row"></alfresco-datatable-cell> [attr.data-automation-id]="'text_' + data.getValue(row, col)">
</div> <alfresco-datatable-cell [data]="data" [column]="col" [row]="row"></alfresco-datatable-cell>
</div>
<span *ngSwitchDefault class="cell-value"> <span *ngSwitchDefault class="cell-value">
<!-- empty cell for unknown column type --> <!-- empty cell for unknown column type -->
</span> </span>
@@ -125,6 +127,7 @@
</ng-template> </ng-template>
</td> </td>
</tr> </tr>
</ng-container>
<tr *ngIf="loading"> <tr *ngIf="loading">
<td class="mdl-data-table__cell--non-numeric adf-loading-content-container" <td class="mdl-data-table__cell--non-numeric adf-loading-content-container"
[attr.colspan]="1 + data.getColumns().length"> [attr.colspan]="1 + data.getColumns().length">