diff --git a/theme/noname/classes/output/core_renderer.php b/theme/noname/classes/output/core_renderer.php index 7e839cfd7c4..984e05a1196 100644 --- a/theme/noname/classes/output/core_renderer.php +++ b/theme/noname/classes/output/core_renderer.php @@ -33,6 +33,7 @@ use single_select; use paging_bar; use url_select; use context_course; +use pix_icon; defined('MOODLE_INTERNAL') || die; @@ -353,7 +354,31 @@ class core_renderer extends \core_renderer { * @return string HTML */ public function render_action_menu(action_menu $menu) { - return $this->render_from_template('core/action_menu', $menu); + + // We don't want the class icon there! + foreach ($menu->get_secondary_actions() as $action) { + if ($action instanceof \action_menu_link && $action->has_class('icon')) { + $action->attributes['class'] = preg_replace('/(^|\s+)icon(\s+|$)/i', '', $action->attributes['class']); + } + } + + $context = $menu->export_for_template($this); + + // We do not want the icon with the caret, the caret is added by Bootstrap. + if (empty($context->primary->menutrigger)) { + $newurl = $this->pix_url('t/edit', 'moodle'); + $context->primary->icon['attributes'] = array_reduce($context->primary->icon['attributes'], + function($carry, $item) use ($newurl) { + if ($item['name'] === 'src') { + $item['value'] = $newurl->out(false); + } + $carry[] = $item; + return $carry; + }, [] + ); + } + + return $this->render_from_template('core/action_menu', $context); } /** diff --git a/theme/noname/scss/moodle/blocks.scss b/theme/noname/scss/moodle/blocks.scss index 02da1c416f1..7badb6d4c87 100644 --- a/theme/noname/scss/moodle/blocks.scss +++ b/theme/noname/scss/moodle/blocks.scss @@ -18,7 +18,7 @@ /* So that the caret takes the colour of the icon. */ color: #999; &::after { - margin-left: -($spacer/2); + margin-left: 0; } } } diff --git a/theme/noname/scss/moodle/core.scss b/theme/noname/scss/moodle/core.scss index 8e55f9663c5..232cb739d95 100644 --- a/theme/noname/scss/moodle/core.scss +++ b/theme/noname/scss/moodle/core.scss @@ -171,7 +171,6 @@ img.resize { width: 1em; } .action-menu .dropdown-toggle { - margin-right: 0.5rem; text-decoration: none; } .action-menu { @@ -1724,11 +1723,6 @@ ul.dragdrop-keyboard-drag li { list-style-type: none; } -.block-control-actions .moodle-core-dragdrop-draghandle img { - width: 12px; - height: 12px; -} - a.disabled:hover, a.disabled { text-decoration: none; diff --git a/theme/noname/scss/moodle/course.scss b/theme/noname/scss/moodle/course.scss index 032679ec2c5..79d451c3278 100644 --- a/theme/noname/scss/moodle/course.scss +++ b/theme/noname/scss/moodle/course.scss @@ -106,9 +106,12 @@ } .filler { + // This must be sized like an icon to fill the space. width: 16px; height: 16px; - padding: 0.3em; + margin: 0; + padding: 0; + margin: 0 ($spacer / 2); display: inline-block; } diff --git a/theme/noname/scss/moodle/icons.scss b/theme/noname/scss/moodle/icons.scss index e40ef059d8a..a8e8d97a67c 100644 --- a/theme/noname/scss/moodle/icons.scss +++ b/theme/noname/scss/moodle/icons.scss @@ -20,7 +20,7 @@ a:first-of-type > .icon { } // Fix the first item in a drop down menu (it's a list of links and icons, but has been made vertical. -.dropdown a.dropdown-item .icon { +.dropdown .dropdown-item .icon { margin-left: 0px; } diff --git a/theme/noname/scss/moodle/modules.scss b/theme/noname/scss/moodle/modules.scss index 6638a0165f2..3ebe8c0b1d2 100644 --- a/theme/noname/scss/moodle/modules.scss +++ b/theme/noname/scss/moodle/modules.scss @@ -225,13 +225,6 @@ div#dock { width: 100%; } -// Dropdown styling. -.dropdown-menu { - > li > a { - padding: 3px 20px 3px 8px; - } -} - // Survey module .path-mod-survey { @@ -267,14 +260,6 @@ div#dock { // } // } //} -.dropdown-menu { - .divider { - width: auto; - height: 1px; - border-left: 0 none; - border-right: 0 none; - } -} // Usermenu .usermenu { diff --git a/theme/noname/templates/core/action_menu.mustache b/theme/noname/templates/core/action_menu.mustache index c4fc342b3b2..892e204e6c0 100644 --- a/theme/noname/templates/core/action_menu.mustache +++ b/theme/noname/templates/core/action_menu.mustache @@ -1,22 +1,34 @@ -