mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-02-20 17:52:46 +00:00
Cleanup
This commit is contained in:
parent
c466275e62
commit
72a0a8dfcb
@ -19,46 +19,6 @@ export class TextAddingComponent implements OnInit {
|
||||
}
|
||||
|
||||
addingTextSelected(){
|
||||
|
||||
|
||||
//let x = event.clientX - this.mapChild.context.getZeroZeroTransformationPoint().x;
|
||||
//let y = event.clientY - this.mapChild.context.getZeroZeroTransformationPoint().y;
|
||||
|
||||
const svgElement = select("g.canvas");
|
||||
svgElement
|
||||
.append("foreignObject")
|
||||
.attr("id", "temporaryText")
|
||||
.attr("transform", `translate(${x},${y}) rotate(0)`)
|
||||
.attr("width", '1000px')
|
||||
.append("xhtml:div")
|
||||
.attr("class", "temporaryTextInside")
|
||||
.attr('style', () => {
|
||||
const styles: string[] = [];
|
||||
styles.push(`font-family: Noto Sans`)
|
||||
styles.push(`font-size: 11pt`);
|
||||
styles.push(`font-weight: bold`)
|
||||
styles.push(`color: #000000`);
|
||||
return styles.join("; ");
|
||||
})
|
||||
.attr("width", 'fit-content')
|
||||
.attr("height", 'max-content')
|
||||
.attr('contenteditable', 'true')
|
||||
.text("")
|
||||
.on("focusout", () => {
|
||||
let elem = document.getElementsByClassName("temporaryTextInside")[0] as HTMLElement;
|
||||
let savedText = elem.innerText;
|
||||
|
||||
// let drawing = this.getDrawingMock("text", savedText);
|
||||
// (drawing.element as TextElement).text = savedText;
|
||||
// let svgText = this.mapDrawingToSvgConverter.convert(drawing);
|
||||
|
||||
// this.drawingService
|
||||
// .add(this.server, this.project.project_id, x, y, svgText)
|
||||
// .subscribe((serverDrawing: Drawing) => {
|
||||
// var temporaryElement = document.getElementById("temporaryText") as HTMLElement;
|
||||
// temporaryElement.remove();
|
||||
// this.drawingsDataSource.add(serverDrawing);
|
||||
// });
|
||||
});
|
||||
//here will be moved addText in projectMapComponent
|
||||
}
|
||||
}
|
||||
|
@ -354,8 +354,6 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
public onTextEdited(evt: TextEditedDataEvent){
|
||||
//<svg height=\"100\" width=\"100\"><text fill=\"#000000\" fill-opacity=\"0\" font-family=\"Noto Sans\" font-size=\"11\" font-weight=\"bold\">this is one another text\nto save\n</text></svg>
|
||||
//let splittedText = evt.editedText.split(/\r?\n/);
|
||||
let mapDrawing: MapDrawing = new MapDrawing();
|
||||
mapDrawing.element = evt.textElement;
|
||||
(mapDrawing.element as TextElement).text = evt.editedText;
|
||||
|
Loading…
x
Reference in New Issue
Block a user