Skip to content

Commit 0a4c7c6

Browse files
committed
修正话题页面 Navbar Title 内容过长会超出的问题 ruby-china#810
1 parent 5bf4d12 commit 0a4c7c6

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

app/assets/stylesheets/front.scss

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
}
4242
}
4343

44-
4544
@media (min-width: 767px) {
4645
.navbar {
4746
&.fixed-title {
@@ -52,12 +51,14 @@
5251
.navbar-topic-title {
5352
display: none;
5453
height: 50px;
54+
overflow: hidden;
5555

56-
a {
56+
a.topic-title {
5757
display: inline;
5858
text-decoration: none;
5959
overflow: hidden;
6060
line-height: 0;
61+
max-width: 400px;
6162
color: #000;
6263
&:hover,
6364
&:active,
@@ -75,6 +76,16 @@
7576
}
7677
}
7778

79+
@media (min-width: 992px) {
80+
.navbar {
81+
.navbar-topic-title {
82+
a.topic-title {
83+
max-width: 780px;
84+
}
85+
}
86+
}
87+
}
88+
7889
.move-page-buttons {
7990
position: fixed;
8091
bottom: 10px;

app/views/topics/_topic_info.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<% content_for :header do %>
88
<div class="navbar-nav">
99
<div class="navbar-topic-title">
10-
<a href="#" class="topic-title pull-left" data-type="top">
10+
<a href="#" class="topic-title pull-left" title="<%= topic.title %>" data-type="top">
1111
<h1><%= topic.title %><%= topic_close_tag(topic) %></h1>
1212
</a>
1313
<span class="node"><%= topic.node_name %></span>

0 commit comments

Comments
 (0)