Commit d223e5ba by Ben McMorran Committed by cahrens

Fixes view and preview buttons on unit page

parent bfb6db76
......@@ -62,8 +62,8 @@ define(["jquery", "underscore", "underscore.string", "js/spec_helpers/create_sin
};
describe("PreviewActionController", function () {
var viewPublishedCss = '.view-button',
previewCss = '.preview-button';
var viewPublishedCss = '.button-view',
previewCss = '.button-preview';
it('renders correctly for private unit', function () {
renderContainerPage(mockContainerXBlockHtml, this);
......
......@@ -32,8 +32,8 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "js/views/utils/
var PreviewActionController = UnitStateListenerView.extend({
render: function() {
var previewAction = this.$el.find('.preview-button'),
viewLiveAction = this.$el.find('.view-button');
var previewAction = this.$el.find('.button-preview'),
viewLiveAction = this.$el.find('.button-view');
if (this.model.get('published')) {
viewLiveAction.removeClass(disabledCss);
}
......
......@@ -16,12 +16,12 @@
<ul>
% if is_unit_page:
<li class="action-item action-view nav-item">
<a href="${published_preview_link}" class="button view-button action-button is-disabled">
<a href="${published_preview_link}" class="button button-view action-button is-disabled">
<span class="action-button-text">${_("View Published Version")}</span>
</a>
</li>
<li class="action-item action-preview nav-item">
<a href="${draft_preview_link}" class="button preview-button action-button is-disabled">
<a href="${draft_preview_link}" class="button button-preview action-button is-disabled">
<span class="action-button-text">${_("Preview Changes")}</span>
</a>
</li>
......
......@@ -102,7 +102,7 @@ class ContainerPage(PageObject):
Switches the browser to the newly opened LMS window.
"""
self.q(css='.view-button').first.click()
self.q(css='.button-view').first.click()
self._switch_to_lms()
def preview(self):
......@@ -111,7 +111,7 @@ class ContainerPage(PageObject):
Switches the browser to the newly opened LMS window.
"""
self.q(css='.preview-button').first.click()
self.q(css='.button-preview').first.click()
self._switch_to_lms()
def _switch_to_lms(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment