Skip to content

Commit

Permalink
Merge pull request #452 from IgniteUI/dTsvetkov/fix-3196
Browse files Browse the repository at this point in the history
Fix right side affix for mobile devices
  • Loading branch information
hanastasov authored Jan 17, 2024
2 parents d18e22b + 103a328 commit ec24e44
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/app/services/rendering/affix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export class AffixRenderingService extends RenderingService implements Resizable

public reset() {
this.initialDimension = document.body.clientHeight - (util.offset + util.getFilterHeight());
this.showHideAffix();
}

public handleChange(changeType: DimensionChangeType, newValue: number) {
Expand All @@ -22,13 +23,12 @@ export class AffixRenderingService extends RenderingService implements Resizable
}

public render() {
this.renderAffix();
this.renderAffix();
}

//Setup Affix
private renderAffix() {
let hierarchy = this.getHierarchy();

if (hierarchy.length > 0) {
let html = util.formList(hierarchy, "nav", "bs-docs-sidenav")!;
$("#affix").empty().append(html);
Expand All @@ -44,6 +44,7 @@ export class AffixRenderingService extends RenderingService implements Resizable
} else {
$("#affix").empty();
}
this.showHideAffix();
}

//Get the hierarchy of the article based on headers power
Expand Down Expand Up @@ -104,4 +105,7 @@ export class AffixRenderingService extends RenderingService implements Resizable
return hierarchy;
}

private showHideAffix() {
$(".docfx-affix").css('display', window.innerWidth <= 1200 ? 'none' : 'block');
}
}

0 comments on commit ec24e44

Please sign in to comment.