mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-14 09:55:47 +01:00
closes #4911
This commit is contained in:
@@ -57,8 +57,8 @@
|
||||
"nodebb-plugin-spam-be-gone": "0.4.9",
|
||||
"nodebb-rewards-essentials": "0.0.9",
|
||||
"nodebb-theme-lavender": "3.0.13",
|
||||
"nodebb-theme-persona": "4.1.13",
|
||||
"nodebb-theme-vanilla": "5.1.4",
|
||||
"nodebb-theme-persona": "4.1.14",
|
||||
"nodebb-theme-vanilla": "5.1.5",
|
||||
"nodebb-widget-essentials": "2.0.10",
|
||||
"nodemailer": "2.0.0",
|
||||
"nodemailer-sendmail-transport": "1.0.0",
|
||||
|
||||
@@ -101,6 +101,7 @@
|
||||
"topic_will_be_moved_to": "This topic will be moved to the category",
|
||||
"fork_topic_instruction": "Click the posts you want to fork",
|
||||
"fork_no_pids": "No posts selected!",
|
||||
"fork_pid_count": "%1 post(s) selected",
|
||||
"fork_success": "Successfully forked topic! Click here to go to the forked topic.",
|
||||
"delete_posts_instruction": "Click the posts you want to delete/purge",
|
||||
|
||||
|
||||
@@ -16,16 +16,12 @@ define('forum/topic/fork', ['components', 'postSelect'], function(components, po
|
||||
parseModal(function(html) {
|
||||
forkModal = $(html);
|
||||
|
||||
forkModal.on('hidden.bs.modal', function() {
|
||||
forkModal.remove();
|
||||
});
|
||||
|
||||
forkCommit = forkModal.find('#fork_thread_commit');
|
||||
|
||||
showForkModal();
|
||||
$(document.body).append(forkModal);
|
||||
|
||||
forkModal.find('.close,#fork_thread_cancel').on('click', closeForkModal);
|
||||
forkModal.find('#fork-title').on('change', checkForkButtonEnable);
|
||||
forkModal.find('#fork-title').on('keyup', checkForkButtonEnable);
|
||||
|
||||
postSelect.init(function() {
|
||||
checkForkButtonEnable();
|
||||
@@ -43,14 +39,6 @@ define('forum/topic/fork', ['components', 'postSelect'], function(components, po
|
||||
});
|
||||
}
|
||||
|
||||
function showForkModal() {
|
||||
forkModal.modal({backdrop: false, show: true})
|
||||
.css('position', 'fixed')
|
||||
.css('left', Math.max(0, (($(window).width() - forkModal.outerWidth()) / 2) + $(window).scrollLeft()) + 'px')
|
||||
.css('top', '0px')
|
||||
.css('z-index', '2000');
|
||||
}
|
||||
|
||||
function createTopicFromPosts() {
|
||||
forkCommit.attr('disabled', true);
|
||||
socket.emit('topics.createTopicFromPosts', {
|
||||
@@ -88,14 +76,14 @@ define('forum/topic/fork', ['components', 'postSelect'], function(components, po
|
||||
|
||||
function showPostsSelected() {
|
||||
if (postSelect.pids.length) {
|
||||
forkModal.find('#fork-pids').text(postSelect.pids.join(', '));
|
||||
forkModal.find('#fork-pids').translateHtml('[[topic:fork_pid_count, ' + postSelect.pids.length + ']]');
|
||||
} else {
|
||||
forkModal.find('#fork-pids').translateHtml('[[topic:fork_no_pids]]');
|
||||
}
|
||||
}
|
||||
|
||||
function checkForkButtonEnable() {
|
||||
if (forkModal.find('#fork-title').length && postSelect.pids.length) {
|
||||
if (forkModal.find('#fork-title').val().length && postSelect.pids.length) {
|
||||
forkCommit.removeAttr('disabled');
|
||||
} else {
|
||||
forkCommit.attr('disabled', true);
|
||||
@@ -104,10 +92,10 @@ define('forum/topic/fork', ['components', 'postSelect'], function(components, po
|
||||
|
||||
function closeForkModal() {
|
||||
postSelect.pids.forEach(function(pid) {
|
||||
components.get('post', 'pid', pid).css('opacity', 1);
|
||||
components.get('post', 'pid', pid).toggleClass('bg-success', false);
|
||||
});
|
||||
|
||||
forkModal.modal('hide');
|
||||
forkModal.remove();
|
||||
|
||||
components.get('topic').off('click', '[data-pid]');
|
||||
postSelect.enableClicksOnPosts();
|
||||
|
||||
@@ -27,10 +27,10 @@ define('postSelect', ['components'], function(components) {
|
||||
var index = PostSelect.pids.indexOf(newPid);
|
||||
if(index === -1) {
|
||||
PostSelect.pids.push(newPid);
|
||||
post.css('opacity', '0.5');
|
||||
post.toggleClass('bg-success', true);
|
||||
} else {
|
||||
PostSelect.pids.splice(index, 1);
|
||||
post.css('opacity', '1.0');
|
||||
post.toggleClass('bg-success', false);
|
||||
}
|
||||
|
||||
if (PostSelect.pids.length) {
|
||||
|
||||
Reference in New Issue
Block a user