mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Fix Ctrl-S saving
Refactored into separate button handler that passes the status. Although, it doesn't look like the status is on the button element any more.
This commit is contained in:
parent
14d4145514
commit
6cfea08faf
1 changed files with 13 additions and 5 deletions
|
@ -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',
|
||||
|
|
Loading…
Add table
Reference in a new issue