mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 07:20:27 +01:00
fixed around event handling for composer submit button, and upped vanilla minver
This commit is contained in:
@@ -46,7 +46,7 @@
|
|||||||
"nodebb-plugin-soundpack-default": "~0.1.1",
|
"nodebb-plugin-soundpack-default": "~0.1.1",
|
||||||
"nodebb-plugin-spam-be-gone": "^0.4.0",
|
"nodebb-plugin-spam-be-gone": "^0.4.0",
|
||||||
"nodebb-theme-lavender": "^1.0.22",
|
"nodebb-theme-lavender": "^1.0.22",
|
||||||
"nodebb-theme-vanilla": "^1.0.65",
|
"nodebb-theme-vanilla": "^1.0.80",
|
||||||
"nodebb-widget-essentials": "~0.2.12",
|
"nodebb-widget-essentials": "~0.2.12",
|
||||||
"nodebb-rewards-essentials": "^0.0.1",
|
"nodebb-rewards-essentials": "^0.0.1",
|
||||||
"npm": "^2.1.4",
|
"npm": "^2.1.4",
|
||||||
|
|||||||
@@ -301,7 +301,8 @@ define('composer', [
|
|||||||
|
|
||||||
var postContainer = $(composerTemplate[0]),
|
var postContainer = $(composerTemplate[0]),
|
||||||
bodyEl = postContainer.find('textarea'),
|
bodyEl = postContainer.find('textarea'),
|
||||||
draft = drafts.getDraft(postData.save_id);
|
draft = drafts.getDraft(postData.save_id),
|
||||||
|
submitBtn = postContainer.find('.composer-submit');
|
||||||
|
|
||||||
tags.init(postContainer, composer.posts[post_uuid]);
|
tags.init(postContainer, composer.posts[post_uuid]);
|
||||||
categoryList.init(postContainer, composer.posts[post_uuid]);
|
categoryList.init(postContainer, composer.posts[post_uuid]);
|
||||||
@@ -325,17 +326,31 @@ define('composer', [
|
|||||||
composer.posts[post_uuid].modified = true;
|
composer.posts[post_uuid].modified = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
postContainer.on('click', '[data-action="post"]', function() {
|
submitBtn.on('click', function() {
|
||||||
$(this).attr('disabled', true);
|
var action = $(this).attr('data-action');
|
||||||
post(post_uuid);
|
|
||||||
});
|
|
||||||
|
|
||||||
postContainer.on('click', '[data-action="post-lock"]', function() {
|
switch(action) {
|
||||||
|
case 'post-lock':
|
||||||
$(this).attr('disabled', true);
|
$(this).attr('disabled', true);
|
||||||
post(post_uuid, {lock: true});
|
post(post_uuid, {lock: true});
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'post': // intentional fall-through
|
||||||
|
default:
|
||||||
|
$(this).attr('disabled', true);
|
||||||
|
post(post_uuid);
|
||||||
|
break;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
postContainer.on('click', '[data-action="discard"]', function() {
|
postContainer.on('click', 'a[data-switch-action]', function() {
|
||||||
|
var action = $(this).attr('data-switch-action'),
|
||||||
|
label = $(this).html();
|
||||||
|
|
||||||
|
submitBtn.attr('data-action', action).html(label);
|
||||||
|
});
|
||||||
|
|
||||||
|
postContainer.find('.composer-discard').on('click', function() {
|
||||||
if (!composer.posts[post_uuid].modified) {
|
if (!composer.posts[post_uuid].modified) {
|
||||||
discard(post_uuid);
|
discard(post_uuid);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user