mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2024-12-19 13:07:52 +00:00
Removing bugs
This commit is contained in:
parent
894b7904c3
commit
c951a405af
@ -36,8 +36,13 @@ export class TextAddingTool {
|
|||||||
document.body.style.cursor = "text";
|
document.body.style.cursor = "text";
|
||||||
|
|
||||||
this.temporaryElement.addEventListener("focusout", () => {
|
this.temporaryElement.addEventListener("focusout", () => {
|
||||||
let savedText = this.temporaryElement.innerText;
|
let innerText = this.temporaryElement.innerText;
|
||||||
this.addingFinished.emit(new TextAddedDataEvent(savedText, event.clientX, event.clientY));
|
let splittedText = innerText.split(/\r?\n/);
|
||||||
|
if (splittedText[splittedText[length-1]] === ""){
|
||||||
|
innerText.slice(0, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.addingFinished.emit(new TextAddedDataEvent(innerText, event.clientX, event.clientY));
|
||||||
|
|
||||||
this.drawingEventSource.textSaved.subscribe((evt:boolean) => {
|
this.drawingEventSource.textSaved.subscribe((evt:boolean) => {
|
||||||
if(evt){
|
if(evt){
|
||||||
|
@ -62,8 +62,13 @@ export class TextEditingTool {
|
|||||||
this.temporaryElement.innerText = elem.text;
|
this.temporaryElement.innerText = elem.text;
|
||||||
|
|
||||||
this.temporaryElement.addEventListener("focusout", () => {
|
this.temporaryElement.addEventListener("focusout", () => {
|
||||||
let savedText = this.temporaryElement.innerText;
|
let innerText = this.temporaryElement.innerText;
|
||||||
this.editingFinished.emit(new TextEditedDataEvent(this.editingDrawingId, savedText, this.editedElement));
|
let splittedText = innerText.split(/\r?\n/);
|
||||||
|
if (splittedText[splittedText[length-1]] === ""){
|
||||||
|
innerText.slice(0, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.editingFinished.emit(new TextEditedDataEvent(this.editingDrawingId, innerText, this.editedElement));
|
||||||
|
|
||||||
this.drawingEventSource.textSaved.subscribe((evt:boolean) => {
|
this.drawingEventSource.textSaved.subscribe((evt:boolean) => {
|
||||||
if(evt){
|
if(evt){
|
||||||
|
@ -16,13 +16,9 @@ a.table-link {
|
|||||||
color: white!important;
|
color: white!important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.temporaryElement{
|
|
||||||
margin-top: -10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@-moz-document url-prefix() {
|
@-moz-document url-prefix() {
|
||||||
.temporaryElement{
|
.temporaryElement{
|
||||||
margin-top: -11px;
|
line-height: 1.4em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user