v1.18.x
Baris Usakli 7 years ago
parent 61e408b4a2
commit 4fbec0265b

@ -69,9 +69,9 @@
"nodebb-plugin-spam-be-gone": "0.5.1",
"nodebb-rewards-essentials": "0.0.10",
"nodebb-theme-lavender": "5.0.0",
"nodebb-theme-persona": "7.2.16",
"nodebb-theme-persona": "7.2.17",
"nodebb-theme-slick": "1.1.2",
"nodebb-theme-vanilla": "8.1.7",
"nodebb-theme-vanilla": "8.1.8",
"nodebb-widget-essentials": "4.0.1",
"nodemailer": "4.4.1",
"passport": "^0.4.0",

@ -4,45 +4,37 @@
define('forum/topic/move-post', [], function () {
var MovePost = {};
MovePost.openMovePostModal = function (button) {
app.parseAndTranslate('partials/move_post_modal', {}, function (html) {
var moveModal = $(html);
var moveBtn = moveModal.find('#move_post_commit');
var topicId = moveModal.find('#topicId');
moveModal.on('hidden.bs.modal', function () {
moveModal.remove();
});
showMoveModal(moveModal);
moveModal.find('.close, #move_post_cancel').on('click', function () {
moveModal.addClass('hide');
});
topicId.on('keyup change', function () {
moveBtn.attr('disabled', !topicId.val());
var dialog = bootbox.dialog({
title: '[[topic:move_post]]',
message: html,
show: true,
buttons: {
submit: {
label: '[[topic:confirm_move]]',
className: 'btn-primary submit-btn',
callback: function () {
var topicIdEl = dialog.find('#topicId');
if (!topicIdEl.val()) {
return;
}
movePost(button.parents('[data-pid]'), button.parents('[data-pid]').attr('data-pid'), topicIdEl.val(), function () {
topicId.val('');
});
},
},
},
});
dialog.find('.submit-btn').attr('disabled', true);
moveBtn.on('click', function () {
movePost(button.parents('[data-pid]'), button.parents('[data-pid]').attr('data-pid'), topicId.val(), function () {
moveModal.modal('hide');
topicId.val('');
});
dialog.find('#topicId').on('keyup change', function () {
dialog.find('.submit-btn').attr('disabled', !dialog.find('#topicId').val());
});
});
};
function showMoveModal(modal) {
modal.modal('show')
.css('position', 'fixed')
.css('left', Math.max(0, (($(window).width() - modal.outerWidth()) / 2) + $(window).scrollLeft()) + 'px')
.css('top', '0px')
.css('z-index', '2000');
}
function movePost(post, pid, tid, callback) {
socket.emit('posts.movePost', { pid: pid, tid: tid }, function (err) {
if (err) {

Loading…
Cancel
Save