mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-20 15:40:29 +00:00
Solution ready for topology summary widget
This commit is contained in:
@ -67,7 +67,7 @@ export class TopologySummaryComponent implements OnInit, OnDestroy {
|
||||
this.computes = computes;
|
||||
});
|
||||
|
||||
this.style = { top: '20px', right: '20px'};
|
||||
this.style = { top: '20px', right: '20px', width: '300px', height: '400px'};
|
||||
}
|
||||
|
||||
toggleDragging(value: boolean) {
|
||||
@ -78,14 +78,11 @@ export class TopologySummaryComponent implements OnInit, OnDestroy {
|
||||
let x: number = Number(event.movementX);
|
||||
let y: number = Number(event.movementY);
|
||||
|
||||
let left: number = Number(this.style['left'].split('px')[0]);
|
||||
let top: number = Number(this.style['top'].split('px')[0]);
|
||||
let width: number = Number(this.style['width'].split('px')[0]);
|
||||
let height: number = Number(this.style['height'].split('px')[0]);
|
||||
|
||||
top = top + y;
|
||||
left = left + x;
|
||||
|
||||
let top: number = Number(this.style['top'].split('px')[0]) + y;
|
||||
if (this.style['left']) {
|
||||
let left: number = Number(this.style['left'].split('px')[0]) + x;
|
||||
this.style = {
|
||||
position: 'fixed',
|
||||
left: `${left}px`,
|
||||
@ -93,6 +90,16 @@ export class TopologySummaryComponent implements OnInit, OnDestroy {
|
||||
width: `${width}px`,
|
||||
height: `${height}px`
|
||||
};
|
||||
} else {
|
||||
let right: number = Number(this.style['right'].split('px')[0]) - x;
|
||||
this.style = {
|
||||
position: 'fixed',
|
||||
right: `${right}px`,
|
||||
top: `${top}px`,
|
||||
width: `${width}px`,
|
||||
height: `${height}px`
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
validate(event: ResizeEvent): boolean {
|
||||
|
Reference in New Issue
Block a user