Made slimSidebar move toast position as well
This commit is contained in:
parent
01204b71fb
commit
362d1a1368
File diff suppressed because one or more lines are too long
@ -724,6 +724,10 @@ export default {
|
|||||||
set(wantSlimSidebar) {
|
set(wantSlimSidebar) {
|
||||||
this.slimSidebar = wantSlimSidebar
|
this.slimSidebar = wantSlimSidebar
|
||||||
document.getElementById('sidebar').classList.toggle('slim', wantSlimSidebar)
|
document.getElementById('sidebar').classList.toggle('slim', wantSlimSidebar)
|
||||||
|
// Moves all toast messages when the option changes
|
||||||
|
Array.from(document.getElementsByClassName('toastify')).forEach((toast)=>{
|
||||||
|
toast.style.transform = `translate(${wantSlimSidebar ? '3rem' : '14rem'}, 0)`;
|
||||||
|
})
|
||||||
localStorage.setItem('slimSidebar', wantSlimSidebar)
|
localStorage.setItem('slimSidebar', wantSlimSidebar)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -6,10 +6,7 @@ import { socket } from '@/utils/socket'
|
|||||||
|
|
||||||
const sharedOptions = {
|
const sharedOptions = {
|
||||||
gravity: 'bottom',
|
gravity: 'bottom',
|
||||||
position: 'left',
|
position: 'left'
|
||||||
offset: {
|
|
||||||
x: '14rem'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let toastsWithId = {}
|
let toastsWithId = {}
|
||||||
@ -87,6 +84,9 @@ export const toast = function(msg, icon = null, dismiss = true, id = null) {
|
|||||||
delete toastsWithId[id]
|
delete toastsWithId[id]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
offset: {
|
||||||
|
x: 'true' === localStorage.getItem('slimSidebar') ? '3rem': '14rem'
|
||||||
}
|
}
|
||||||
}).showToast()
|
}).showToast()
|
||||||
if (id) {
|
if (id) {
|
||||||
|
Loading…
Reference in New Issue
Block a user