diff --git a/ghost/admin/views/editor.js b/ghost/admin/views/editor.js index d7872b21f7..8463684fd9 100644 --- a/ghost/admin/views/editor.js +++ b/ghost/admin/views/editor.js @@ -60,7 +60,7 @@ events: { 'click [data-set-status]': 'handleStatus', - 'click .js-post-button': 'updatePost' + 'click .js-post-button': 'handlePostButton' }, statusMap: { @@ -144,14 +144,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',