Merge pull request #569 from gotdibbs/Issue469

Strip whitespace on post titles
This commit is contained in:
Hannah Wolfe 2013-08-30 07:23:13 -07:00
commit a4153b416b

View File

@ -284,7 +284,8 @@
},
events: {
'click .markdown-help': 'showHelp'
'click .markdown-help': 'showHelp',
'blur #entry-title': 'trimTitle'
},
syncScroll: _.debounce(function (e) {
@ -320,6 +321,16 @@
}));
},
trimTitle: function () {
var $title = $('#entry-title'),
rawTitle = $title.val(),
trimmedTitle = $.trim(rawTitle);
if (rawTitle !== trimmedTitle) {
$title.val(trimmedTitle);
}
},
// This updates the editor preview panel.
// Currently gets called on every key press.
// Also trigger word count update