课程名称,班级名称过长时,省略号显示

This commit is contained in:
Tim 2016-09-09 17:58:21 +08:00
parent 34a1bb0b49
commit 1fe8b35fc9
1 changed files with 3 additions and 3 deletions

View File

@ -3,9 +3,9 @@
<span class="user_icons_class"></span>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<p href="javascript:void(0);" id="show_course_<%= course.id %>" class="course_list_menu" title="<%= course.syllabus.title+' · '+(course.is_public? ? '公开班级:' : '私有班级:')+course.name+''+current_time_and_term(course)+'' %>">
<%= link_to course.syllabus.title, syllabus_path(course.syllabus_id), :target => '_blank', :class => 'hidden', :style => "max-width:80px; display:inline-block;"%>
<%= link_to course.syllabus.title, syllabus_path(course.syllabus_id), :target => '_blank', :class => 'hidden', :style => "max-width:85px; display:inline-block;"%>
<font class="fb c_grey" style="height:39px; line-height:39px; vertical-align:top;">·</font>
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :target => '_blank', :class => 'hidden', :style => "max-width:80px; display:inline-block;"%>
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :target => '_blank', :class => 'hidden', :style => "max-width:85px; display:inline-block;"%>
</p>
<%#= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course),
:id => "show_course_#{course.id}", :class => 'course_list_menu hidden', :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+""+current_time_and_term(course)+""%>
@ -107,7 +107,7 @@
$(".course_list_menu").each(function(){
var courseWidth = $(this).children().eq(0).width();
var classWidth = 160 -courseWidth;
var classWidth = 170 -courseWidth;
console.log(courseWidth, classWidth);
if(courseWidth < 80){
$(this).children().eq(2).css("max-width",classWidth + "px");