mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 09:01:03 -08:00
feat(xstream): clear selection and adjust layout
This commit is contained in:
1 parent
3f29aa1b0d
commit
312bc766a6
3 files changed
+24
-13
No files matched your search
@@ -13,21 +13,20 @@
|
||||
</div>
|
||||
|
||||
<div class="main-content">
|
||||
<div class="content-header">
|
||||
<h2>
|
||||
@if (xtreamStore.selectedItem()) {
|
||||
<button mat-icon-button (click)="historyBack()">
|
||||
<mat-icon>chevron_left</mat-icon>
|
||||
</button>
|
||||
} @else {
|
||||
@if (!xtreamStore.selectedItem()) {
|
||||
<div class="content-header">
|
||||
<h2>
|
||||
<button mat-icon-button disabled>
|
||||
<mat-icon>category</mat-icon>
|
||||
</button>
|
||||
}
|
||||
{{ getContentLabel() }}
|
||||
</h2>
|
||||
</div>
|
||||
<div class="scrollable-content">
|
||||
{{ getContentLabel() }}
|
||||
</h2>
|
||||
</div>
|
||||
}
|
||||
<div
|
||||
class="scrollable-content"
|
||||
[class.no-header]="xtreamStore.selectedItem()"
|
||||
>
|
||||
<router-outlet />
|
||||
</div>
|
||||
<!-- <app-mpv-player-bar /> -->
|
||||
|
||||
@@ -49,4 +49,9 @@
|
||||
.scrollable-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
|
||||
&.no-header {
|
||||
// When header is hidden, content starts from top
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,10 @@ export class XtreamMainContainerComponent implements OnInit {
|
||||
|
||||
categoryClicked(category: XtreamCategory) {
|
||||
const categoryId = (category as any).category_id ?? category.id;
|
||||
|
||||
// Clear any selected item when switching categories
|
||||
this.xtreamStore.setSelectedItem(null);
|
||||
|
||||
this.xtreamStore.setSelectedCategory(Number(categoryId));
|
||||
|
||||
this.router.navigate([categoryId], {
|
||||
@@ -58,7 +62,10 @@ export class XtreamMainContainerComponent implements OnInit {
|
||||
: 'Category Content';
|
||||
|
||||
// Show page number when viewing category content (not detail view)
|
||||
if (!this.xtreamStore.selectedItem() && this.xtreamStore.getTotalPages() > 1) {
|
||||
if (
|
||||
!this.xtreamStore.selectedItem() &&
|
||||
this.xtreamStore.getTotalPages() > 1
|
||||
) {
|
||||
const currentPage = this.xtreamStore.page() + 1; // +1 because page is 0-indexed
|
||||
const totalPages = this.xtreamStore.getTotalPages();
|
||||
const pageLabel = this.translateService.instant('PORTALS.PAGE');
|
||||
|
||||
Reference in new issue
Block a user