message box close button now works and returns 0 as it should
This commit is contained in:
parent
870f0d2f8f
commit
08abb019bd
5
main.lua
5
main.lua
|
@ -76,6 +76,7 @@ infatuated.msgbox = {
|
|||
root = document:getElementById("infatuated-msgbox"),
|
||||
title = document:getElementById("infatuated-msgbox-title"),
|
||||
text = document:getElementById("infatuated-msgbox-text"),
|
||||
close = document:getElementById("infatuated-msgbox-close"),
|
||||
buttons = document:getElementById("infatuated-msgbox-buttons")
|
||||
}
|
||||
function infatuated.msgbox:show(title, text, buttons, callback)
|
||||
|
@ -84,6 +85,10 @@ function infatuated.msgbox:show(title, text, buttons, callback)
|
|||
for k, v in pairs(document:querySelectorAll("#infatuated-msgbox-buttons button")) do
|
||||
v:remove()
|
||||
end
|
||||
function self.close.onclick()
|
||||
self:hide()
|
||||
callback(0)
|
||||
end
|
||||
for i=1, #buttons do
|
||||
local btn = document:createElement("button")
|
||||
btn.textContent = buttons[i]
|
||||
|
|
Loading…
Reference in New Issue