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:
@@ -2031,6 +2031,21 @@
|
||||
}
|
||||
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
|
||||
// addEventListener(window, 'scroll', function () {
|
||||
// mainDiv.style.top = (pageYOffset + startFromTop) + 'px';
|
||||
|
Reference in New Issue
Block a user