Removing bugs

This commit is contained in:
Piotr Pekala 2018-12-13 05:34:17 -08:00
parent 894b7904c3
commit c951a405af
3 changed files with 15 additions and 9 deletions

View File

@ -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){

View File

@ -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){

View File

@ -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;
} }
} }