1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-31 15:24:31 +03:00

Finished breakdown of attachment vue into components

This commit is contained in:
Dan Brown
2020-07-04 16:53:02 +01:00
parent 14b6cd1091
commit d41452f39c
24 changed files with 371 additions and 321 deletions

View File

@ -53,6 +53,14 @@ export function onEnterPress(elements, callback) {
if (!Array.isArray(elements)) {
elements = [elements];
}
const listener = event => {
if (event.key === 'Enter') {
callback(event);
}
}
elements.forEach(e => e.addEventListener('keypress', listener));
}
/**
@ -89,4 +97,13 @@ export function findText(selector, text) {
}
}
return null;
}
/**
* Show a loading indicator in the given element.
* This will effectively clear the element.
* @param {Element} element
*/
export function showLoading(element) {
element.innerHTML = `<div class="loading-container"><div></div><div></div><div></div></div>`;
}