Merge branch 'MDL-43941-26' of git://github.com/andrewnicols/moodle into MOODLE_26_STABLE

This commit is contained in:
Sam Hemelryk
2014-02-11 14:10:58 +13:00
2 changed files with 54 additions and 6 deletions
@@ -39,3 +39,57 @@ Feature: Toggle activities visibility from the course page
And I log in as "student1"
And I follow "Course 1"
And "Test forum name" activity should be hidden
@javascript
Scenario: Activities can be shown and hidden inside a hidden section
Given the following "users" exists:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
And the following "courses" exists:
| fullname | shortname | format | numsections |
| Course 1 | C1 | topics | 2 |
And the following "course enrolments" exists:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add a "Forum" to section "2" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
| Visible | Show |
When I hide section "2"
Then "Test forum name" activity should be hidden
And I open "Test forum name" actions menu
And I click on "Show" "link" in the "Test forum name" activity
And "Test forum name" activity should be visible
And I open "Test forum name" actions menu
And I click on "Hide" "link" in the "Test forum name" activity
And "Test forum name" activity should be hidden
@javascript
Scenario: Activities can be shown and hidden inside an orphaned section
Given the following "users" exists:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
And the following "courses" exists:
| fullname | shortname | format | numsections |
| Course 1 | C1 | topics | 2 |
And the following "course enrolments" exists:
| user | course | role |
| teacher1 | C1 | editingteacher |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add a "Forum" to section "2" and I fill the form with:
| Forum name | Test forum name |
| Description | Test forum description |
| Visible | Show |
When I click on ".reduce-sections" "css_element"
Then "Test forum name" activity should be visible
And I open "Test forum name" actions menu
And I click on "Hide" "link" in the "Test forum name" activity
And "Test forum name" activity should be hidden
And I open "Test forum name" actions menu
And I click on "Show" "link" in the "Test forum name" activity
And "Test forum name" activity should be visible
-6
View File
@@ -481,12 +481,6 @@ YUI.add('moodle-course-toolboxes', function(Y) {
// Prevent the default button action
ev.preventDefault();
// Return early if the current section is hidden
var section = activity.ancestor(M.course.format.get_section_selector(Y));
if (section && section.hasClass(CSS.SECTIONHIDDENCLASS)) {
return;
}
// Get the element we're working on
var element = activity;
var value = this.handle_resource_dim(button, activity, action);