mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
Merge branch 'MDL-82329' of https://github.com/paulholden/moodle
This commit is contained in:
commit
b174c16d4d
2
course/amd/build/actions.min.js
vendored
2
course/amd/build/actions.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -85,6 +85,7 @@ define(
|
||||
TOGGLE: '.toggle-display,.dropdown-toggle',
|
||||
SECTIONLI: 'li.section',
|
||||
SECTIONACTIONMENU: '.section_action_menu',
|
||||
SECTIONACTIONMENUTRIGGER: '.section-actions',
|
||||
SECTIONITEM: '[data-for="section_title"]',
|
||||
ADDSECTIONS: '.changenumsections [data-add-sections]',
|
||||
SECTIONBADGES: '[data-region="sectionbadges"]',
|
||||
@ -957,16 +958,16 @@ define(
|
||||
}
|
||||
});
|
||||
|
||||
// Add a handler for section show/hide actions.
|
||||
$('body').on('click keypress', SELECTOR.SECTIONLI + ' ' +
|
||||
SELECTOR.SECTIONACTIONMENU + '[data-sectionid] ' +
|
||||
// Add a handler for section action menu.
|
||||
$('body').on('click keypress',
|
||||
SELECTOR.SECTIONACTIONMENUTRIGGER + '[data-sectionid] ' +
|
||||
'a[data-action]', function(e) {
|
||||
if (e.type === 'keypress' && e.keyCode !== 13) {
|
||||
return;
|
||||
}
|
||||
var actionItem = $(this),
|
||||
sectionElement = actionItem.closest(SELECTOR.SECTIONLI),
|
||||
sectionId = actionItem.closest(SELECTOR.SECTIONACTIONMENU).attr('data-sectionid');
|
||||
sectionId = actionItem.closest(SELECTOR.SECTIONACTIONMENUTRIGGER).attr('data-sectionid');
|
||||
|
||||
if (actionItem.attr('data-action') === 'permalink') {
|
||||
e.preventDefault();
|
||||
|
@ -119,6 +119,7 @@ class controlmenu implements named_templatable, renderable {
|
||||
$menu = new action_menu();
|
||||
$menu->set_kebab_trigger(get_string('edit'));
|
||||
$menu->attributes['class'] .= ' section-actions';
|
||||
$menu->attributes['data-sectionid'] = $this->section->id;
|
||||
foreach ($controls as $value) {
|
||||
$url = empty($value['url']) ? '' : $value['url'];
|
||||
$icon = empty($value['icon']) ? '' : $value['icon'];
|
||||
|
@ -101,6 +101,14 @@ Feature: Single section course page
|
||||
When I set the field "Edit section name" in the "page-header" "region" to "Custom section name"
|
||||
Then "Custom section name" "text" should exist in the ".breadcrumb" "css_element"
|
||||
|
||||
@javascript
|
||||
Scenario: Copy section page permalink URL to clipboard
|
||||
Given I am on the "Course 1 > Section 1" "course > section" page
|
||||
And I turn editing mode on
|
||||
When I choose the "Permalink" item in the "Edit" action menu of the "page-header" "region"
|
||||
And I click on "Copy to clipboard" "link" in the "Permalink" "dialogue"
|
||||
Then I should see "Text copied to clipboard"
|
||||
|
||||
Scenario: Blocks are displayed in section page too
|
||||
Given I log out
|
||||
And the following "blocks" exist:
|
||||
@ -115,8 +123,7 @@ Feature: Single section course page
|
||||
Scenario: Delete a section from the section page redirects to the main course page
|
||||
Given I am on the "C1 > Section 1" "course > section" page
|
||||
And I turn editing mode on
|
||||
And I open the action menu in "page-header" "region"
|
||||
When I choose "Delete" in the open action menu
|
||||
When I choose the "Delete" item in the "Edit" action menu of the "page-header" "region"
|
||||
And I click on "Delete" "button" in the "Delete section?" "dialogue"
|
||||
# Section 1 should be removed.
|
||||
Then I should not see "Section 1"
|
||||
|
Loading…
x
Reference in New Issue
Block a user