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:
Bobby Wibowo 2018-07-14 11:35:31 +07:00
parent bdee00e1a4
commit 5e765f4935
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
3 changed files with 10 additions and 8 deletions

View File

@ -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')
}

View File

@ -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'
}
}

View File

@ -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" %}