Better support for notes permalink
This commit is contained in:
parent
b725eb047d
commit
301c7ab1a0
16 changed files with 49 additions and 29 deletions
assets/default/js
|
@ -26,11 +26,15 @@ function findParent(element, tagName, attributes) {
|
|||
* Ajax request to refresh the CSRF token.
|
||||
*/
|
||||
function refreshToken(basePath) {
|
||||
console.log('refresh');
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', `${basePath}/admin/token`);
|
||||
xhr.onload = () => {
|
||||
const token = document.getElementById('token');
|
||||
token.setAttribute('value', xhr.responseText);
|
||||
const elements = document.querySelectorAll('input[name="token"]');
|
||||
[...elements].forEach((element) => {
|
||||
console.log(element);
|
||||
element.setAttribute('value', xhr.responseText);
|
||||
});
|
||||
};
|
||||
xhr.send();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue