luci-base: fix tab handling in modal dialogues
authorPaul Donald <newtwen+github@gmail.com>
Thu, 29 Jan 2026 18:02:12 +0000 (19:02 +0100)
committerPaul Donald <newtwen+github@gmail.com>
Thu, 29 Jan 2026 18:02:12 +0000 (19:02 +0100)
commit9a07b1b79d1ecbd119d13f4d231f7b4d5a3cfa2f
treec3e80612c7587ea4e1a6c72436e4da0ef8596f72
parentfd8c8a4fe33580c5c94745c966fc2d184f0bde3e
luci-base: fix tab handling in modal dialogues

When adding tabs in modal dialogues, the old code of simply assigning
s.tabs = this.tabs was problematic because it was an array of objects
whose behaviour would cause a traceback when s.tab is called in e.g.
a protocol handler Modal when it was reopened.

Now verify the properties do not already exist before assigning them.

This means one can define s.tab(...) in a Modal UI without a try
block (which would even then sometimes fail).

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
modules/luci-base/htdocs/luci-static/resources/form.js