mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-20 23:55:04 +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.computes = computes;
|
||||||
});
|
});
|
||||||
|
|
||||||
this.style = { top: '20px', right: '20px'};
|
this.style = { top: '20px', right: '20px', width: '300px', height: '400px'};
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleDragging(value: boolean) {
|
toggleDragging(value: boolean) {
|
||||||
@ -78,21 +78,28 @@ export class TopologySummaryComponent implements OnInit, OnDestroy {
|
|||||||
let x: number = Number(event.movementX);
|
let x: number = Number(event.movementX);
|
||||||
let y: number = Number(event.movementY);
|
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 width: number = Number(this.style['width'].split('px')[0]);
|
||||||
let height: number = Number(this.style['height'].split('px')[0]);
|
let height: number = Number(this.style['height'].split('px')[0]);
|
||||||
|
let top: number = Number(this.style['top'].split('px')[0]) + y;
|
||||||
top = top + y;
|
if (this.style['left']) {
|
||||||
left = left + x;
|
let left: number = Number(this.style['left'].split('px')[0]) + x;
|
||||||
|
this.style = {
|
||||||
this.style = {
|
position: 'fixed',
|
||||||
position: 'fixed',
|
left: `${left}px`,
|
||||||
left: `${left}px`,
|
top: `${top}px`,
|
||||||
top: `${top}px`,
|
width: `${width}px`,
|
||||||
width: `${width}px`,
|
height: `${height}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 {
|
validate(event: ResizeEvent): boolean {
|
||||||
|
Reference in New Issue
Block a user