#1941 问卷描述,当编辑时有输入空格行时,点击确定js不会刷新,而且不会对剪辑的格式进行存储

dev_repository_hjq
sw 10 years ago
parent e326934027
commit e58f5d4af5

@ -4,9 +4,14 @@
<input type="text" maxlength="100" name="polls_name" id="polls_title" value="<%= @poll.polls_name %>" class="input_title" placeholder="问卷标题"/>
</div>
<div class="ur_title_editor_prefix">
<textarea name="polls_description" maxlength="300" id="polls_description" class="textarea_editor"><%= @poll.polls_description%></textarea>
<div contenteditable="true" id="polls_description_div" class="ur_textbox" style="min-height: 150px;width: 100%;background-color: #ffffff" onkeyup="edit_head();">
<%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe%>
</div>
<textarea name="polls_description" maxlength="300" id="polls_description" class="textarea_editor" style="display: none">
<%= @poll.polls_description%>
</textarea>
</div>
<div class="ur_editor_footer">
<div class="ur_editor_footer" style="padding-top: 10px;">
<a class="btn_submit" data-button="ok" onclick="pollsSubmit($(this));">
<%= l(:label_button_ok)%>
</a>

@ -7,6 +7,11 @@
<%#= javascript_include_tag "polls" %>
<script type="text/javascript">
//编辑问卷描述之后
function edit_head(){
$("#polls_description").val($("#polls_description_div").html());
}
function add_MC(){
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MC') %>");
$("#poll_questions_title").focus();

@ -3,8 +3,6 @@
<h1 class="ur_page_title" id="polls_name_h">
<%= poll.polls_name%>
</h1>
<p class="ur_prefix_content" id="polls_description_p">
<%= @poll.polls_description%>
</p>
<%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe%>
<div class="cl"></div>
</div><!--头部显示 end-->

@ -34,7 +34,7 @@
<%= @poll.polls_name%>
</h1>
<p class="ur_prefix_content">
<%= @poll.polls_description %>
<%= @poll.polls_description.html_safe %>
</p>
</div>

@ -1,6 +1,4 @@
$("#polls_title").val("<%= @poll.polls_name%>");
$("#polls_description").val("<%= @poll.polls_description %>");
$("#polls_name_h").html("<%= @poll.polls_name %>");
$("#polls_description_p").html("<%= @poll.polls_description %>");
$("#polls_head_show").html("<%= escape_javascript(render :partial => 'show_head', :locals => {:poll => @poll}) %>");
$("#polls_head_edit").html("<%= escape_javascript(render :partial => 'edit_head', :locals => {:poll => @poll}) %>");
$("#polls_head_edit").hide();
$("#polls_head_show").show();
Loading…
Cancel
Save