mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 00:16:46 +02:00
MDL-77375 core: Cleanup redundant set_constraint() calls
Also removed the 10rem bottom margin form the quiz editing page. It was there to make sure that there is enough room for the 'add new question' dropdown. But it's not needed anymore (hasn't been since long time ago).
This commit is contained in:
parent
848efb3f13
commit
316d79d038
8 changed files with 0 additions and 29 deletions
|
@ -137,9 +137,6 @@ class controlmenu implements named_templatable, renderable {
|
|||
$ownerselector = $displayoptions['ownerselector'] ?? '#module-' . $mod->id;
|
||||
$menu->set_owner_selector($ownerselector);
|
||||
|
||||
$constraint = $displayoptions['constraintselector'] ?? '.course-content';
|
||||
$menu->set_constraint($constraint);
|
||||
|
||||
foreach ($controls as $control) {
|
||||
if ($control instanceof action_menu_link) {
|
||||
$control->add_class('cm-edit-action');
|
||||
|
|
|
@ -210,8 +210,6 @@ class core_course_renderer extends plugin_renderer_base {
|
|||
* ownerselector => A JS/CSS selector that can be used to find an cm node.
|
||||
* If specified the owning node will be given the class 'action-menu-shown' when the action
|
||||
* menu is being displayed.
|
||||
* constraintselector => A JS/CSS selector that can be used to find the parent node for which to constrain
|
||||
* the action menu to when it is being displayed.
|
||||
* donotenhance => If set to true the action menu that gets displayed won't be enhanced by JS.
|
||||
* @return string
|
||||
*/
|
||||
|
@ -236,15 +234,8 @@ class core_course_renderer extends plugin_renderer_base {
|
|||
$ownerselector = 'li.activity';
|
||||
}
|
||||
|
||||
if (isset($displayoptions['constraintselector'])) {
|
||||
$constraint = $displayoptions['constraintselector'];
|
||||
} else {
|
||||
$constraint = '.course-content';
|
||||
}
|
||||
|
||||
$menu = new action_menu();
|
||||
$menu->set_owner_selector($ownerselector);
|
||||
$menu->set_constraint($constraint);
|
||||
$menu->set_menu_trigger(get_string('edit'));
|
||||
|
||||
foreach ($actions as $action) {
|
||||
|
|
|
@ -1740,7 +1740,6 @@ class core_renderer extends renderer_base {
|
|||
* @return string HTML fragment.
|
||||
*/
|
||||
public function block_controls($actions, $blockid = null) {
|
||||
global $CFG;
|
||||
if (empty($actions)) {
|
||||
return '';
|
||||
}
|
||||
|
@ -1748,7 +1747,6 @@ class core_renderer extends renderer_base {
|
|||
if ($blockid !== null) {
|
||||
$menu->set_owner_selector('#'.$blockid);
|
||||
}
|
||||
$menu->set_constraint('.block-region');
|
||||
$menu->attributes['class'] .= ' block-control-actions commands';
|
||||
return $this->render($menu);
|
||||
}
|
||||
|
|
|
@ -449,7 +449,6 @@ class mod_feedback_complete_form extends moodleform {
|
|||
global $OUTPUT;
|
||||
$menu = new action_menu();
|
||||
$menu->set_owner_selector('#' . $this->guess_element_id($item, $element));
|
||||
$menu->set_constraint('.feedback_form');
|
||||
$menu->set_menu_trigger(get_string('edit'));
|
||||
$menu->prioritise = true;
|
||||
|
||||
|
|
|
@ -608,7 +608,6 @@ class edit_renderer extends \plugin_renderer_base {
|
|||
return '';
|
||||
}
|
||||
$menu = new \action_menu();
|
||||
$menu->set_constraint('.mod-quiz-edit-content');
|
||||
$trigger = html_writer::tag('span', get_string('add', 'quiz'), ['class' => 'add-menu']);
|
||||
$menu->set_menu_trigger($trigger);
|
||||
// The menu appears within an absolutely positioned element causing width problems.
|
||||
|
|
|
@ -1203,11 +1203,6 @@ img.userpicture {
|
|||
}
|
||||
|
||||
// Quiz module
|
||||
.path-mod-quiz .mod-quiz-edit-content {
|
||||
// Force the quiz edit page to always be large enough to prevent scrolling when accessing the menu.
|
||||
margin-bottom: 10rem;
|
||||
}
|
||||
|
||||
#page-mod-quiz-mod #id_reviewoptionshdr .col-md-3,
|
||||
#page-mod-quiz-mod #id_reviewoptionshdr .col-md-9 {
|
||||
width: auto;
|
||||
|
|
|
@ -33771,10 +33771,6 @@ img.userpicture {
|
|||
display: none;
|
||||
}
|
||||
}
|
||||
.path-mod-quiz .mod-quiz-edit-content {
|
||||
margin-bottom: 10rem;
|
||||
}
|
||||
|
||||
#page-mod-quiz-mod #id_reviewoptionshdr .col-md-3,
|
||||
#page-mod-quiz-mod #id_reviewoptionshdr .col-md-9 {
|
||||
width: auto;
|
||||
|
|
|
@ -33771,10 +33771,6 @@ img.userpicture {
|
|||
display: none;
|
||||
}
|
||||
}
|
||||
.path-mod-quiz .mod-quiz-edit-content {
|
||||
margin-bottom: 10rem;
|
||||
}
|
||||
|
||||
#page-mod-quiz-mod #id_reviewoptionshdr .col-md-3,
|
||||
#page-mod-quiz-mod #id_reviewoptionshdr .col-md-9 {
|
||||
width: auto;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue