mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
Make notification sidebar disappear when click away
This commit is contained in:
parent
fc096da1b3
commit
b7ffb65644
@ -504,10 +504,28 @@
|
|||||||
*/
|
*/
|
||||||
notifications.prototype.toggle = function ()
|
notifications.prototype.toggle = function ()
|
||||||
{
|
{
|
||||||
|
var $egwpopup = jQuery('#egwpopup');
|
||||||
|
var $body = jQuery('body');
|
||||||
|
var $counter = jQuery('#egwpopup_fw_notifications');
|
||||||
|
|
||||||
|
if (!$egwpopup.is(":visible"))
|
||||||
|
{
|
||||||
|
$body.on('click', function(e){
|
||||||
|
if (!$counter.is(e.target) && e.originalEvent.target.className !== 'popup_note' &&
|
||||||
|
!$egwpopup.is(e.target) && $egwpopup.has(e.target).length == 0)
|
||||||
|
{
|
||||||
|
jQuery(this).off(e);
|
||||||
|
$egwpopup.slideToggle('fast');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$body.off('click');
|
||||||
|
}
|
||||||
// Remove popup_note as soon as message list is toggled
|
// Remove popup_note as soon as message list is toggled
|
||||||
jQuery('.popup_note', '#egwpopup_fw_notifications').remove();
|
jQuery('.popup_note', '#egwpopup_fw_notifications').remove();
|
||||||
|
|
||||||
var $egwpopup = jQuery('#egwpopup');
|
|
||||||
if ($egwpopup.length>0) $egwpopup.slideToggle('fast');
|
if ($egwpopup.length>0) $egwpopup.slideToggle('fast');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user