]> BookStack Code Mirror - bookstack/blobdiff - resources/js/services/dom.js
Added "page_include_parse" theme event
[bookstack] / resources / js / services / dom.js
index 00b34bf345767e034b9f7b8d6794083d228a6ed0..7a7b2c9bcfce6ce3ae0daf532a9d4be05f8229b7 100644 (file)
@@ -106,4 +106,15 @@ export function findText(selector, text) {
  */
 export function showLoading(element) {
     element.innerHTML = `<div class="loading-container"><div></div><div></div><div></div></div>`;
+}
+
+/**
+ * Remove any loading indicators within the given element.
+ * @param {Element} element
+ */
+export function removeLoading(element) {
+    const loadingEls = element.querySelectorAll('.loading-container');
+    for (const el of loadingEls) {
+        el.remove();
+    }
 }
\ No newline at end of file