mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-30 16:49:58 +09:00
Redirect to document URL with category if, and only if, the write page was loaded with a category and the document was saved to the same category #2346
This commit is contained in:
parent
3a91bc3038
commit
1d36b3e77a
2 changed files with 13 additions and 14 deletions
|
|
@ -7,27 +7,25 @@
|
|||
/* complete tp insert document */
|
||||
function completeDocumentInserted(ret_obj)
|
||||
{
|
||||
var error = ret_obj.error;
|
||||
var message = ret_obj.message;
|
||||
var mid = ret_obj.mid;
|
||||
var document_srl = ret_obj.document_srl;
|
||||
var category_srl = ret_obj.category_srl;
|
||||
var current_category_srl = parseInt(current_url.getQuery('category'), 10);
|
||||
var url;
|
||||
|
||||
if (ret_obj.redirect_url) {
|
||||
redirect(ret_obj.redirect_url);
|
||||
url = ret_obj.redirect_url;
|
||||
} else {
|
||||
var url;
|
||||
if(!document_srl)
|
||||
{
|
||||
url = current_url.setQuery('mid',mid).setQuery('act','');
|
||||
url = current_url.setQuery('mid', mid).setQuery('act', '');
|
||||
if (document_srl) {
|
||||
url = url.setQuery('document_srl', document_srl);
|
||||
}
|
||||
else
|
||||
{
|
||||
url = current_url.setQuery('mid',mid).setQuery('document_srl',document_srl).setQuery('act','');
|
||||
}
|
||||
if(category_srl) url = url.setQuery('category',category_srl);
|
||||
redirect(url);
|
||||
}
|
||||
|
||||
if (current_category_srl && category_srl && current_category_srl == category_srl) {
|
||||
url = url.setQuery('category', current_category_srl);
|
||||
}
|
||||
redirect(url);
|
||||
}
|
||||
|
||||
/* delete the document */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue