블로그의 댓글 성공시 자바스크립트로 페이지 이동할때 이동이 없던 문제 해결

git-svn-id: http://xe-core.googlecode.com/svn/trunk@1970 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-07-20 02:24:40 +00:00
parent 7acd1fc4df
commit 0722383917
4 changed files with 12 additions and 8 deletions

View file

@ -105,9 +105,6 @@
// comment 모듈의 controller 객체 생성
$oCommentController = &getController('comment');
// comment_srl이 존재하는지 체크
$comment = $oCommentModel->getComment($obj->comment_srl, $this->grant->manager);
// 줄바꾸임나 태그제거등의 작업
$obj->content = nl2br(strip_tags($obj->content));
@ -144,10 +141,11 @@
if(!$output->toBool()) return $output;
$this->setMessage('success_registed');
$this->add('mid', Context::get('mid'));
$this->add('document_srl', $obj->document_srl);
$this->add('comment_srl', $comment_srl);
$this->add('comment_srl', $obj->comment_srl);
$this->setMessage('success_registed');
}
/**

View file

@ -51,9 +51,12 @@ function completeReload(ret_obj) {
function completeInsertComment(ret_obj) {
var error = ret_obj['error'];
var message = ret_obj['message'];
var comment_srl = ret_obj['comment_srl'];
alert(message);
location.href = current_url.setQuery('comment_srl','').setQuery('act','');
var url = current_url.setQuery('comment_srl','').setQuery('act','').setQuery('rnd',comment_srl);
if(comment_srl) url += '#comment_'+comment_srl;
location.href = url;
}
/* 댓글 삭제 */

View file

@ -57,9 +57,12 @@ function doCommentSubmit() {
function completeInsertComment(ret_obj) {
var error = ret_obj['error'];
var message = ret_obj['message'];
var comment_srl = ret_obj['comment_srl'];
alert(message);
location.href = current_url.setQuery('comment_srl','').setQuery('act','');
var url = current_url.setQuery('comment_srl','').setQuery('act','').setQuery('rnd',comment_srl);
if(comment_srl) url += '#comment_'+comment_srl;
location.href = url;
}
/* 댓글 삭제 */

View file

@ -56,4 +56,4 @@
<!--@if($module=="admin")-->
<a href="{getUrl('act','dispBlogAdminContent','module_srl','')}" class="button"><span>{$lang->cmd_blog_list}</span></a>
<!--@end-->
</ul>
</div>