mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 00:15:46 +01:00
while you are editing a post you still need to write something dude
This commit is contained in:
@@ -245,12 +245,24 @@ var socket,
|
||||
};
|
||||
|
||||
app.edit_post = function(pid) {
|
||||
var content = document.getElementById('post_content');
|
||||
socket.emit('api:posts.edit', { pid: pid, content: content.value });
|
||||
var content = $('#post_content');
|
||||
|
||||
if (content.val().length < 5) {
|
||||
app.alert({
|
||||
title: 'Topic Post Failure',
|
||||
message: 'You need to write more dude.',
|
||||
type: 'error',
|
||||
timeout: 2000
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
socket.emit('api:posts.edit', { pid: pid, content: content.val() });
|
||||
|
||||
jQuery(post_window).slideUp(250);
|
||||
$(document.body).removeClass('composing');
|
||||
content.value = '';
|
||||
content.val('');
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user