40 lines
1.7 KiB
Plaintext
40 lines
1.7 KiB
Plaintext
<div class="syllabus_box" id="course-list">
|
|
<div style="border-bottom: 1px solid #e7e7e7;">
|
|
<h2 class="syllabus_h2_top fl" style="border-bottom: none;"><span class="icon_course fl mt7 mr5"></span>课程列表</h2>
|
|
<%= link_to "返回", user_courselist_user_path(@user), :class => "linkBlue2 mt15 fr mr15 f14"%>
|
|
<div class="cl"></div>
|
|
</div>
|
|
|
|
<div id="user_archive_course_list">
|
|
<%= render :partial => 'users/user_archive_course_list', :locals => {:syllabuses => @archive_syllabuses}%>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript">
|
|
//如果右边的列表比左边的高度低则将右边的高度设为与左边对齐
|
|
$(function() {
|
|
var leftHeight = $("#LSide").height() - $(".fontGrey5").height() - 20;
|
|
var rightHeight = $(".homepageRight").height();
|
|
if (rightHeight < leftHeight) {
|
|
var diffHeight = leftHeight - rightHeight;
|
|
var tmpHeight = $(".syllabus_box").height() + diffHeight;
|
|
$(".syllabus_box").css("minHeight", tmpHeight);
|
|
}
|
|
});
|
|
function expand_courses(id, count){
|
|
var div = $("#syllabus_courses_list_"+id);
|
|
var classNum = div.next().children().children("li").size();
|
|
if(classNum>0){
|
|
div.next().toggle();
|
|
div.children(":first-child").children(":first-child").toggleClass("icons_sy_close").toggleClass("icons_sy_open");
|
|
} else if(count > 0) {
|
|
var str = div.next().children().eq(0).attr('id');
|
|
var id = str.substring(19);
|
|
var user_id = <%= @user.id%>;
|
|
$.get(
|
|
'/users/'+user_id+'/expand_courses?is_delete=1&syllabus_id=' + id
|
|
);
|
|
}
|
|
}
|
|
</script> |