...
This commit is contained in:
parent
4244c69b46
commit
8d82ecc89c
|
@ -66,6 +66,7 @@
|
||||||
:maxlength => 5000 %>
|
:maxlength => 5000 %>
|
||||||
|
|
||||||
<% else %>
|
<% else %>
|
||||||
|
<input nhname="init_content_val" value="<%=topic.content%>" type="hidden"/>
|
||||||
<%= f.text_area :content,
|
<%= f.text_area :content,
|
||||||
:width => '90%',
|
:width => '90%',
|
||||||
:height => 300,
|
:height => 300,
|
||||||
|
|
|
@ -180,8 +180,8 @@
|
||||||
if($.trim(params.content.html()) == ""){
|
if($.trim(params.content.html()) == ""){
|
||||||
result=false;
|
result=false;
|
||||||
}
|
}
|
||||||
if(params.content.html()!=params.textarea.html()){
|
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
|
||||||
params.content.sync();
|
params.textarea.html(params.content.html());
|
||||||
if($.trim(params.content.html()) == ""){
|
if($.trim(params.content.html()) == ""){
|
||||||
params.contentmsg.html('内容不能为空');
|
params.contentmsg.html('内容不能为空');
|
||||||
params.contentmsg.css({color:'#ff0000'});
|
params.contentmsg.css({color:'#ff0000'});
|
||||||
|
@ -218,6 +218,7 @@
|
||||||
//表单提交
|
//表单提交
|
||||||
params.form.submit(function(){
|
params.form.submit(function(){
|
||||||
var is_checked = nh_check_field({
|
var is_checked = nh_check_field({
|
||||||
|
issubmit:true,
|
||||||
subject:params.inputsubject,
|
subject:params.inputsubject,
|
||||||
subjectmsg:params.subjectmsg,
|
subjectmsg:params.subjectmsg,
|
||||||
content:editor,
|
content:editor,
|
||||||
|
@ -225,7 +226,7 @@
|
||||||
textarea:params.textarea
|
textarea:params.textarea
|
||||||
});
|
});
|
||||||
if(is_checked){
|
if(is_checked){
|
||||||
alert('submit');
|
// alert('submit');
|
||||||
// return false;
|
// return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -240,7 +241,11 @@
|
||||||
params.about_talk.toggle();//显示/隐藏编辑区
|
params.about_talk.toggle();//显示/隐藏编辑区
|
||||||
if(params.about_talk.is(':hidden')){//隐藏时reset表单数据
|
if(params.about_talk.is(':hidden')){//隐藏时reset表单数据
|
||||||
params.form[0].reset();
|
params.form[0].reset();
|
||||||
params.textarea.empty();
|
if(params.type=='reply'){
|
||||||
|
params.textarea.empty();
|
||||||
|
}else{
|
||||||
|
params.textarea.html(params.init_content_val.val());
|
||||||
|
}
|
||||||
editor.html(params.textarea.html());
|
editor.html(params.textarea.html());
|
||||||
params.subjectmsg.hide();
|
params.subjectmsg.hide();
|
||||||
params.contentmsg.hide();
|
params.contentmsg.hide();
|
||||||
|
@ -305,7 +310,8 @@
|
||||||
contentmsg:$("p[nhname='contentmsg']",about_talk),
|
contentmsg:$("p[nhname='contentmsg']",about_talk),
|
||||||
submitbtn:$("a[nhname='submitbtn']",about_talk),
|
submitbtn:$("a[nhname='submitbtn']",about_talk),
|
||||||
cancelbtn:$("a[nhname='cancelbtn']",about_talk),
|
cancelbtn:$("a[nhname='cancelbtn']",about_talk),
|
||||||
form:$("form[nhname='form']",about_talk)
|
form:$("form[nhname='form']",about_talk),
|
||||||
|
init_content_val:$("input[nhname='init_content_val']",about_talk)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$("div[mhname='container_board_reply']").each(function(){
|
$("div[mhname='container_board_reply']").each(function(){
|
||||||
|
|
Loading…
Reference in New Issue