Skip to content

Node.js based forum software built for the modern web

closes #6254

Baris Usakli4fbec0265b6b
diff --git a/install/package.json b/install/package.json
index f2ca43c0ac..39dc439a44 100644
--- a/install/package.json
+++ b/install/package.json
@@ -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",
diff --git a/public/src/client/topic/move-post.js b/public/src/client/topic/move-post.js
index bd9d542ead..91ea917f69 100644
--- a/public/src/client/topic/move-post.js
+++ b/public/src/client/topic/move-post.js
@@ -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) {