master #50
|
@ -287,6 +287,7 @@ const flash = ({ type, msg }) => {
|
||||||
|
|
||||||
textfield.addEventListener("keyup", async e => {
|
textfield.addEventListener("keyup", async e => {
|
||||||
if(e.key === 'Enter') {
|
if(e.key === 'Enter') {
|
||||||
|
parent.removeChild(textfield);
|
||||||
// send
|
// send
|
||||||
let res = await fetch('/api/v2/admin/tags/' + encodeURIComponent(oldtag), {
|
let res = await fetch('/api/v2/admin/tags/' + encodeURIComponent(oldtag), {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
|
@ -303,7 +304,7 @@ const flash = ({ type, msg }) => {
|
||||||
switch(status) {
|
switch(status) {
|
||||||
case 200: // success, change
|
case 200: // success, change
|
||||||
case 201:
|
case 201:
|
||||||
parent.removeChild(textfield);
|
//parent.removeChild(textfield);
|
||||||
parent.insertAdjacentElement('afterbegin', old);
|
parent.insertAdjacentElement('afterbegin', old);
|
||||||
parent.querySelector('a:last-child').style.display = '';
|
parent.querySelector('a:last-child').style.display = '';
|
||||||
old.href = `/tag/${res.tag}`;
|
old.href = `/tag/${res.tag}`;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user