collect text and icon elements
This commit is contained in:
parent
ee8cc4d0a2
commit
b7bbbeb486
1 changed files with 14 additions and 8 deletions
|
@ -86,9 +86,9 @@ export default class windowman {
|
||||||
}
|
}
|
||||||
|
|
||||||
function icons() {
|
function icons() {
|
||||||
let target_elements = document.querySelectorAll(`[data-icon]`);
|
let TARGET_ELEMENTS = document.querySelectorAll(`[data-icon]`);
|
||||||
|
|
||||||
target_elements.forEach((element) => {
|
(TARGET_ELEMENTS).forEach((element) => {
|
||||||
// Get the content before removing it.
|
// Get the content before removing it.
|
||||||
let element_data = {};
|
let element_data = {};
|
||||||
|
|
||||||
|
@ -122,6 +122,8 @@ export default class windowman {
|
||||||
iconify();
|
iconify();
|
||||||
clean();
|
clean();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return TARGET_ELEMENTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
function text() {
|
function text() {
|
||||||
|
@ -151,9 +153,8 @@ export default class windowman {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
delete text_elements[`content`];
|
|
||||||
Object.keys(text_elements).forEach((key) => {
|
Object.keys(text_elements).forEach((key) => {
|
||||||
if (text_elements[key]) {
|
if (text_elements[key] && !key.includes(`content`)) {
|
||||||
text_elements[key].forEach((text_element) => {
|
text_elements[key].forEach((text_element) => {
|
||||||
let text_inserted = texts.localized(
|
let text_inserted = texts.localized(
|
||||||
text_element.getAttribute(key.concat(`-for`)),
|
text_element.getAttribute(key.concat(`-for`)),
|
||||||
|
@ -175,11 +176,16 @@ export default class windowman {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
|
return text_elements;
|
||||||
|
};
|
||||||
|
|
||||||
|
let ELEMENTS = {};
|
||||||
elements();
|
elements();
|
||||||
text();
|
ELEMENTS[`text`] = text();
|
||||||
icons();
|
ELEMENTS[`icons`] = icons();
|
||||||
|
|
||||||
|
return (ELEMENTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adds events to the window.
|
// Adds events to the window.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue