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-plugin-spam-be-gone": "0.5.1",
"nodebb-rewards-essentials": "0.0.10", "nodebb-rewards-essentials": "0.0.10",
"nodebb-theme-lavender": "5.0.0", "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-slick": "1.1.2",
"nodebb-theme-vanilla": "8.1.7", "nodebb-theme-vanilla": "8.1.8",
"nodebb-widget-essentials": "4.0.1", "nodebb-widget-essentials": "4.0.1",
"nodemailer": "4.4.1", "nodemailer": "4.4.1",
"passport": "^0.4.0", "passport": "^0.4.0",

@ -4,45 +4,37 @@
define('forum/topic/move-post', [], function () { define('forum/topic/move-post', [], function () {
var MovePost = {}; var MovePost = {};
MovePost.openMovePostModal = function (button) { MovePost.openMovePostModal = function (button) {
app.parseAndTranslate('partials/move_post_modal', {}, function (html) { app.parseAndTranslate('partials/move_post_modal', {}, function (html) {
var moveModal = $(html); var dialog = bootbox.dialog({
title: '[[topic:move_post]]',
var moveBtn = moveModal.find('#move_post_commit'); message: html,
var topicId = moveModal.find('#topicId'); show: true,
buttons: {
moveModal.on('hidden.bs.modal', function () { submit: {
moveModal.remove(); label: '[[topic:confirm_move]]',
}); className: 'btn-primary submit-btn',
callback: function () {
showMoveModal(moveModal); var topicIdEl = dialog.find('#topicId');
if (!topicIdEl.val()) {
moveModal.find('.close, #move_post_cancel').on('click', function () { return;
moveModal.addClass('hide'); }
});
movePost(button.parents('[data-pid]'), button.parents('[data-pid]').attr('data-pid'), topicIdEl.val(), function () {
topicId.on('keyup change', function () { topicId.val('');
moveBtn.attr('disabled', !topicId.val()); });
},
},
},
}); });
dialog.find('.submit-btn').attr('disabled', true);
moveBtn.on('click', function () { dialog.find('#topicId').on('keyup change', function () {
movePost(button.parents('[data-pid]'), button.parents('[data-pid]').attr('data-pid'), topicId.val(), function () { dialog.find('.submit-btn').attr('disabled', !dialog.find('#topicId').val());
moveModal.modal('hide');
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) { function movePost(post, pid, tid, callback) {
socket.emit('posts.movePost', { pid: pid, tid: tid }, function (err) { socket.emit('posts.movePost', { pid: pid, tid: tid }, function (err) {
if (err) { if (err) {

Loading…
Cancel
Save