[dw-free] Custom values not possible for dropdowns
[commit: http://hg.dwscoalition.org/dw-free/rev/d6aff629eebf]
http://bugs.dwscoalition.org/show_bug.cgi?id=3233
Allow custom values in dropdowns to persist (only select properties will be
able to have custom values in dropdowns, currently only settable via
advanced customization)
Patch by
fu.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=3233
Allow custom values in dropdowns to persist (only select properties will be
able to have custom values in dropdowns, currently only settable via
advanced customization)
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- cgi-bin/LJ/Widget/S2PropGroup.pm
-------------------------------------------------------------------------------- diff -r e9a5878c4c11 -r d6aff629eebf cgi-bin/LJ/Widget/S2PropGroup.pm --- a/cgi-bin/LJ/Widget/S2PropGroup.pm Mon Nov 22 14:24:23 2010 +0800 +++ b/cgi-bin/LJ/Widget/S2PropGroup.pm Mon Nov 22 14:28:32 2010 +0800 @@ -414,11 +414,17 @@ sub output_prop_element { } } elsif ( $prop->{values} ) { $ret .= "<td class='prop-input'>" unless $is_group; + + # take the list of allowed values + # and prepend custom values (set through the layer editor) if allowed + my %vals = split( /\|/, $prop->{values} ); + $vals{$override} = "Custom: " . $override unless $vals{$override}; + $ret .= $class->html_select( { name => $name, disabled => ! $can_use, selected => $override, }, - split(/\|/, $prop->{values}) + %vals, ); $ret .= " <label>" . LJ::eall( $prop->{des} ) . "</label>" if $is_group && $prop->{des}; $ret .= "</td>" unless $is_group; --------------------------------------------------------------------------------