mirror of
https://github.com/cosmocode/do.git
synced 2025-08-02 14:10:53 +00:00

This shows an icon with the number of open tasks assigned to the user. If the user has open tasks and they click on the icon, they should see a table with all their open tasks. Another click on the icon hides the table. Known Issues: ------------- * If a task is check-off, the number next to the icon is not updated dynamically. SPR-962
35 lines
1.0 KiB
JavaScript
35 lines
1.0 KiB
JavaScript
(function() {
|
|
'use strict';
|
|
|
|
var $userTasksButtons = jQuery('a.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.html));
|
|
$wrapper.appendTo('#dokuwiki__header');
|
|
$wrapper.position({
|
|
my: 'middle top',
|
|
at: 'right bottom',
|
|
of: $this,
|
|
});
|
|
});
|
|
});
|
|
})();
|