Fix scrolling in Jobs view page (#1346)

* resize when window resized

* fix scrolling issues
This commit is contained in:
Aditya Bist
2018-05-03 21:39:22 -07:00
committed by Karl Burtram
parent 1847c2e322
commit 03989a5af0
2 changed files with 15 additions and 5 deletions

View File

@@ -32,7 +32,7 @@ jobhistory-component {
} }
#jobsDiv .jobview-grid { #jobsDiv .jobview-grid {
height: 96%; height: 94.7%;
width : 100%; width : 100%;
display: block; display: block;
} }

View File

@@ -74,6 +74,7 @@ export class JobsViewComponent implements AfterContentChecked {
private _serverName: string; private _serverName: string;
private _isCloud: boolean; private _isCloud: boolean;
private _showProgressWheel: boolean; private _showProgressWheel: boolean;
private _tabHeight: number;
constructor( constructor(
@Inject(BOOTSTRAP_SERVICE_ID) private bootstrapService: IBootstrapService, @Inject(BOOTSTRAP_SERVICE_ID) private bootstrapService: IBootstrapService,
@@ -202,9 +203,8 @@ export class JobsViewComponent implements AfterContentChecked {
this.dataView.beginUpdate(); this.dataView.beginUpdate();
this.dataView.setItems(jobViews); this.dataView.setItems(jobViews);
this.dataView.endUpdate(); this.dataView.endUpdate();
this._table.resizeCanvas();
this._table.autosizeColumns(); this._table.autosizeColumns();
this._table.resizeCanvas();
let expandedJobs = this._agentViewComponent.expanded; let expandedJobs = this._agentViewComponent.expanded;
let expansions = 0; let expansions = 0;
for (let i = 0; i < jobs.length; i++){ for (let i = 0; i < jobs.length; i++){
@@ -226,8 +226,18 @@ export class JobsViewComponent implements AfterContentChecked {
}); });
this._showProgressWheel = false; this._showProgressWheel = false;
this._cd.detectChanges(); this._cd.detectChanges();
$(window).resize(() => { const self = this;
this._table.resizeCanvas(); this._tabHeight = $('agentview-component #jobsDiv .jobview-grid').get(0).clientHeight;
$(window).resize((e) => {
let currentTabHeight = $('agentview-component #jobsDiv .jobview-grid').get(0).clientHeight;
if (currentTabHeight < self._tabHeight) {
$('agentview-component #jobsDiv div.ui-widget').css('height', `${currentTabHeight-22}px`);
self._table.resizeCanvas();
} else {
$('agentview-component #jobsDiv div.ui-widget').css('height', `${currentTabHeight}px`);
self._table.resizeCanvas();
}
self._tabHeight = currentTabHeight;
}); });
this.loadJobHistories(); this.loadJobHistories();
} }