mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Added x button to msgs
This commit is contained in:
parent
ca916fe93a
commit
234654a2e4
1 changed files with 15 additions and 0 deletions
|
@ -2031,6 +2031,21 @@
|
||||||
}
|
}
|
||||||
appedtTo.appendChild(mainDiv) // THE FINAL APPEND
|
appedtTo.appendChild(mainDiv) // THE FINAL APPEND
|
||||||
|
|
||||||
|
const xButton = CreateNodeWithText(mainDiv, '❌', 'div')
|
||||||
|
const xButtonSize = 20
|
||||||
|
SetStyle(xButton, {
|
||||||
|
position: 'absolute',
|
||||||
|
height: xButtonSize + 'px',
|
||||||
|
top: 0,
|
||||||
|
width: xButtonSize + 'px',
|
||||||
|
left: width - xButtonSize + 'px',
|
||||||
|
cursor: 'pointer',
|
||||||
|
})
|
||||||
|
xButton.addEventListener('mousedown', e => {
|
||||||
|
e.stopPropagation()
|
||||||
|
mainDiv.parentNode.removeChild(mainDiv)
|
||||||
|
})
|
||||||
|
|
||||||
// setting some events
|
// setting some events
|
||||||
// addEventListener(window, 'scroll', function () {
|
// addEventListener(window, 'scroll', function () {
|
||||||
// mainDiv.style.top = (pageYOffset + startFromTop) + 'px';
|
// mainDiv.style.top = (pageYOffset + startFromTop) + 'px';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue