Skip to content

Commit

Permalink
fix: Change order of call methods on click in list row
Browse files Browse the repository at this point in the history
  • Loading branch information
EndyKaufman committed Mar 7, 2019
1 parent 306a4ad commit cd274bf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
Expand Up @@ -31,7 +31,7 @@
let-ctx>
<ion-item-option
color="primary"
(click)="ctx.slidingItem.close();onUpdate(ctx.item)"
(click)="onUpdate(ctx.item);ctx.slidingItem.close();"
*ngIf="(notReadonlyAndEnableUpdate$ | async) && updateLink===undefined">
<ion-icon
slot="icon-only"
Expand All @@ -50,7 +50,7 @@
</ion-item-option>
<ion-item-option
color="danger"
(click)="ctx.slidingItem.close();onDelete(ctx.item)"
(click)="onDelete(ctx.item);ctx.slidingItem.close();"
*ngIf="(notReadonlyAndEnableDelete$ | async) && deleteLink===undefined">
<ion-icon
slot="icon-only"
Expand All @@ -74,7 +74,7 @@
<ion-item-sliding #slidingItem>
<ion-item
detail
(click)="slidingItem.close();onView(ctx.item)"
(click)="onView(ctx.item);slidingItem.close();"
class="activated"
*ngIf="viewLink===undefined">
<ng-container *ngTemplateOutlet="(itemLabelTemplate?itemLabelTemplate:defaultItemLabelTemplate), context: {$implicit: ctx}"></ng-container>
Expand Down
Expand Up @@ -318,7 +318,12 @@ export class EntityListComponent<TModel extends IModel> implements OnChanges {
}
if (event.target && event.target.complete) {
if (this.paginationMeta.totalResults > this.items.length) {
setTimeout(() => event.target.complete(), 700);
setTimeout(
() =>
event.target.complete()
,
700
);
this.nextPage.emit(true);
} else {
event.target.complete();
Expand All @@ -338,10 +343,10 @@ export class EntityListComponent<TModel extends IModel> implements OnChanges {
if (isDevMode() && this.delete.observers.length === 0) {
console.warn('No subscribers found for "delete"', this.parent);
}
this.delete.emit(item);
if (callback) {
setTimeout(() => callback());
setTimeout(() => callback(), 700);
}
this.delete.emit(item);
}
onUpdate(item: TModel, callback?: () => void) {
if (isDevMode() && !this.notReadonlyAndEnableUpdate) {
Expand All @@ -350,10 +355,10 @@ export class EntityListComponent<TModel extends IModel> implements OnChanges {
if (isDevMode() && this.update.observers.length === 0) {
console.warn('No subscribers found for "update"', this.parent);
}
this.update.emit(item);
if (callback) {
setTimeout(() => callback(), 1000);
setTimeout(() => callback(), 700);
}
this.update.emit(item);
}
onCreate() {
if (isDevMode() && !this.notReadonlyAndEnableCreate) {
Expand All @@ -368,10 +373,10 @@ export class EntityListComponent<TModel extends IModel> implements OnChanges {
if (isDevMode() && this.view.observers.length === 0) {
console.warn('No subscribers found for "view"', this.parent);
}
this.view.emit(item);
if (callback) {
setTimeout(() => callback(), 1000);
setTimeout(() => callback(), 700);
}
this.view.emit(item);
}
onDblClick(item: TModel) {
if (this.dblClick.observers.length > 0) {
Expand Down

0 comments on commit cd274bf

Please sign in to comment.