mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
commit
4059747424
1 changed files with 13 additions and 5 deletions
|
@ -53,7 +53,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: {
|
||||||
|
@ -137,14 +137,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…
Add table
Reference in a new issue