Skip to content

Commit

Permalink
Use ellipses to truncate long constraint values at responsive breakpo…
Browse files Browse the repository at this point in the history
…ints
  • Loading branch information
cbeer committed Nov 10, 2014
1 parent 45217ba commit 85722d3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
20 changes: 19 additions & 1 deletion app/assets/stylesheets/blacklight/_catalog.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,25 @@ span.constraints-label {
{
.constraint-value {
cursor: default;

text-overflow: ellipsis;
overflow: hidden;

@media (max-width: $screen-xs-max) {
max-width: $screen-xs-min / 2;
}

@media (min-width: $screen-sm-min) and (max-width: $screen-sm-max) {
max-width: $screen-sm-min / 2;
}

@media (min-width: $screen-md-min) and (max-width: $screen-md-max) {
max-width: $screen-md-min / 2;
}

@media (min-width: $screen-lg-min) {
max-width: $screen-lg-min / 2;
}

&:hover, &:active {
background-color: $btn-default-bg;
border-color: $btn-default-border;
Expand Down
2 changes: 1 addition & 1 deletion app/views/catalog/_constraints_element.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<span class="filterName"><%= label %></span>
<% end %>
<% unless value.blank? %>
<span class="filterValue"><%= value %></span>
<%= content_tag :span, value, class: 'filterValue', title: value %>
<% end %>
</span>
<% unless options[:remove].blank? %>
Expand Down

0 comments on commit 85722d3

Please sign in to comment.