Mercurial > prosody-hg
comparison util/dataforms.lua @ 9092:5110da3a71eb
util.dataforms: Allow overriding default options even if the form has such
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 03 Aug 2018 22:24:35 +0200 |
| parents | 519dea077d20 |
| children | 05979ae1e38a |
comparison
equal
deleted
inserted
replaced
| 9091:519dea077d20 | 9092:5110da3a71eb |
|---|---|
| 56 else | 56 else |
| 57 value = field.value; | 57 value = field.value; |
| 58 end | 58 end |
| 59 | 59 |
| 60 local options = field.options; | 60 local options = field.options; |
| 61 if formtype == "form" and not options and value | 61 if formtype == "form" and value |
| 62 and (field_type == "list-single" or field_type == "list-multi") then | 62 and (field_type == "list-single" or field_type == "list-multi") then |
| 63 -- Allow passing dynamically generated options as values | 63 -- Allow passing dynamically generated options as values |
| 64 options, value = value, nil; | 64 options, value = value, nil; |
| 65 end | 65 end |
| 66 | 66 |
