mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-13 16:06:21 +00:00
Updated home.js and dashboard.js
Use for-i-loop instead of for-of-loop on various places (I may have missed some spots though).
This commit is contained in:
parent
bdee00e1a4
commit
5e765f4935
@ -1337,7 +1337,9 @@ page.sendNewPassword = function (pass, element) {
|
||||
page.setActiveMenu = function (activeItem) {
|
||||
var menu = document.getElementById('menu')
|
||||
var items = menu.getElementsByTagName('a')
|
||||
for (var item of items) { item.classList.remove('is-active') }
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
items[i].classList.remove('is-active')
|
||||
}
|
||||
|
||||
activeItem.classList.add('is-active')
|
||||
}
|
||||
|
@ -121,8 +121,8 @@ page.prepareUpload = function () {
|
||||
if (tabs) {
|
||||
tabs.style.display = 'flex'
|
||||
var items = tabs.getElementsByTagName('li')
|
||||
for (var item of items) {
|
||||
item.addEventListener('click', function () {
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
items[i].addEventListener('click', function () {
|
||||
page.setActiveTab(this.dataset.id)
|
||||
})
|
||||
}
|
||||
@ -171,13 +171,13 @@ page.prepareAlbums = function () {
|
||||
|
||||
page.setActiveTab = function (activeId) {
|
||||
var items = document.getElementById('tabs').getElementsByTagName('li')
|
||||
for (var item of items) {
|
||||
var tabId = item.dataset.id
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
var tabId = items[i].dataset.id
|
||||
if (tabId === activeId) {
|
||||
item.classList.add('is-active')
|
||||
items[i].classList.add('is-active')
|
||||
document.getElementById(tabId).style.display = 'block'
|
||||
} else {
|
||||
item.classList.remove('is-active')
|
||||
items[i].classList.remove('is-active')
|
||||
document.getElementById(tabId).style.display = 'none'
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
v2: Images and config files (manifest.json, browserconfig.xml, etc).
|
||||
v3: CSS and JS files (libs such as bulma, lazyload, etc).
|
||||
#}
|
||||
{% set v1 = "BvoZYURztW" %}
|
||||
{% set v1 = "Xo8dt9SFWE" %}
|
||||
{% set v2 = "Ii3JYKIhb0" %}
|
||||
{% set v3 = "HrvcYD3KTh" %}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user