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 ...@@ -62,8 +62,8 @@ define(["jquery", "underscore", "underscore.string", "js/spec_helpers/create_sin
}; };
describe("PreviewActionController", function () { describe("PreviewActionController", function () {
var viewPublishedCss = '.view-button', var viewPublishedCss = '.button-view',
previewCss = '.preview-button'; previewCss = '.button-preview';
it('renders correctly for private unit', function () { it('renders correctly for private unit', function () {
renderContainerPage(mockContainerXBlockHtml, this); renderContainerPage(mockContainerXBlockHtml, this);
......
...@@ -32,8 +32,8 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "js/views/utils/ ...@@ -32,8 +32,8 @@ define(["jquery", "underscore", "gettext", "js/views/baseview", "js/views/utils/
var PreviewActionController = UnitStateListenerView.extend({ var PreviewActionController = UnitStateListenerView.extend({
render: function() { render: function() {
var previewAction = this.$el.find('.preview-button'), var previewAction = this.$el.find('.button-preview'),
viewLiveAction = this.$el.find('.view-button'); viewLiveAction = this.$el.find('.button-view');
if (this.model.get('published')) { if (this.model.get('published')) {
viewLiveAction.removeClass(disabledCss); viewLiveAction.removeClass(disabledCss);
} }
......
...@@ -16,12 +16,12 @@ ...@@ -16,12 +16,12 @@
<ul> <ul>
% if is_unit_page: % if is_unit_page:
<li class="action-item action-view nav-item"> <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> <span class="action-button-text">${_("View Published Version")}</span>
</a> </a>
</li> </li>
<li class="action-item action-preview nav-item"> <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> <span class="action-button-text">${_("Preview Changes")}</span>
</a> </a>
</li> </li>
......
...@@ -102,7 +102,7 @@ class ContainerPage(PageObject): ...@@ -102,7 +102,7 @@ class ContainerPage(PageObject):
Switches the browser to the newly opened LMS window. 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() self._switch_to_lms()
def preview(self): def preview(self):
...@@ -111,7 +111,7 @@ class ContainerPage(PageObject): ...@@ -111,7 +111,7 @@ class ContainerPage(PageObject):
Switches the browser to the newly opened LMS window. 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() self._switch_to_lms()
def _switch_to_lms(self): 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