#1073 发布课程通知要点两次才能提交成功bug,原因:js的失去焦点事件和点击事件冲突,解决方法:鼠标移到提交按钮时使提交按钮获得焦点

This commit is contained in:
z9hang 2014-09-01 17:56:12 +08:00
parent e0cdcc0211
commit a2f14bc0b2
1 changed files with 6 additions and 1 deletions

View File

@ -54,6 +54,11 @@
$("#news-form").submit();
}
}
function submitFocus(obj)
{
$(obj).focus();
}
</script>
<span style="font-size: 16px; border-bottom:1px solid #f0f0f0; margin-right: 15px;">
@ -70,7 +75,7 @@
:html => {:id => 'news-form', :multipart => true} do |f| %>
<%= render :partial => 'news/course_form', :locals => {:f => f, :is_new => true} %>
<%#= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %><!-- button-submit -->
<%= link_to l(:button_create), "#", :onclick => 'submitNews();', :class => 'whiteButton m3p10' %>|
<%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'whiteButton m3p10' %>|
<%= preview_link preview_news_path(:course_id => @course), 'news-form', target='preview', {:class => 'whiteButton m3p10'} %>
|
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()', :class => 'whiteButton m3p10' %>