Skip to content

Commit

Permalink
Fix cancel action issue for post status. Cancelling a modified status…
Browse files Browse the repository at this point in the history
… was not taken into account.
  • Loading branch information
jlambe committed Jun 26, 2015
1 parent 3db74c9 commit 0c948e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Themosis/PostType/PostTypeBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function status($status, array $args = [])
}
}

return;
return $this;
}

// Set default arguments
Expand Down
9 changes: 8 additions & 1 deletion src/Themosis/_assets/js/_themosis-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@

var button = $(this);

// If 'save' button, update label span with status label.
// If 'ok' button, update label span with status label.
if (button.hasClass('save-post-status'))
{
// Grab selected label.
Expand All @@ -1365,6 +1365,13 @@
publishButton.val(publishText);
}

// If 'cancel' button, make sure to reset the select tag value.
if (button.hasClass('cancel-post-status'))
{
var selected = selectTag.find('option[selected="selected"]');
selectTag.val(selected.val());
}

// Show back edit button.
editButton.show();

Expand Down

0 comments on commit 0c948e7

Please sign in to comment.