From 663828301e48000ad7f0b4604765592a0f0af28f Mon Sep 17 00:00:00 2001 From: lqs469 Date: Sat, 17 Mar 2018 22:16:34 +0800 Subject: [PATCH] No allow reply null --- app/view/topic/index.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/view/topic/index.html b/app/view/topic/index.html index b7da4d9b..4a799f76 100644 --- a/app/view/topic/index.html +++ b/app/view/topic/index.html @@ -210,6 +210,14 @@ $el.closest('form').submit(); } }); + $el.closest('form').on('submit', function (event) { + const value = editor.codemirror.getValue(); + if (!value) { + event.preventDefault(); + $el.closest('form').find('.submit_btn').button('reset'); + alert('回复内容不能为空!'); + } + }); // at.js 配置 var codeMirrorGoLineUp = CodeMirror.commands.goLineUp; var codeMirrorGoLineDown = CodeMirror.commands.goLineDown;