mirror of
https://github.com/cosmocode/do.git
synced 2025-07-22 12:08:10 +00:00

Since the link is not actually a link, it is not linking to another page nor to an anchor on the current page, change it to a button. This represents the actual function better and has the positive side effect that the button is now reachable via tab-key on the keyboard. SPR-977
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
// eslint-disable-next-line func-names
|
|
jQuery(function () {
|
|
'use strict';
|
|
|
|
var $userTasksButtons = jQuery('button.plugin__do_usertasks');
|
|
$userTasksButtons.click(function handleUserTasksButtonClick(event) {
|
|
var $this;
|
|
event.stopPropagation();
|
|
event.preventDefault();
|
|
|
|
if (jQuery('.plugin__do_usertasks_list').length) {
|
|
jQuery('.plugin__do_usertasks_list').toggle();
|
|
return;
|
|
}
|
|
|
|
$this = jQuery(this);
|
|
|
|
jQuery.get(
|
|
DOKU_BASE + 'lib/exe/ajax.php',
|
|
{
|
|
call: 'plugin_do_userTasksOverlay',
|
|
}
|
|
).done(function showUserTasksOverlay(data) {
|
|
var $wrapper = jQuery('<div class="plugin__do_usertasks_list"></div>');
|
|
$wrapper.css({ display: 'inline-block', position: 'absolute' });
|
|
$wrapper.append(jQuery(data));
|
|
$wrapper.appendTo('.dokuwiki');
|
|
$wrapper.position({
|
|
my: 'middle top',
|
|
at: 'right bottom',
|
|
of: $this,
|
|
});
|
|
});
|
|
});
|
|
});
|