mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +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: {
|
events: {
|
||||||
'click [data-set-status]': 'handleStatus',
|
'click [data-set-status]': 'handleStatus',
|
||||||
'click .js-post-button': 'updatePost'
|
'click .js-post-button': 'handlePostButton'
|
||||||
},
|
},
|
||||||
|
|
||||||
statusMap: {
|
statusMap: {
|
||||||
@ -144,14 +144,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',
|
||||||
|
Loading…
Reference in New Issue
Block a user