0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -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 4059747424

View file

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