Browse Source

fix js error on the personal settings page (undefined sortable)

develop
Simon Vieille 2 weeks ago
parent
commit
1b0418a466
  1. 17
      src/admin.js

17
src/admin.js

@ -191,13 +191,16 @@ document.addEventListener('DOMContentLoaded', () => {
placeholderClass: 'side-menu-setting-list-drop'
})
sortable('#categories-list .side-menu-setting-list')[0].addEventListener('sortstop', (e) => {
let value = []
try {
sortable('#categories-list .side-menu-setting-list')[0].addEventListener('sortstop', (e) => {
let value = []
for (let item of document.querySelectorAll('#categories-list .side-menu-setting-list-item')) {
value.push(item.getAttribute('data-id'))
}
for (let item of document.querySelectorAll('#categories-list .side-menu-setting-list-item')) {
value.push(item.getAttribute('data-id'))
}
document.querySelector('input[name="categories-order"]').value = JSON.stringify(value)
})
document.querySelector('input[name="categories-order"]').value = JSON.stringify(value)
})
} catch (e) {
}
})

Loading…
Cancel
Save