Skip to content

Commit f5a2e3c

Browse files
authored
Merge pull request #198 from MITLibraries/gdt-246-ios-ol-bug
Fix iOS text wrap bug
2 parents 03f29ec + 59ff003 commit f5a2e3c

File tree

3 files changed

+77
-69
lines changed

3 files changed

+77
-69
lines changed

app/assets/stylesheets/partials/_results.scss

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -44,46 +44,50 @@
4444
padding: 2rem;
4545
border-top: 1px solid $brand-primary;
4646
font-size: $fs-small;
47+
line-height: 0; /* line height needs to be reset so iOS doesn't act weird */
4748

4849
&::marker {
4950
font-size: 2.5rem;
50-
line-height: 1.1;
5151
font-weight: $fw-bold;
5252
}
5353

54-
.record-title {
55-
font-size: 2.5rem;
56-
line-height: 1.1;
57-
}
58-
5954
&:hover,
6055
&:focus {
6156
background-color: $gray-l4;
6257
}
6358

64-
a:visited {
65-
color: $brand-secondary;
66-
}
59+
.result-content {
60+
line-height: 1.2;
6761

68-
.pub-info {
69-
font-size: $fs-base;
70-
color: $gray-d1;
71-
span:first-child:after {
72-
content: " | ";
62+
.record-title {
63+
font-size: 2.5rem;
64+
line-height: 1.1;
7365
}
74-
margin: 1em 0;
75-
}
7666

77-
.result-summary {
78-
margin-bottom: 2.4em;
79-
}
67+
a:visited {
68+
color: $brand-secondary;
69+
}
70+
71+
.pub-info {
72+
font-size: $fs-base;
73+
color: $gray-d1;
74+
span:first-child:after {
75+
content: " | ";
76+
}
77+
margin: 1em 0;
78+
}
79+
80+
.result-summary {
81+
margin-bottom: 2.4em;
82+
}
8083

81-
.result-highlights {
82-
margin-top: 1.4em;
83-
ul {
84-
list-style: none;
85-
li {
86-
margin-left: 2rem;
84+
.result-highlights {
85+
margin-top: 1.4em;
86+
ul {
87+
list-style: none;
88+
li {
89+
margin-left: 2rem;
90+
}
8791
}
8892
}
8993
}

app/views/search/_result.html.erb

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
<li class="result">
2-
<h3 class="record-title">
3-
<span class="sr">Title: </span><%= link_to(result['title'], record_path(result['timdexRecordId'])) %>
4-
</h3>
2+
<div class="result-content">
3+
<h3 class="record-title">
4+
<span class="sr">Title: </span><%= link_to(result['title'], record_path(result['timdexRecordId'])) %>
5+
</h3>
56

6-
<p class="pub-info">
7-
<span><%= result['contentType']&.each { |type| type['value'] }&.join(' ; ') %></span>
8-
<span>
9-
<% result['dates']&.each do |date| %>
10-
<%= date['value'] if date['kind'] == 'Publication date' %>
11-
<% end %>
12-
</span>
13-
</p>
7+
<p class="pub-info">
8+
<span><%= result['contentType']&.each { |type| type['value'] }&.join(' ; ') %></span>
9+
<span>
10+
<% result['dates']&.each do |date| %>
11+
<%= date['value'] if date['kind'] == 'Publication date' %>
12+
<% end %>
13+
</span>
14+
</p>
1415

15-
<span class="sr">Contributors: </span>
16-
<ul class="list-inline truncate-list contributors">
17-
<%= render partial: 'shared/contributors', locals: { contributors: result['contributors'] } %>
18-
</ul>
16+
<span class="sr">Contributors: </span>
17+
<ul class="list-inline truncate-list contributors">
18+
<%= render partial: 'shared/contributors', locals: { contributors: result['contributors'] } %>
19+
</ul>
1920

20-
<div class="result-highlights">
21-
<%= render partial: 'search/highlights', locals: { result: result } %>
22-
</div>
21+
<div class="result-highlights">
22+
<%= render partial: 'search/highlights', locals: { result: result } %>
23+
</div>
2324

24-
<div class="result-get">
25-
<%= view_online(result) %>
25+
<div class="result-get">
26+
<%= view_online(result) %>
27+
</div>
2628
</div>
2729
</li>
Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
11
<li class="result">
2-
<h3 class="record-title">
3-
<span class="sr">Title: </span><%= link_to(result_geo['title'], record_path(result_geo['timdexRecordId'])) %>
4-
</h3>
2+
<div class="result-content">
3+
<h3 class="record-title">
4+
<span class="sr">Title: </span><%= link_to(result_geo['title'], record_path(result_geo['timdexRecordId'])) %>
5+
</h3>
56

6-
<div class="data-info">
7-
<%= render partial: 'shared/geo_data_info', locals: { metadata: result_geo } %>
8-
</div>
7+
<div class="data-info">
8+
<%= render partial: 'shared/geo_data_info', locals: { metadata: result_geo } %>
9+
</div>
910

10-
<% if result_geo['contributors'] %>
11-
<span class="sr">Contributors: </span>
12-
<ul class="list-inline truncate-list contributors">
13-
<%= render partial: 'shared/contributors', locals: { contributors: result_geo['contributors'] } %>
14-
</ul>
15-
<% end %>
11+
<% if result_geo['contributors'] %>
12+
<span class="sr">Contributors: </span>
13+
<ul class="list-inline truncate-list contributors">
14+
<%= render partial: 'shared/contributors', locals: { contributors: result_geo['contributors'] } %>
15+
</ul>
16+
<% end %>
1617

17-
<% if result_geo['summary'] %>
18-
<p class="result-summary truncate-list">
19-
<span class="sr">Summary: </span><%= result_geo['summary'].join(' ') %>
20-
</p>
21-
<% end %>
18+
<% if result_geo['summary'] %>
19+
<p class="result-summary truncate-list">
20+
<span class="sr">Summary: </span><%= result_geo['summary'].join(' ') %>
21+
</p>
22+
<% end %>
2223

23-
<% if result_geo['highlight'] %>
24-
<div class="result-highlights">
25-
<%= render partial: 'search/highlights', locals: { result: result_geo } %>
26-
</div>
27-
<% end %>
24+
<% if result_geo['highlight'] %>
25+
<div class="result-highlights">
26+
<%= render partial: 'search/highlights', locals: { result: result_geo } %>
27+
</div>
28+
<% end %>
2829

29-
<div class="result-record">
30-
<%= view_record(result_geo['timdexRecordId']) %>
30+
<div class="result-record">
31+
<%= view_record(result_geo['timdexRecordId']) %>
32+
</div>
3133
</div>
3234
</li>

0 commit comments

Comments
 (0)