EmulatedDeviceLab icon indicating copy to clipboard operation
EmulatedDeviceLab copied to clipboard

Dialog over Template for some parts?

Open Garbee opened this issue 10 years ago • 2 comments

I'm noticing <template> used a lot for the modals. Seems ones like the device-manager-modal-tpl could be implemented with the <dialog> element and things could be cleaner in terms of setup.

Any specific reason template was used?

This is entirely low-priority if it is decided to change. Not a big deal since we need to focus on function over form atm.

Garbee avatar Mar 05 '15 14:03 Garbee

I wanted to avoid two things:

  • building DOM in JS,
  • having unnecesary nodes in the DOM (like hidden modals).

Since <template> helps to avoid these two, and is natively supported, I thought I'll give it a try. Haven't really considered <dialog> though. If it really simplifies the code and doesn't contradict any of the two assumptions that I've made at the top, then we should implement it.

kdzwinel avatar Mar 05 '15 22:03 kdzwinel

I'm not sure how dialog interacts at the DOM level compared to template. I will do some research on that as time permits. It is however native in Chrome (no other browsers, but this isn't an issue here.) It probably wouldn't simplify the execution code too much, but would remove whatever is currently making the modals as a dependency. We'd just need to manually style the dialog which isn't a major issue.

Garbee avatar Mar 05 '15 22:03 Garbee