mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
Merge pull request #569 from gotdibbs/Issue469
Strip whitespace on post titles
This commit is contained in:
commit
a4153b416b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user