This commit is contained in:
luk3yx 2020-02-01 11:13:19 +13:00
parent fd7e245a4b
commit 82b8901a76
1 changed files with 7 additions and 2 deletions

View File

@ -717,11 +717,16 @@ end
function window:render_formspec(fs, callbacks)
local tree = assert(formspec_ast.parse(fs))
local elem = assert(renderer.render_ast(tree, callbacks))
local e = assert(document:getElementById('formspec_output'))
local e = document:getElementById('formspec_output')
if not e or e == null then
window:addEventListener('load', function()
window:render_formspec(fs, callbacks)
end)
return
end
e.innerHTML = ''
e:appendChild(elem)
renderer.show_element_dialog(elem)
return 'OK'
end
function window:copy_formspec()