Skip to content

Commit

Permalink
Merge branch 'MDL-42737-master' of git://github.com/andrewnicols/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Nov 7, 2013
2 parents 48fe93f + 11f8ef1 commit 0967c74
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 6 deletions.
1 change: 1 addition & 0 deletions backup/util/ui/tests/behat/duplicate_activities.feature
Expand Up @@ -23,6 +23,7 @@ Feature: Duplicate activities
| Description | Test database description |
And I open "Test database name" actions menu
When I click on "Duplicate" "link" in the "Test database name" activity
And I open "Test database name" actions menu
And I click on "Edit settings" "link" in the "Test database name" activity
And I fill the moodle form with:
| Name | Original database name |
Expand Down
4 changes: 2 additions & 2 deletions course/lib.php
Expand Up @@ -1995,7 +1995,7 @@ function course_get_cm_edit_actions(cm_info $mod, $indent = -1, $sr = null) {
new moodle_url($baseurl, array('id' => $mod->id, 'indent' => '1')),
new pix_icon($rightarrow, $str->moveright, 'moodle', array('class' => 'iconsmall', 'title' => '')),
$str->moveright,
array('class' => 'editing_moveright ' . $enabledclass, 'data-action' => 'moveright')
array('class' => 'editing_moveright ' . $enabledclass, 'data-action' => 'moveright', 'data-keepopen' => true)
);

if ($indent <= $indentlimits->min) {
Expand All @@ -2007,7 +2007,7 @@ function course_get_cm_edit_actions(cm_info $mod, $indent = -1, $sr = null) {
new moodle_url($baseurl, array('id' => $mod->id, 'indent' => '-1')),
new pix_icon($leftarrow, $str->moveleft, 'moodle', array('class' => 'iconsmall', 'title' => '')),
$str->moveleft,
array('class' => 'editing_moveleft ' . $enabledclass, 'data-action' => 'moveleft')
array('class' => 'editing_moveleft ' . $enabledclass, 'data-action' => 'moveleft', 'data-keepopen' => true)
);

}
Expand Down
2 changes: 2 additions & 0 deletions course/tests/behat/activities_visibility_icons.feature
Expand Up @@ -27,8 +27,10 @@ Feature: Toggle activities visibility from the course page
When I open "Test forum name" actions menu
And I click on "Hide" "link" in the "Test forum name" activity
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
And I reload the page
Expand Down
Expand Up @@ -16,7 +16,8 @@ var BODY = Y.one(Y.config.doc.body),
MENUCONTENT : '.menu[data-rel=menu-content]',
MENUCONTENTCHILD: 'li a',
MENUCHILD: '.menu li a',
TOGGLE : '.toggle-display'
TOGGLE : '.toggle-display',
KEEPOPEN: '[data-keepopen="1"]'
},
ACTIONMENU,
ALIGN = {
Expand Down Expand Up @@ -159,6 +160,14 @@ ACTIONMENU.prototype = {

// Check tabbing.
this.events.push(menu.delegate('key', this.checkFocus, 'down:9', SELECTOR.MENUCHILD, this));

// Close the menu after a button was pushed.
this.events.push(menu.delegate('click', function(e) {
if (e.currentTarget.test(SELECTOR.KEEPOPEN)) {
return;
}
this.hideMenu();
}, SELECTOR.MENUCONTENTCHILD, this));
},

/**
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion lib/yui/build/moodle-core-actionmenu/moodle-core-actionmenu.js
Expand Up @@ -16,7 +16,8 @@ var BODY = Y.one(Y.config.doc.body),
MENUCONTENT : '.menu[data-rel=menu-content]',
MENUCONTENTCHILD: 'li a',
MENUCHILD: '.menu li a',
TOGGLE : '.toggle-display'
TOGGLE : '.toggle-display',
KEEPOPEN: '[data-keepopen="1"]'
},
ACTIONMENU,
ALIGN = {
Expand Down Expand Up @@ -157,6 +158,14 @@ ACTIONMENU.prototype = {

// Check tabbing.
this.events.push(menu.delegate('key', this.checkFocus, 'down:9', SELECTOR.MENUCHILD, this));

// Close the menu after a button was pushed.
this.events.push(menu.delegate('click', function(e) {
if (e.currentTarget.test(SELECTOR.KEEPOPEN)) {
return;
}
this.hideMenu();
}, SELECTOR.MENUCONTENTCHILD, this));
},

/**
Expand Down
11 changes: 10 additions & 1 deletion lib/yui/src/actionmenu/js/actionmenu.js
Expand Up @@ -14,7 +14,8 @@ var BODY = Y.one(Y.config.doc.body),
MENUCONTENT : '.menu[data-rel=menu-content]',
MENUCONTENTCHILD: 'li a',
MENUCHILD: '.menu li a',
TOGGLE : '.toggle-display'
TOGGLE : '.toggle-display',
KEEPOPEN: '[data-keepopen="1"]'
},
ACTIONMENU,
ALIGN = {
Expand Down Expand Up @@ -157,6 +158,14 @@ ACTIONMENU.prototype = {

// Check tabbing.
this.events.push(menu.delegate('key', this.checkFocus, 'down:9', SELECTOR.MENUCHILD, this));

// Close the menu after a button was pushed.
this.events.push(menu.delegate('click', function(e) {
if (e.currentTarget.test(SELECTOR.KEEPOPEN)) {
return;
}
this.hideMenu();
}, SELECTOR.MENUCONTENTCHILD, this));
},

/**
Expand Down

0 comments on commit 0967c74

Please sign in to comment.