Skip to content

Commit

Permalink
Minor tweaks to styles. Move js from inline to js file
Browse files Browse the repository at this point in the history
  • Loading branch information
peregrinator committed Nov 17, 2014
1 parent efd4990 commit b76ed8b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
5 changes: 5 additions & 0 deletions app/stylesheets/design/_fr_index.scss
Expand Up @@ -53,6 +53,11 @@
.selected_date {
margin-top: 5px;
float: right;
@include apertura-condensed;
font-size: 14px;
background-color: #FFF;
background-image: none;
height: 20px;
}
}

Expand Down
9 changes: 6 additions & 3 deletions app/views/indexes/year.html.erb
Expand Up @@ -6,9 +6,12 @@
<div class="title_container">
<h1><%= @fr_index.year %> Federal Register Index</h1>
</div>
<% form_tag(url_for(select_index_year_path), :method => :get, :class => 'selected_date') do %>
<%= label_tag :year, "View other years: " %>
<%= select_tag(:year, options_for_select(@fr_index.class.available_years, params[:year]), :include_blank => false, :onchange => "this.form.submit()") %>
<% form_tag(url_for(select_index_year_path), :method => :get, :id => "fr-index-year-select", :class => 'selected_date') do %>
<%= label_tag :year, "View other years:" %>
<%= select_tag(:year,
options_for_select(@fr_index.class.available_years, @fr_index.year),
:include_blank => false
) %>
<% end %>

<hr />
Expand Down
4 changes: 4 additions & 0 deletions public/javascripts/fr_index.js
Expand Up @@ -21,6 +21,10 @@ fr_index_popover_handler.add_popover_content = function() {


$(document).ready(function() {
$('#fr-index-year-select select').on('change', function(e) {
$(this).closest('form').submit();
});

var popover_handler = fr_index_popover_handler.initialize();

if ( $("#fr-index-entry-popover-template").length > 0) {
Expand Down

0 comments on commit b76ed8b

Please sign in to comment.