From 2329b34be762b65e331007ad7d3f754879d1b1ba 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. --- core/client/views/editor.js | 11 +++++++++-- core/test/unit/export_spec.js | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/core/client/views/editor.js b/core/client/views/editor.js index 2d5f8e9b36..9f61b3c887 100644 --- a/core/client/views/editor.js +++ b/core/client/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]); } }); diff --git a/core/test/unit/export_spec.js b/core/test/unit/export_spec.js index 156560bb73..89d32296f6 100644 --- a/core/test/unit/export_spec.js +++ b/core/test/unit/export_spec.js @@ -86,7 +86,8 @@ describe("Export", function () { }); describe("002", function () { - + this.timeout(5000); + should.exist(Exporter001); it("exports data", function (done) {