refactor latest-activity in progress
*added keyword info on url
This commit is contained in:
parent
b36622334a
commit
4aba8edf23
|
@ -117,6 +117,14 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
||||||
}
|
}
|
||||||
|
|
||||||
updateUrl() {
|
updateUrl() {
|
||||||
|
// let parameters = "" +
|
||||||
|
// (this.page != 1 ? "&page=" + this.page : "") +
|
||||||
|
// //TODO refactor
|
||||||
|
// // (((this.formGroup.get("order").value != this.order.UpdatedAt && !this.publicMode) || (this.formGroup.get("order").value != this.order.Published && this.publicMode)) ? "&order=" + this.formGroup.get("order").value : "") +
|
||||||
|
// (this.formGroup.get("like").value ? ("&keyword=" + this.formGroup.get("like").value) : "");
|
||||||
|
// this.location.go(this.router.url.split('?')[0] + parameters);
|
||||||
|
|
||||||
|
|
||||||
let parametersArray: string[] = [
|
let parametersArray: string[] = [
|
||||||
...(this.currentPage > 1 ? ["page=" + this.currentPage] : []),
|
...(this.currentPage > 1 ? ["page=" + this.currentPage] : []),
|
||||||
...(this.formGroup.get("like").value ? ["&keyword=" + this.formGroup.get("like").value] : [])
|
...(this.formGroup.get("like").value ? ["&keyword=" + this.formGroup.get("like").value] : [])
|
||||||
|
@ -148,7 +156,8 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
this.loadMore({ size: this.pageSize*this.currentPage, offset: 0 }, false);
|
const initItems = this.currentPage == 0;
|
||||||
|
this.loadMore({ size: initItems ? this.pageSize : this.pageSize*this.currentPage, offset: 0 }, initItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
loadMore(page?: Lookup.Paging, updatePage: boolean = true) {
|
loadMore(page?: Lookup.Paging, updatePage: boolean = true) {
|
||||||
|
@ -195,6 +204,7 @@ export class RecentEditedActivityComponent extends BaseComponent implements OnIn
|
||||||
})
|
})
|
||||||
|
|
||||||
if (updatePage && response.length > 0 && this.listingItems.length >= this.currentPage*this.pageSize) this._setPage(this.currentPage+1);
|
if (updatePage && response.length > 0 && this.listingItems.length >= this.currentPage*this.pageSize) this._setPage(this.currentPage+1);
|
||||||
|
else this.updateUrl();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue