Use a css class to hide the selected dropdown choice.

This makes JS dropdown implementations simpler since they have all of
the choices in the DOM.
This commit is contained in:
Max Goodman
2012-02-24 15:16:09 -08:00
parent 222ff247e3
commit e28541d488
2 changed files with 10 additions and 9 deletions

View File

@@ -300,6 +300,10 @@ ul.flat-vert {text-align: left;}
background-color: #c7def7;
}
.drop-choices a.choice.selected {
display: none;
}
.dropdown.heavydrop .selected{
background: white none no-repeat scroll center right;
background-image: url(../droparrow.gif);

View File

@@ -46,15 +46,12 @@
<div class="drop-choices ${css_class}">
%for option in thing:
%if option != thing.selected:
%if thing.use_post:
${post_link(option.title, option.base_path, option.path,
option.action_params, _sr_path=option.sr_path,
_class="choice " + option.css_class)}
%else:
${plain_link(option.title, option.path, _sr_path = option.sr_path,
_class = "choice" + " " + option.css_class)}
%endif
<% _class = "choice " + option.css_class + (" selected" if option == thing.selected else "") %>
%if thing.use_post:
${post_link(option.title, option.base_path, option.path,
option.action_params, _sr_path=option.sr_path, _class=_class)}
%else:
${plain_link(option.title, option.path, _sr_path = option.sr_path, _class=_class)}
%endif
%endfor
</div>