Add Icon/Button to show user's open tasks

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
This commit is contained in:
Michael Große
2017-04-24 18:57:18 +02:00
parent 91969b7dfa
commit 01705fa1bc
8 changed files with 124 additions and 1 deletions

View File

@ -0,0 +1,34 @@
(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,
});
});
});
})();