mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03: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
d2cafe87b6
commit
67901ff699
@ -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…
Reference in New Issue
Block a user