资源描述不变时不请求后台
This commit is contained in:
parent
88d489b485
commit
5a99b632b8
|
@ -1,5 +1,5 @@
|
|||
<p ondblclick=show_edit_file_description('<%= file.id %>')>
|
||||
<span style="white-space:nowrap;">资源描述:</span><% if file.description.blank? %><span style="color:#C5C5BE; cursor:pointer;" title="双击可编辑">双击添加描述</span><% else %><span style="cursor:pointer;" title="双击可编辑" class="break_word"><%= file.description %></span><% end %>
|
||||
<span style="white-space:nowrap;">资源描述:</span><% if file.description.blank? %><span style="color:#C5C5BE; cursor:pointer;" title="双击可编辑">双击添加描述</span><% else %><span id="file_description_tip_<%= file.id %>" style="cursor:pointer;" title="双击可编辑" class="break_word"><%= file.description %></span><% end %>
|
||||
<%#= file.description.blank? ? "该资源暂无描述" : file.description %>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);", :onclick => "show_edit_file_description("+file.id.to_s+");"%>
|
||||
</p>
|
|
@ -45,7 +45,7 @@
|
|||
</div>
|
||||
<%= form_tag(edit_file_description_org_subfield_file_path(file, :org_subfield_id => org_subfield.id ),:remote=>'true', :method => :post, :id=>"files_query_form_#{file.id}") do %>
|
||||
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" name="file_description_edit" id="file_description_edit_<%= file.id %>"
|
||||
onblur="commit_files_description('#files_query_form_<%= file.id %>');"><%= file.description %></textarea>
|
||||
onblur="commit_files_description('#files_query_form_<%= file.id %>','#file_description_edit_<%= file.id %>','#file_description_show_<%= file.id %>','#file_description_tip_<%= file.id %>');"><%= file.description %></textarea>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
|
@ -117,7 +117,13 @@
|
|||
<% end%>
|
||||
|
||||
<script>
|
||||
function commit_files_description(id) {
|
||||
function commit_files_description(id,des_id,show_id,tip_id) {
|
||||
if($(tip_id).text() == $(des_id).val()){
|
||||
$(des_id).hide();
|
||||
$(show_id).show();
|
||||
return;
|
||||
}
|
||||
|
||||
$(id).submit();
|
||||
}
|
||||
</script>
|
|
@ -42,7 +42,7 @@
|
|||
</div>
|
||||
<%= form_tag(edit_file_description_project_file_path(file, :project_id => project.id),:remote=>'true', :method => :post, :id=>"files_query_form_#{file.id}") do %>
|
||||
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" name="file_description_edit" id="file_description_edit_<%= file.id %>"
|
||||
onblur="commit_files_description('#files_query_form_<%= file.id %>');"><%= file.description %></textarea>
|
||||
onblur="commit_files_description('#files_query_form_<%= file.id %>','#file_description_edit_<%= file.id %>','#file_description_show_<%= file.id %>','#file_description_tip_<%= file.id %>');"><%= file.description %></textarea>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
|
@ -73,7 +73,13 @@
|
|||
</ul>
|
||||
|
||||
<script>
|
||||
function commit_files_description(id) {
|
||||
function commit_files_description(id,des_id,show_id,tip_id) {
|
||||
if($(tip_id).text() == $(des_id).val()){
|
||||
$(des_id).hide();
|
||||
$(show_id).show();
|
||||
return;
|
||||
}
|
||||
|
||||
$(id).submit();
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
</div>
|
||||
<%= form_tag(edit_file_description_course_file_path(file, :course_id => @course.id),:remote=>'true', :method => :post, :id=>"files_query_form_#{file.id}") do %>
|
||||
<textarea style="resize: none;max-width: none;margin-left: 0" class="homepageSignatureTextarea W600 none " placeholder="请编辑资源描述" name="file_description_edit" id="file_description_edit_<%= file.id %>"
|
||||
onblur="commit_files_description('#files_query_form_<%= file.id %>');"><%= file.description %></textarea>
|
||||
onblur="commit_files_description('#files_query_form_<%= file.id %>','#file_description_edit_<%= file.id %>','#file_description_show_<%= file.id %>','#file_description_tip_<%= file.id %>');"><%= file.description %></textarea>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
|
@ -105,7 +105,13 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
<script>
|
||||
function commit_files_description(id) {
|
||||
function commit_files_description(id,des_id,show_id,tip_id) {
|
||||
if($(tip_id).text() == $(des_id).val()){
|
||||
$(des_id).hide();
|
||||
$(show_id).show();
|
||||
return;
|
||||
}
|
||||
|
||||
$(id).submit();
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue