Línea 12... |
Línea 12... |
12 |
//
|
12 |
//
|
13 |
// You should have received a copy of the GNU General Public License
|
13 |
// You should have received a copy of the GNU General Public License
|
14 |
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
14 |
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
Línea 15... |
Línea 15... |
15 |
|
15 |
|
16 |
/**
|
16 |
/**
|
17 |
* Theme Space - JS code back to top button
|
17 |
* Theme universe - JS code back to top button
|
18 |
*
|
18 |
*
|
19 |
* @module theme_universe/backtotopbutton
|
19 |
* @module theme_universe/backtotopbutton
|
20 |
* @copyright 2023 Marcin Czaja
|
20 |
* @copyright 2023 Marcin Czaja
|
21 |
* @copyright based on code from theme_universe_campus by Kathrin Osswald.
|
21 |
* @copyright based on code from theme_universe_campus by Kathrin Osswald.
|
22 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
22 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
Línea 23... |
Línea 23... |
23 |
*/
|
23 |
*/
|
24 |
|
24 |
|
Línea 25... |
Línea 25... |
25 |
define(['jquery', 'core/str', 'core/notification'], function($, str, Notification) {
|
25 |
define(['jquery', 'core/str', 'core/notification'], function($, str, Notification) {
|
26 |
"use strict";
|
26 |
"use strict";
|
Línea 43... |
Línea 43... |
43 |
'aria-label="' + string + '">' +
|
43 |
'aria-label="' + string + '">' +
|
44 |
'<svg width="24" height="24" stroke-width="2" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor"><path d="M6 20h12M12 16V4m0 0l3.5 3.5M12 4L8.5 7.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg></button>');
|
44 |
'<svg width="24" height="24" stroke-width="2" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor"><path d="M6 20h12M12 16V4m0 0l3.5 3.5M12 4L8.5 7.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg></button>');
|
Línea 45... |
Línea 45... |
45 |
|
45 |
|
46 |
// This function fades the button in when the page is scrolled down or fades it out
|
46 |
// This function fades the button in when the page is scrolled down or fades it out
|
47 |
// if the user is at the top of the page again.
|
47 |
// if the user is at the top of the page again.
|
48 |
// Please note that Boost in Moodle 4.0 does not scroll the window object / whole body tag anymore,
|
48 |
// Please note that universe in Moodle 4.0 does not scroll the window object / whole body tag anymore,
|
49 |
// it scrolls the #page element instead.
|
49 |
// it scrolls the #page element instead.
|
50 |
$('#page').on('scroll', function() {
|
50 |
$('#page').on('scroll', function() {
|
51 |
if ($('#page').scrollTop() > 1210) {
|
51 |
if ($('#page').scrollTop() > 1210) {
|
52 |
checkAndShow();
|
52 |
checkAndShow();
|