双点击事件

This commit is contained in:
caishi 2017-08-25 21:19:20 +08:00
parent 833a40a68a
commit c4ac37cc4d
2 changed files with 6 additions and 6 deletions

View File

@ -1,7 +1,7 @@
<div class="with75 fl">
<!--简介-->
<% if !@subject.description.blank? || User.current.manager_of_subject?(@subject) %>
<div class="pb20 produce-content bor-bottom-greyE">
<div class="pb20 produce-content">
<p class="clearfix">
<% if User.current.manager_of_subject?(@subject) %>
<a href="<%= edit_subject_path(@subject) %>"><i class="fa fa-pencil fr mt10 mr5 color-grey-c edit-produce"data-tip-down="编辑"></i></a>
@ -16,7 +16,7 @@
<div class="lesson-saved-list mb20">
<% count = 0 %>
<% @stages.each_with_index do |stage, s_index| %>
<div class="lesson-saved-list-item pt10 pb10 bor-bottom-greyE" id="stage_div_<%= stage.id %>">
<div class="lesson-saved-list-item pt10 pb10 bor-top-greyE" id="stage_div_<%= stage.id %>">
<p class="clearfix title-line">
<i class="fa fa-pause-circle color-light-green font-16 transform90"></i>
<span class="font-16 font-bd">第<%= s_index + 1 %>章&nbsp;&nbsp;<%= stage.name %></span>
@ -31,7 +31,7 @@
<p class="ml20 color-dark-grey mt10 mb10"><%= stage.description %></p>
<% stage.stage_shixuns.each_with_index do |stage_shixun, index| %>
<% shixun = stage_shixun.shixun %>
<div class="clearfix pt10 pb10 ml20 pl10 mb10 paragraph" id="stage_shixun_<%= shixun.id %>" style="cursor: pointer;" <%= shixun.status > 1 ? "" : "onclick='shixun_link('#{shixun.identifier}')'" %>>
<div class="clearfix pt10 pb10 ml20 pl10 mb10 paragraph" id="stage_shixun_<%= shixun.id %>" style="cursor: pointer;" onclick="shixun_link('<%= shixun.identifier %>')">
<li class="fl li-width63">
<i class="fa fa-sort-up color-grey-c fl mt5 mr10 transform90 font-18"></i>
<span class="color-grey3 paragraph_name"><%= s_index + 1 %>-<%= index + 1 %>&nbsp;&nbsp;<%= shixun.name %></span>
@ -55,12 +55,14 @@
<% end %>
<% if allow_shixun_exec(shixun) %>
<% if shixun.status > 1 %>
<div onclick="return false;">
<% myshixun = Myshixun.where(:user_id => User.current.id, :shixun_id => shixun.id).first %>
<% if myshixun.blank? %>
<%= link_to "开始实战", operation_shixun_path(shixun, :myshixun_id => myshixun.try(:id)), :class => "task-btn task-btn-orange ", :style=>"display: none", :id => "shixun_operation", :remote => true %>
<% else %>
<%= link_to "继续实战", operation_shixun_path(shixun, :myshixun_id => myshixun.try(:id)), :class => "task-btn task-btn-orange", :style=>"display: none", :id => "shixun_operation", :remote => true %>
<% end %>
</div>
<% end %>
<% end %>
</li>

View File

@ -1121,9 +1121,7 @@ function checkLesson(item){
}
}
}
function shixun_link(shixun) {
window.open('/shixuns/' + shixun);
}
function subject_link(id){
window.open('/subjects/' + id);
}