125 Commits

Author SHA1 Message Date
Tim Schroeder
b6759e1986
MDL-79337 theme: removed unnecessary setuserpref 2023-10-31 16:58:24 +01:00
Ferran Recio
28c7558884 MDL-79599 theme_boost: fix drawers in RTL 2023-10-05 13:44:38 +02:00
Andrew Nicols
83296b266b
MDL-78324 theme_boost: Only shift focus if origin focus unchanged
In the Moodle additions for the Bootstrap Dropdown we update the focus
after a 50ms delay. This is presumably because the targetted focus point
may not have shown yet and may be opened in a separate thread, though
sadly the original reasoning is not documented, and is not mentioned in
the original issues.

As a result of this delay, it was possible for the user to start to
interact and then have focus stolen from them. In reality this does not
happen often - 50ms is simply too short a time for a human to do so, but
it is plenty of time for Behat to do so and we have seen some random
fails as other parts of the UI become faster. When this happens,
keyboard focus tests are broken by this 50ms behaviour.

The fix here updates the shift focus function when closing the menu to
check whether the focus has changed from the previous location already
before setting the focus.
2023-09-09 13:45:36 +08:00
Jun Pataleta
be35034f1c
Merge branch 'MDL-76974' of https://github.com/paulholden/moodle 2023-08-28 17:03:27 +08:00
Paul Holden
b30245b3e2
MDL-76974 javascript: convert remaining uses of old preferences API.
Implement component preference definition callbacks, update JS code
to use the `core_user/repository` module instead of the now deprecated
API.
2023-08-22 14:43:34 +01:00
Stefan Topfstedt
7b04638c52 MDL-71212 core_course: adds controls to the course index drawer. 2023-08-18 11:00:55 -07:00
Laurent David
1558cd4bcf MDL-75762 theme_boost: Fix popover on large pages
* On the grader report the help button popover is cut and some of it
is offscreen. This patches fixes the footer help button popover
layout.
2023-08-14 07:56:54 +02:00
Ferran Recio
b594536ef0 MDL-75762 gradereport_grader: fix sticky headers 2023-08-14 07:56:54 +02:00
Ferran Recio
c7e9af30df MDL-75762 theme_boost: fix sticky footer page scroll 2023-08-14 07:23:12 +02:00
Laurent David
cced0e77f6 MDL-75762 core_courseformat: Use page scroll instead of section
* The scroll value is not restored when we navigate into activities as only a
section of the page was scrolled.
* Remove the overflow for the page section so the full page is scrolled
* Restore side menu navigation synchronisation
2023-08-14 07:22:06 +02:00
Ferran Recio
d04ef6c5e3 MDL-78665 theme_boost: allow behat fake drawers
Drawers have several JS logic depending on the screen size. However,
some generic components like action menu subpanels require fake drawers
to test the behaviour when it is displayed in a drawer (for example in a
block). This patch allow a behat page to have a div with data-region as
fixed-drawer so the component can detect as it is inside a a drawer but
without the autoclose on small screens.
2023-08-04 16:08:00 +02:00
Ferran Recio
3b53616321 MDL-78665 libs: page helpers global amd module
Add a new global module to get information from the page. Some methods
are just local functions moved to as a global library. For example, the
drawers isSmall or isLarge to detect the page width. The other funcionts
added are to detect focusable elements and they are needed to loop on
elements, especially when accessibility keyboard navigation is implemented.
2023-08-04 16:07:59 +02:00
danghieu1407
678fb7d490 MDL-77883 forms: fix display of client-side validation for textareas 2023-04-24 13:14:08 +07:00
Mathew May
3a8eeedf6a MDL-75274 theme_boost: Aria so dropdowns with search focus better 2023-04-13 11:45:17 +08:00
Carlos Castillo
e882ef7edf MDL-73771 theme: Fix scrollbar position 2023-03-29 09:01:43 -05:00
Shamim Rezaie
c4f33ceb59 MDL-76246 output: combobox support improvements
- It was a mistake to assume the listbox is always within
   combobox.parentElement
 - Take into account that the popup of the combobox is not necessarily a
   listbox
 - Update combobox fix so that it also work with comboboxes that are not
   select-menu
 - Update combobox fix so that it also support editable comboboxes
 - Update click listener to take into account that the event's target
   might be one of the option element
 - Having a hidden input element for comboboxes was not an ARIA
   requirement and was added by us. I added data-input-element to the
   combobox element to specify the input element related to it.
2023-03-22 20:59:14 +11:00
Andrew Nicols
511401f4f6 MDL-77559 js: Rebuild all JS with Node 16 2023-03-09 09:53:19 +08:00
Jun Pataleta
916503658d Merge branch 'MDL-75012-master-5' of https://github.com/andrewnicols/moodle 2023-03-02 12:34:34 +08:00
Andrew Nicols
33b1e41f13 MDL-75012 js: Full build of all grunt things 2023-03-02 11:55:32 +08:00
Petr Skoda
6db8f35c43 MDL-77277 theme_boost: import Bootstrap v4.6.2 2023-02-28 23:45:52 +08:00
Ferran Recio
cb85359b14 MDL-76783 theme_boost: sticky footer js control 2023-02-03 12:24:53 +01:00
Mihail Geshoski
fce11bf6aa MDL-75957 core: Prevent repositioning dropdowns along the y-axis
Disables filipping the dropdowns up or dynamically repositioning
them along the y-axis to prevent them getting hidden behind the
navbar or them covering the trigger element.
2022-10-25 00:26:39 +08:00
Ferran Recio
3d483ac2ef MDL-75401 core: sticky footer component 2022-10-19 13:06:54 +02:00
Paul Holden
4398a3d920 MDL-75827 theme_boost: append table elements to popover whitelist.
This allows for their use within popover tooltips, such as those
used for showing help icon dialogues.
2022-09-26 16:00:17 +01:00
Víctor Déniz
63f31ccc7b Merge branch 'MDL-75625-master' of https://github.com/ferranrecio/moodle 2022-09-14 20:00:06 +01:00
Shamim Rezaie
2702885257 MDL-75155 output: A single-select combobox widget output component 2022-09-06 13:38:28 +10:00
Ferran Recio
188d304a4b MDL-75625 core_courseformat: fix MDL-71979 comments 2022-09-01 12:41:55 +02:00
Peter Dias
d693e93969 MDL-74297 core: Scroll and sticky heading/footer updates 2022-04-07 08:34:37 +08:00
Shamim Rezaie
8248badec7 MDL-74117 theme_boost: Remove handling of Space and Enter in dropdowns
The custom handling of Space and Enter for dropdowns that was added to
aria.js were not needed in the latests Bootstrap versions. So removed
them. Vanilla Bootstrap emulates click when Space or Enter keys are
pressed on a tab.
2022-03-28 18:19:47 +11:00
Shamim Rezaie
ad19422833 MDL-74117 theme_boost: Only focus the trigger if nothing else is focused 2022-03-28 18:19:47 +11:00
Sara Arjona
dd7d03a50e Merge branch 'MDL-74073-master-2' of https://github.com/junpataleta/moodle 2022-03-16 12:17:08 +01:00
Jun Pataleta
ed55f45754 MDL-74073 theme_boost: Enhanced kb handling for BS Collapse components
* Make sure that Bootstrap Collapse components can also be toggled by
the Space key.

Reference:
https://www.w3.org/TR/wai-aria-practices-1.1/#disclosure
2022-03-16 14:09:15 +08:00
Shamim Rezaie
1058a2fbd9 MDL-72481 theme_boost: Do not update tabindex of the "more" tab 2022-03-15 14:36:14 +11:00
Shamim Rezaie
4489132505 MDL-72481 core: only move through visible tabs 2022-03-15 12:48:22 +11:00
Sujith Haridasan
044439fc84 MDL-72481 theme_boost: Find the tab if it is inside the more dropdown
keep the selector limited to tablists to prevent infinite redirects

Co-authored-by: Shamim Rezaie <shamim@moodle.com>
2022-03-15 12:48:22 +11:00
Andrew Nicols
649705874d Merge branch 'MDL-70792-master-2' of https://github.com/junpataleta/moodle 2022-02-25 11:39:55 +08:00
Jun Pataleta
122b0fc91e MDL-70792 aria: Dropdown menu keyboard interaction fixes
* Move the focus to the last menu item when the menu is displayed by
pressing the Up arrow key.
* When the menu is open and Tab/Shift-Tab is pressed, focus on the
next/previous focusable element on the DOM instead of focusing back on
the menu trigger.
* Combine event handling for the dropdown menu trigger.
2022-02-24 18:21:12 +08:00
Mathew May
0360bc2ab3 MDL-70792 aria: Only set focus on items when triggered by keypress 2022-02-23 12:01:13 +08:00
Andrew Nicols
e1b9d5f3cd MDL-73915 js: Drop support for IE and android
Moodle announced that support for IE would be dropped back in August
2020 with Moodle 3.9 but not active steps were taken at that time. That
decision was made in MDLSITE-6109 and this particular step was meant to
be taken in Moodle 3.10.

This is the first step taken to actively drop support for IE.

This commit also bumps the browser support pattern from 0.25% to 0.3%.
The percentage here includes any browser where at least this percentage
of users worldwide may be using a browser. In this case it causes
support for Android 4.3-4.4 to be dropped, which relate to Android
KitKat (released 2013).

This combination of changes means that all of the supported browsers in
our compatibility list support modern features including async,
for...of, classes, native Promises, and more which has a huge impact on
the ease of debugging code, and drastically reduces the minified file
size because a number of native Polyfills included by Babel are no
longer included.
2022-02-23 08:55:20 +08:00
Andrew Nicols
0a4047ab31 MDL-73915 js: Switch amd minification to terser
Unfortunately the babel minify-mangle plugin seems to be abandoned and
in certain circumstances can be very buggy. The only safe options are to
disable it, or to switch to a different minification library.

Not minifying our javascript is not ideal, so this commit updates the
javascript tasks to use a rollup, combined with babel, and terser.

Babel still converts code from ES/UMD/AMD to AMD modules with the
relevant browser support, whilst terser minifies the code.

The rollup bundler handles tracking and creation of sourcemaps, and
supports better parallelisation of the tasks.

Since the upgrade to Node LTS/Gallium requires an upgrade to @babel/core
and eslint, which change the built files anyway, this seems like the
ideal time to make this change.
2022-02-23 08:55:09 +08:00
Andrew Nicols
aa7f7957ea MDL-73915 js: Upgrade babel and eslint 2022-02-23 08:53:54 +08:00
Bas Brands
f06091bec5 MDL-73609 theme_boost: footer popup accessible behaviour 2022-02-14 09:57:08 +01:00
Jun Pataleta
a336dfc271 Merge branch 'MDL-73618-master' of https://github.com/ferranrecio/moodle 2022-01-24 18:59:15 +08:00
Ferran Recio
664ccecd0a MDL-73618 theme_boost: fix drawers tooltips 2022-01-19 18:03:17 +01:00
Ferran Recio
72321cff3f MDL-73340 theme_boost: course index opened by default 2022-01-14 18:49:06 +01:00
Ferran Recio
ea01266118 MDL-73336 theme_boost: fix drawer tooltips 2022-01-11 16:15:57 +01:00
Huong Nguyen
1ac6a82e1f MDL-72809 Themes: Fix the missing 'Reset user tour on this page' link 2022-01-07 17:03:32 +07:00
Ferran Recio
bcb35d9dbe MDL-72456 theme_boost: detect drawers scroll 2021-11-25 11:30:32 +01:00
Ferran Recio
844681f54f MDL-72456 theme_boost: add tooltips to drawers 2021-11-25 11:28:06 +01:00
Bas Brands
4fb5fb052f MDL-72250 theme_boost: add mobile nav drawer 2021-11-16 08:58:01 +01:00