always-show-jump-to-project.diff

Go MAEDA, 2017-01-15 06:39

Download (2.63 KB)

View differences:

app/helpers/application_helper.rb (working copy)
358 358
  # Renders the project quick-jump box
359 359
  def render_project_jump_box
360 360
    projects = projects_for_jump_box(User.current)
361
    if projects.any?
362
      text = @project.try(:name) || l(:label_jump_to_a_project)
363
      trigger = content_tag('span', text, :class => 'drdn-trigger')
364
      q = text_field_tag('q', '', :id => 'projects-quick-search', :class => 'autocomplete', :data => {:automcomplete_url => projects_path(:format => 'js')})
365
      all = link_to(l(:label_project_all), projects_path(:jump => current_menu_item), :class => (@project.nil? && controller.class.main_menu ? 'selected' : nil))
366
      content = content_tag('div',
367
            content_tag('div', q, :class => 'quick-search') + 
368
            content_tag('div', render_projects_for_jump_box(projects, @project), :class => 'drdn-items projects selection') +
369
            content_tag('div', all, :class => 'drdn-items all-projects selection'),
370
          :class => 'drdn-content'
371
        )
361
    text = @project.try(:name) || l(:label_jump_to_a_project)
362
    trigger = content_tag('span', text, :class => 'drdn-trigger')
363
    q = text_field_tag('q', '', :id => 'projects-quick-search', :class => 'autocomplete', :data => {:automcomplete_url => projects_path(:format => 'js')})
364
    all = link_to(l(:label_project_all), projects_path(:jump => current_menu_item), :class => (@project.nil? && controller.class.main_menu ? 'selected' : nil))
365
    content = content_tag('div',
366
          content_tag('div', q, :class => 'quick-search') +
367
          content_tag('div', render_projects_for_jump_box(projects, @project), :class => 'drdn-items projects selection') +
368
          content_tag('div', all, :class => 'drdn-items all-projects selection'),
369
        :class => 'drdn-content'
370
      )
372 371

  
373
      content_tag('span', trigger + content, :id => "project-jump", :class => "drdn")
374
    end
372
    content_tag('span', trigger + content, :id => "project-jump", :class => "drdn")
375 373
  end
376 374

  
377 375
  def project_tree_options_for_select(projects, options = {})
public/stylesheets/application.css (working copy)
202 202
.drdn-items.selection>*.selected:before {
203 203
  content:"\2713 ";
204 204
}
205
.drdn-items.selection:empty {
206
  border: none;
207
}
205 208
.drdn-items>span {color:#999;}
206 209

  
207 210
#project-jump.drdn {width:200px;display:inline-block;}