app: add comments on local elements
app: add comments on main actions
js: destroy dialog when element is destroyed