update url with new slug on topic title edit
v1.18.x
barisusakli 10 years ago
parent 5c59aa7737
commit 45bf5de1e5

@ -1,7 +1,7 @@
'use strict';
/* globals app, ajaxify, define, socket, templates */
/* globals config, app, ajaxify, define, socket, templates */
define('forum/topic/events', [
'forum/topic/browsing',
@ -101,6 +101,9 @@ define('forum/topic/events', [
topicTitle = components.get('topic/title');
if (topicTitle.length && data.title) {
var newUrl = 'topic/' + data.slug + (window.location.search ? window.location.search : '');
history.replaceState({url: newUrl}, null, window.location.protocol + '//' + window.location.host + config.relative_path + '/' + newUrl);
topicTitle.fadeOut(250, function() {
topicTitle.html(data.title).fadeIn(250);
});

@ -115,6 +115,7 @@ var cache = LRU({
cid: results.cid,
uid: postData.uid,
title: validator.escape(title),
slug: topicData.slug,
isMainPost: results.isMain,
tags: tags
});

@ -310,6 +310,7 @@ SocketPosts.edit = function(socket, data, callback) {
pid: data.pid,
handle: data.handle,
title: results.topic.title,
slug: results.topic.slug,
isMainPost: results.topic.isMainPost,
tags: results.topic.tags,
content: results.content

Loading…
Cancel
Save