Add wrap figures

This commit is contained in:
2020-12-13 22:27:03 +01:00
parent 0c43e074e3
commit f3c73d38b0
10 changed files with 447 additions and 170 deletions

View File

@@ -62,6 +62,19 @@ docReady(function() {
}
});
// Wrap Images and Tables
docReady(function() {
let wrap_elements = document.querySelectorAll('[float=wrap-right]')
for (let wrap_el of wrap_elements) {
wrap_el.closest('.figure').classList.add('wrap-right')
}
wrap_elements = document.querySelectorAll('[float=wrap-left]')
for (let wrap_el of wrap_elements) {
wrap_el.closest('.figure').classList.add('wrap-left')
}
});
// Equivalent of Jquery $.ready
function docReady(fn) {
// see if DOM is already available