课程默认收起

This commit is contained in:
huang 2016-01-15 15:37:17 +08:00
parent b9359b1cee
commit c936304314
2 changed files with 7 additions and 3 deletions

View File

@ -126,7 +126,7 @@
<%# 工具栏展开 %>
<% if @course.homework_commons.count == 0 || @course.news.count == 0 || course_file_num == 0 || course_poll_count == 0 || @course.exercises.count == 0 ||
course_feedback_count == 0 || @course.exercises.count == 0 || (@course.boards.first ? @course.boards.first.topics.count : 0) == 0 %>
<div class="subNav subNav_jiantou" id="expand_tools_expand" nhtype="toggle4cookie" data-id="expand_tool_more" data-target="#navContentCourse" data-val="retract"><%= l(:label_project_more) %></div>
<div class="subNav subNav_jiantou" id="expand_tools_expand" nhtype="toggle4cookiecourse" data-id="expand_tool_more" data-target="#navContentCourse" data-val="retract"><%= l(:label_project_more) %></div>
<ul class="navContent" id="navContentCourse">
<%= render 'courses/tool_expand', :locals => {:is_teacher => is_teacher, :course_file_num => course_file_num} %>
</ul>

View File

@ -1389,7 +1389,7 @@ $(function(){
var personalized_map = cookieget(personalized_expand_key);
if(personalized_map!=false){
personalized_map = JSON.parse(personalized_map);
$("*[nhtype='toggle4cookie']").each(function(){
$("*[nhtype='toggle4cookiecourse']").each(function(){
var personalized_id=$(this).data('id');
var val = personalized_map[personalized_id];
if(val!=undefined && val!=$(this).data('val')){
@ -1415,7 +1415,7 @@ $(function(){
cookiesave(personalized_expand_key,JSON.stringify(personalized_map));
target.toggle(timeout);
}
$("*[nhtype='toggle4cookie']").on('click',function(){
$("*[nhtype='toggle4cookiecourse']").on('click',function(){
personalized_click($(this),500);
});
@ -1428,3 +1428,7 @@ function submit_course_feedback() {
var flag = true
}
}
function show_more_tool(){
$('#navContentCourse').css('display', 'block');
}