v1.18.x
Julian Lam 9 years ago
parent 3e46ef8c35
commit 99e9508131

@ -6,8 +6,7 @@ define('forum/topic/move', function() {
var Move = {},
modal,
targetCid,
targetCategoryLabel;
selectedEl;
Move.init = function(tids, currentCid, onComplete) {
Move.tids = tids;
@ -70,6 +69,8 @@ define('forum/topic/move', function() {
}
categoryEl.toggleClass('disabled', !!category.disabled);
categoryEl.attr('data-cid', category.cid);
categoryEl.attr('data-icon', category.icon);
categoryEl.attr('data-name', category.name);
categoryEl.html('<i class="fa fa-fw ' + category.icon + '"></i> ' + category.name);
parentEl.append(level);
@ -88,15 +89,14 @@ define('forum/topic/move', function() {
modal.find('#confirm-category-name').html(category.html());
modal.find('#move-confirm').removeClass('hide');
targetCid = category.attr('data-cid');
targetCategoryLabel = category.html();
selectedEl = category;
modal.find('#move_thread_commit').prop('disabled', false);
}
function onCommitClicked() {
var commitEl = modal.find('#move_thread_commit');
if (!commitEl.prop('disabled') && targetCid) {
if (!commitEl.prop('disabled') && selectedEl.attr('data-cid')) {
commitEl.prop('disabled', true);
moveTopics();
@ -106,7 +106,7 @@ define('forum/topic/move', function() {
function moveTopics() {
socket.emit(Move.moveAll ? 'topics.moveAll' : 'topics.move', {
tids: Move.tids,
cid: targetCid,
cid: selectedEl.attr('data-cid'),
currentCid: Move.currentCid
}, function(err) {
modal.modal('hide');
@ -115,7 +115,7 @@ define('forum/topic/move', function() {
return app.alertError(err.message);
}
app.alertSuccess('[[topic:topic_move_success, ' + targetCategoryLabel + ']]');
app.alertSuccess('[[topic:topic_move_success, ' + selectedEl.attr('data-name') + ']] <i class="fa fa-fw ' + selectedEl.attr('data-icon') + '"></i>');
if (typeof Move.onComplete === 'function') {
Move.onComplete();
}

Loading…
Cancel
Save