mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-04-18 23:36:53 +00:00
Solution ready for topology summary widget
This commit is contained in:
parent
cb71af1ea3
commit
3e8c21082b
@ -3,7 +3,7 @@
|
||||
(document:mousemove)="dragWidget($event)"
|
||||
(document:mouseup)="toggleDragging(false)">
|
||||
</div>
|
||||
<div
|
||||
<div
|
||||
class="summaryWrapper"
|
||||
(mousedown)="toggleDragging(true)"
|
||||
*ngIf="projectsStatistics"
|
||||
|
@ -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,21 +78,28 @@ 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;
|
||||
|
||||
this.style = {
|
||||
position: 'fixed',
|
||||
left: `${left}px`,
|
||||
top: `${top}px`,
|
||||
width: `${width}px`,
|
||||
height: `${height}px`
|
||||
};
|
||||
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`,
|
||||
top: `${top}px`,
|
||||
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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user