MDL-57270 core_message: trim message before it is sent

This commit is contained in:
Mark Nelson
2016-12-14 12:19:24 +08:00
parent 44047dc78d
commit f927f3e196
2 changed files with 3 additions and 3 deletions
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -393,10 +393,10 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/cust
*/
Messages.prototype._sendMessage = function() {
var element = this.messageArea.find(SELECTORS.SENDMESSAGETEXT);
var text = element.val();
var text = element.val().trim();
// Do not do anything if it is empty.
if (text.trim() === '') {
if (text === '') {
return false;
}