diff --git a/core/client/views/editor.js b/core/client/views/editor.js index e5bb1e3a61..367eebe91b 100644 --- a/core/client/views/editor.js +++ b/core/client/views/editor.js @@ -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',