mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Fixed editing with special characters
This commit is contained in:
parent
83e3157ad1
commit
977385a700
1
dev/releases/branch.yml
Normal file
1
dev/releases/branch.yml
Normal file
@ -0,0 +1 @@
|
||||
- "[Feature] Can now edit track titles and artist names from web interface"
|
@ -37,15 +37,15 @@ function editEntity() {
|
||||
// cancel on esc
|
||||
else if (e.key === "Escape" || e.key === "Esc") {
|
||||
e.preventDefault();
|
||||
namefield.innerHTML = entity_name;
|
||||
namefield.textContent = entity_name;
|
||||
namefield.blur();
|
||||
}
|
||||
|
||||
})
|
||||
// emergency, not pretty because it will move cursor
|
||||
namefield.addEventListener('input',function(e){
|
||||
if (namefield.innerHTML.includes("\n")) {
|
||||
namefield.innerHTML = namefield.innerHTML.replace("\n","");
|
||||
if (namefield.textContent.includes("\n")) {
|
||||
namefield.textContent = namefield.textContent.replace("\n","");
|
||||
}
|
||||
|
||||
})
|
||||
@ -63,7 +63,7 @@ function editEntity() {
|
||||
function doneEditing() {
|
||||
var namefield = document.getElementById('main_entity_name');
|
||||
namefield.contentEditable = "false";
|
||||
newname = namefield.innerHTML;
|
||||
newname = namefield.textContent;
|
||||
|
||||
if (newname != entity_name) {
|
||||
var searchParams = new URLSearchParams(window.location.search);
|
||||
|
Loading…
Reference in New Issue
Block a user