       @local.sort_menu = false
       save @local
 
-
     SPAN
       style: 
         color: 'black'
         fontSize: 14
 
       "sort by "
-
 
       DIV 
         ref: 'menu_wrap'

window.sorted_proposals = (proposals) ->

  sort = fetch 'sort_proposals'
  set_sort() if !sort.func? 


  if sort.comp
    comp = sort.comp
    proposals = proposals.slice().sort (a,b) ->
      return comp(a,b) 

  else 
    proposal_rank = sort.func
    proposals = proposals.slice().sort (a,b) ->
      return proposal_rank(b, sort.opinion_value) - proposal_rank(a, sort.opinion_value)

  # filter out filtered proposals
  filter_out = fetch 'filtered'

  render: -> 

    sort = fetch 'sort_proposals'
    set_sort() if !sort.name? 

    trigger = (e) =>
      _.extend sort, sort_options[@local.focus]   
      save sort 
      @local.sort_menu = false
      save @local
