Cleaning up code -- removed unnecessary lines, fixed indentation, renamed method.
This commit is contained in:
@@ -14,10 +14,6 @@ def create_component_instance(step, component_button_css, instance_id, expected_
|
||||
|
||||
@world.absorb
|
||||
def click_new_component_button(step, component_button_css):
|
||||
# step.given('I have opened a new course section in Studio')
|
||||
# step.given('I have added a new subsection')
|
||||
# step.given('I expand the first section')
|
||||
# world.css_click('a.new-unit-item')
|
||||
step.given('I have clicked the new unit button')
|
||||
world.css_click(component_button_css)
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ def does_not_autoplay(step):
|
||||
|
||||
|
||||
@step('creating a video takes a single click')
|
||||
def click_new_component_button(step):
|
||||
def video_takes_a_single_click(step):
|
||||
assert(not world.is_css_present('.xmodule_VideoModule'))
|
||||
world.css_click("a[data-location='i4x://edx/templates/video/default']")
|
||||
assert(world.is_css_present('.xmodule_VideoModule'))
|
||||
|
||||
@@ -65,9 +65,6 @@ class CMS.Views.UnitEdit extends Backbone.View
|
||||
event.preventDefault()
|
||||
|
||||
type = $(event.currentTarget).data('type')
|
||||
if type == 'video'
|
||||
$('.new-component-video .new-component-template a').click()
|
||||
return
|
||||
@$newComponentTypePicker.slideUp(250)
|
||||
@$(".new-component-#{type}").slideDown(250)
|
||||
$('html, body').animate({
|
||||
|
||||
@@ -54,16 +54,16 @@
|
||||
<h5>Add New Component</h5>
|
||||
<ul class="new-component-type">
|
||||
% for type, templates in sorted(component_templates.items()):
|
||||
<li>
|
||||
% if type == 'advanced' or len(templates) > 1:
|
||||
<a href="#" class="multiple_templates" data-type="${type}">
|
||||
% else:
|
||||
<a href="#" class="single_template" data-type="${type}" data-location="${templates[0][1]}">
|
||||
% endif
|
||||
<span class="large-template-icon large-${type}-icon"></span>
|
||||
<span class="name">${type}</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
% if type == 'advanced' or len(templates) > 1:
|
||||
<a href="#" class="multiple_templates" data-type="${type}">
|
||||
% else:
|
||||
<a href="#" class="single_template" data-type="${type}" data-location="${templates[0][1]}">
|
||||
% endif
|
||||
<span class="large-template-icon large-${type}-icon"></span>
|
||||
<span class="name">${type}</span>
|
||||
</a>
|
||||
</li>
|
||||
% endfor
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user