Added search bar to header.
This commit is contained in:
14
js/main.js
14
js/main.js
@@ -148,10 +148,22 @@ document.addEventListener("DOMContentLoaded", function() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set placeholder for all input element of type="search".
|
||||
*/
|
||||
(function() {
|
||||
let toTranslate = document.getElementsByTagName("input");
|
||||
for (let i = 0, max = toTranslate.length; i < max; i++) {
|
||||
console.log(toTranslate[i].type);
|
||||
if (toTranslate[i].type !== "search") continue;
|
||||
toTranslate[i].placeholder = getTranslation(translations, "Search");
|
||||
}
|
||||
})();
|
||||
|
||||
(function() {
|
||||
let toTranslate = document.getElementsByClassName("toTranslate");
|
||||
for (let i = 0, max = toTranslate.length; i < max; i++) {
|
||||
console.log(toTranslate[i].getAttribute("data-content"));
|
||||
if (debugging === true) console.log(toTranslate[i].getAttribute("data-content"));
|
||||
toTranslate[i].textContent = getTranslation(translations, toTranslate[i].getAttribute("data-content"));
|
||||
}
|
||||
})();
|
||||
|
Reference in New Issue
Block a user