0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Merge pull request #602 from jgable/fixCtrlS

Fix Ctrl-S saving
This commit is contained in:
Hannah Wolfe 2013-09-03 13:00:52 -07:00
commit 415ba7bcf5

View file

@ -53,7 +53,7 @@
events: {
'click [data-set-status]': 'handleStatus',
'click .js-post-button': 'updatePost'
'click .js-post-button': 'handlePostButton'
},
statusMap: {
@ -137,14 +137,22 @@
$('body').find('.overlay:visible').fadeOut();
},
updatePost: function (e) {
if (e) { e.preventDefault(); }
handlePostButton: function (e) {
e.preventDefault();
var status = $(e.currentTarget).attr("data-status");
this.updatePost(status);
},
updatePost: function (status) {
var self = this,
model = this.model,
$currentTarget = $(e.currentTarget),
status = $currentTarget.attr('data-status'),
prevStatus = model.get('status');
// Default to same status if not passed in
status = status || prevStatus;
if (status === 'publish-on') {
return Ghost.notifications.addItem({
type: 'alert',