Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 702ef14

Browse files
committed
gh-582 Polish CSS styles
1 parent 2fc702d commit 702ef14

File tree

5 files changed

+47
-15
lines changed

5 files changed

+47
-15
lines changed

ui/src/app/app.component.ts

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@ import { Component, DoCheck } from '@angular/core';
22
import { ToastyConfig } from 'ng2-toasty';
33
import { AuthService } from './auth/auth.service';
44
import { SecurityInfo } from './auth/model/security-info.model';
5+
import { Renderer2 } from '@angular/core';
6+
import { OnInit } from '@angular/core';
57

68
@Component({
79
selector: 'app-root',
810
templateUrl: './app.component.html',
911
})
10-
export class AppComponent implements DoCheck {
12+
export class AppComponent implements DoCheck, OnInit {
1113

1214
public securityInfo: SecurityInfo;
1315
public isCollapsed = true;
1416

15-
constructor(private toastyConfig: ToastyConfig, private authService: AuthService) {
17+
constructor(private toastyConfig: ToastyConfig,
18+
private renderer: Renderer2,
19+
private authService: AuthService) {
1620
this.toastyConfig.theme = 'bootstrap';
1721
this.toastyConfig.limit = 5;
1822
this.toastyConfig.showClose = true;
@@ -26,6 +30,34 @@ export class AppComponent implements DoCheck {
2630
this.securityInfo = this.authService.securityInfo;
2731
}
2832

33+
ngOnInit() {
34+
this.renderer.listen('document', 'scroll', (evt) => {
35+
this.updateToasty();
36+
});
37+
this.renderer.listen('document', 'resize', (evt) => {
38+
this.updateToasty();
39+
});
40+
this.updateToasty();
41+
}
42+
43+
private updateToasty() {
44+
const bodyScrollTop = window.pageYOffset || document.documentElement.scrollTop;
45+
const navHeight = document.getElementsByTagName('nav')[0].offsetHeight;
46+
let marginToParent = 10;
47+
const toastyElement = document.getElementById('toasty');
48+
49+
if (window.outerWidth <= 768) {
50+
marginToParent = 0;
51+
}
52+
53+
if (bodyScrollTop > navHeight) {
54+
toastyElement.style.top = marginToParent + 'px';
55+
} else if (bodyScrollTop >= 0) {
56+
const distance = navHeight - bodyScrollTop;
57+
toastyElement.style.top = distance + marginToParent + 'px';
58+
}
59+
}
60+
2961
public toggleCollapse(): void {
3062
this.isCollapsed = !this.isCollapsed;
3163
}

ui/src/app/apps/apps.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ <h1 [ngBusy]="busy">Apps</h1>
44
</p>
55

66
<div class="row">
7-
<div class="col-md-18">
7+
<div class="col-xs-10 col-md-18">
88
<button id="registerApplicationButton" type="button" (click)="registerApps()"
99
class="btn btn-default" [appRoles]="['ROLE_CREATE']"
1010
><span class="glyphicon glyphicon-plus"></span>
@@ -26,9 +26,9 @@ <h1 [ngBusy]="busy">Apps</h1>
2626
<span class="hidden-xs">Bulk Import Applications</span>
2727
</button>
2828
</div>
29-
<div class="col-md-6 text-right">
29+
<div class="col-xs-14 col-md-6 text-right">
3030
<label *ngIf="appRegistrations" class="control">
31-
<input type="text" class="input" placeholder="Filter items" [(ngModel)]="appRegistrations.filter" >
31+
<input type="text" class="input filter-input" placeholder="Filter items" [(ngModel)]="appRegistrations.filter" >
3232
</label>
3333
<button id="refreshAppRegistrationsButton" type="button" (click)="loadAppRegistrations(true)"
3434
class="btn btn-default"

ui/src/app/streams/stream-definitions/stream-definitions.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</div>
1515
</div>
1616
<div class="row">
17-
<div class="col-md-19 col-actions">
17+
<div class="col-xs-10 col-md-19 col-actions">
1818
<app-tri-state-button *ngIf="streamDefinitions?.items" class="toggle-all" [appRoles]="['ROLE_CREATE']"
1919
[items]="streamDefinitions.getItemsAsObservable()"
2020
(eventHandler)="deployMultipleStreamDefinitions(streamDefinitions.items)"
@@ -47,9 +47,9 @@
4747
icon="remove"
4848
></app-tri-state-button>
4949
</div>
50-
<div class="col-md-5 text-right" style="padding-left: 0;">
50+
<div class="col-xs-14 col-md-5 text-right" style="padding-left: 0;">
5151
<label *ngIf="streamDefinitions" class="control">
52-
<input type="text" class="input" placeholder="Filter definitions" [(ngModel)]="streamDefinitions.filter">
52+
<input type="text" class="input filter-input" placeholder="Filter definitions" [(ngModel)]="streamDefinitions.filter">
5353
</label>
5454
<button *ngIf="streamDefinitions" type="button" (click)="loadStreamDefinitions()"
5555
class="btn btn-default">

ui/src/app/tasks/task-definitions/task-definitions.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11

22
<ng-template [ngBusy]="{busy: busy, wrapperClass: 'ng-busy ng-busy-no-margin', minDuration: 2000}"></ng-template>
33
<div class="row">
4-
<div class="col-md-19">
4+
<div class="col-xs-8">
55
<button type="button" [appRoles]="['ROLE_CREATE']" (click)="bulkDefineTasks()"
66
class="btn btn-default">
77
<span class="glyphicon glyphicon-import"></span>
88
<span class="hidden-xs">Bulk Define Tasks</span>
99
</button>
1010
</div>
11-
<div class="col-md-5 text-right" style="padding-left: 0;">
11+
<div class="col-xs-16 text-right" style="padding-left: 0;">
1212
<label *ngIf="taskDefinitions" class="control">
13-
<input type="text" class="input" placeholder="Filter definitions" [(ngModel)]="taskDefinitions.filter">
13+
<input type="text" class="input filter-input" placeholder="Filter definitions" [(ngModel)]="taskDefinitions.filter">
1414
</label>
1515
<button *ngIf="taskDefinitions" type="button" (click)="loadTaskDefinitions()"
1616
class="btn btn-default">

ui/src/styles.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,6 @@ body {
100100
margin-right: 2px;
101101
}
102102

103-
#toasty {
104-
top: unset !important;
105-
}
106-
107103
.navbar {
108104

109105
.container {
@@ -153,6 +149,10 @@ body {
153149
.form-control-feedback {
154150
top: 5px;
155151
}
152+
153+
.filter-input {
154+
max-width: 125px;
155+
}
156156
// ~~~~ responsive
157157

158158
@media (max-width: 768px) {

0 commit comments

Comments
 (0)