Merge branch 'MDL-86248' of https://github.com/paulholden/moodle
This commit is contained in:
+1
-1
@@ -5,6 +5,6 @@
|
||||
* @copyright 2018 Ryan Wyllie <ryan@moodle.com>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
define("core/page_global",["jquery","core/custom_interaction_events","core/str","core/network"],(function($,CustomEvents,Str,Network){return{init:function(){var body;body=$("body"),CustomEvents.define(body,[CustomEvents.events.activate]),body.on(CustomEvents.events.activate,"[data-show-active-item]",(function(e){var option=$(e.target).closest(".dropdown-item"),menuContainer=option.closest("[data-show-active-item]");if(option.hasClass("dropdown-item")&&!option.hasClass("active")){var dropdownItems=menuContainer.find(".dropdown-item");dropdownItems.removeClass("active"),dropdownItems.removeAttr("aria-current"),menuContainer.attr("data-skip-active-class")||option.addClass("active"),option.attr("aria-current",!0);var activeOptionText=option.text(),dropdownToggle=menuContainer.parent().find('[data-bs-toggle="dropdown"]'),dropdownToggleText=dropdownToggle.find("[data-active-item-text]");dropdownToggleText.length?dropdownToggleText.html(activeOptionText):dropdownToggle.html(activeOptionText);var activeItemAriaLabelComponent=menuContainer.attr("data-active-item-button-aria-label-components");if(activeItemAriaLabelComponent){var strParams=activeItemAriaLabelComponent.split(",");strParams.push(activeOptionText),Str.get_string(strParams[0].trim(),strParams[1].trim(),strParams[2].trim()).then((function(string){return dropdownToggle.attr("aria-label",string),string})).catch((function(){return!1}))}}})),Network.init()}}}));
|
||||
define("core/page_global",["jquery","core/custom_interaction_events","core/str","core/network"],(function($,CustomEvents,Str,Network){return{init:function(){var body;(body=$("body")).find(".dropdown-menu").each((function(){$(this).find('[aria-current="true"]').addClass("dropdown-item-active")})),CustomEvents.define(body,[CustomEvents.events.activate]),body.on(CustomEvents.events.activate,"[data-show-active-item]",(function(e){var option=$(e.target).closest(".dropdown-item"),menuContainer=option.closest("[data-show-active-item]");if(option.hasClass("dropdown-item")&&!option.hasClass("active")){var dropdownItems=menuContainer.find(".dropdown-item");dropdownItems.removeClass(["active","dropdown-item-active"]),dropdownItems.removeAttr("aria-current"),menuContainer.attr("data-skip-active-class")||option.addClass("active"),option.addClass("dropdown-item-active"),option.attr("aria-current",!0);var activeOptionText=option.text(),dropdownToggle=menuContainer.parent().find('[data-bs-toggle="dropdown"]'),dropdownToggleText=dropdownToggle.find("[data-active-item-text]");dropdownToggleText.length?dropdownToggleText.html(activeOptionText):dropdownToggle.html(activeOptionText);var activeItemAriaLabelComponent=menuContainer.attr("data-active-item-button-aria-label-components");if(activeItemAriaLabelComponent){var strParams=activeItemAriaLabelComponent.split(",");strParams.push(activeOptionText),Str.get_string(strParams[0].trim(),strParams[1].trim(),strParams[2].trim()).then((function(string){return dropdownToggle.attr("aria-label",string),string})).catch((function(){return!1}))}}})),Network.init()}}}));
|
||||
|
||||
//# sourceMappingURL=page_global.min.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -58,6 +58,11 @@ function(
|
||||
var initActionOptionDropdownHandler = function() {
|
||||
var body = $('body');
|
||||
|
||||
// Ensure on load that the "current" item is always marked to ensure we make space for active item indicator.
|
||||
body.find('.dropdown-menu').each(function() {
|
||||
$(this).find('[aria-current="true"]').addClass('dropdown-item-active');
|
||||
});
|
||||
|
||||
CustomEvents.define(body, [CustomEvents.events.activate]);
|
||||
body.on(CustomEvents.events.activate, '[data-show-active-item]', function(e) {
|
||||
// The dropdown item that the user clicked on.
|
||||
@@ -77,7 +82,7 @@ function(
|
||||
|
||||
// Clear the active class from all other options.
|
||||
var dropdownItems = menuContainer.find('.dropdown-item');
|
||||
dropdownItems.removeClass('active');
|
||||
dropdownItems.removeClass(['active', 'dropdown-item-active']);
|
||||
dropdownItems.removeAttr('aria-current');
|
||||
|
||||
if (!menuContainer.attr('data-skip-active-class')) {
|
||||
@@ -86,6 +91,7 @@ function(
|
||||
// adding the active class itself.
|
||||
option.addClass('active');
|
||||
}
|
||||
option.addClass('dropdown-item-active');
|
||||
|
||||
// Update aria attribute for active item.
|
||||
option.attr('aria-current', true);
|
||||
|
||||
@@ -265,10 +265,6 @@ $blocks-plus-gutter: calc(#{$blocks-column-width} + (#{$grid-gutter-width} * 0.5
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
// Make space for active item indicator.
|
||||
.dropdown-item {
|
||||
padding-left: map-get($spacers, 4);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -285,14 +281,6 @@ $blocks-plus-gutter: calc(#{$blocks-column-width} + (#{$grid-gutter-width} * 0.5
|
||||
padding-left: 5.55em;
|
||||
}
|
||||
}
|
||||
.block_timeline {
|
||||
.dropdown-menu {
|
||||
// Make space for active item indicator.
|
||||
.dropdown-item {
|
||||
padding-left: map-get($spacers, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Blocks block_settings and block_navigation
|
||||
|
||||
@@ -35,6 +35,12 @@
|
||||
|
||||
.dropdown-menu {
|
||||
width: fit-content;
|
||||
&:has(.dropdown-item-active) {
|
||||
.dropdown-item {
|
||||
// Make space for active item indicator.
|
||||
padding-left: map-get($spacers, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add dropdown menu items styles for each theme color mantainning default hover colour for contrast.
|
||||
|
||||
@@ -89,11 +89,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Make space for active item indicator.
|
||||
.dropdown-item {
|
||||
padding-left: map-get($spacers, 4);
|
||||
}
|
||||
|
||||
.dropdown-item[aria-current="true"],
|
||||
.dropdown-item.active {
|
||||
background-color: transparent;
|
||||
|
||||
@@ -29650,9 +29650,6 @@ aside[id^=block-region-side-] .block_recentlyaccesseditems .card:nth-of-type(n+4
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.block_myoverview .dropdown-item {
|
||||
padding-left: 1.5rem;
|
||||
}
|
||||
|
||||
.block_timeline .paged-content-page-container {
|
||||
background-color: var(--bs-body-bg);
|
||||
@@ -29662,10 +29659,6 @@ aside[id^=block-region-side-] .block_recentlyaccesseditems .card:nth-of-type(n+4
|
||||
padding-left: 5.55em;
|
||||
}
|
||||
|
||||
.block_timeline .dropdown-menu .dropdown-item {
|
||||
padding-left: 1.5rem;
|
||||
}
|
||||
|
||||
.block_settings .block_tree [aria-expanded=true],
|
||||
.block_settings .block_tree [aria-expanded=true].emptybranch,
|
||||
.block_settings .block_tree [aria-expanded=false],
|
||||
@@ -40744,9 +40737,6 @@ div.editor_atto_toolbar button .icon {
|
||||
.moremenu .dropdownmoremenu > .dropdown-menu .dropdown-menu .dropdown-divider {
|
||||
display: none;
|
||||
}
|
||||
.moremenu .dropdown-item {
|
||||
padding-left: 1.5rem;
|
||||
}
|
||||
.moremenu .dropdown-item[aria-current=true],
|
||||
.moremenu .dropdown-item.active {
|
||||
background-color: transparent;
|
||||
@@ -41033,6 +41023,9 @@ div.editor_atto_toolbar button .icon {
|
||||
.dropdown-menu {
|
||||
width: fit-content;
|
||||
}
|
||||
.dropdown-menu:has(.dropdown-item-active) .dropdown-item {
|
||||
padding-left: 1.5rem;
|
||||
}
|
||||
|
||||
.dropdown-item:hover.text-primary,
|
||||
.dropdown-item:hover a.text-primary, .dropdown-item:focus.text-primary,
|
||||
|
||||
@@ -29650,9 +29650,6 @@ aside[id^=block-region-side-] .block_recentlyaccesseditems .card:nth-of-type(n+4
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.block_myoverview .dropdown-item {
|
||||
padding-left: 1.5rem;
|
||||
}
|
||||
|
||||
.block_timeline .paged-content-page-container {
|
||||
background-color: var(--bs-body-bg);
|
||||
@@ -29662,10 +29659,6 @@ aside[id^=block-region-side-] .block_recentlyaccesseditems .card:nth-of-type(n+4
|
||||
padding-left: 5.55em;
|
||||
}
|
||||
|
||||
.block_timeline .dropdown-menu .dropdown-item {
|
||||
padding-left: 1.5rem;
|
||||
}
|
||||
|
||||
.block_settings .block_tree [aria-expanded=true],
|
||||
.block_settings .block_tree [aria-expanded=true].emptybranch,
|
||||
.block_settings .block_tree [aria-expanded=false],
|
||||
@@ -40678,9 +40671,6 @@ div.editor_atto_toolbar button .icon {
|
||||
.moremenu .dropdownmoremenu > .dropdown-menu .dropdown-menu .dropdown-divider {
|
||||
display: none;
|
||||
}
|
||||
.moremenu .dropdown-item {
|
||||
padding-left: 1.5rem;
|
||||
}
|
||||
.moremenu .dropdown-item[aria-current=true],
|
||||
.moremenu .dropdown-item.active {
|
||||
background-color: transparent;
|
||||
@@ -40967,6 +40957,9 @@ div.editor_atto_toolbar button .icon {
|
||||
.dropdown-menu {
|
||||
width: fit-content;
|
||||
}
|
||||
.dropdown-menu:has(.dropdown-item-active) .dropdown-item {
|
||||
padding-left: 1.5rem;
|
||||
}
|
||||
|
||||
.dropdown-item:hover.text-primary,
|
||||
.dropdown-item:hover a.text-primary, .dropdown-item:focus.text-primary,
|
||||
|
||||
Reference in New Issue
Block a user