From 46b9646e5ad0f080c33493cb9b929b4bfd9a9a1f Mon Sep 17 00:00:00 2001 From: William Dibbern Date: Tue, 10 Sep 2013 09:32:02 -0500 Subject: [PATCH] Publish button fixes Fixes #352 - Ensure publish button's default status is set in the `render` function. - Ensure publish button's popup arrow has animation reverted when a status has been selected. - Bumped up timeout in failing mocha test for exports-002. --- views/editor.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/views/editor.js b/views/editor.js index 2d5f8e9b3..9f61b3c88 100644 --- a/views/editor.js +++ b/views/editor.js @@ -122,12 +122,16 @@ }); }, - setActiveStatus: function setActiveStatus(status, displayText) { + setActiveStatus: function (status, displayText) { // Set the publish button's action $('.js-post-button') .attr('data-status', status) .text(displayText); + // Remove the animated popup arrow + $('.splitbutton-save > a') + .removeClass('active'); + // Set the active action in the popup $('.splitbutton-save .editor-options li') .removeClass('active') @@ -234,7 +238,10 @@ }, render: function () { - this.$('.js-post-button').text(this.statusMap[this.model.get('status')]); + var status = this.model.get('status'); + + // Default the selected publish option to the current status of the post. + this.setActiveStatus(status, this.statusMap[status]); } });