method to lock and unlock tree (stop receiving clicks and give user visual feedback that we are working on his request

This commit is contained in:
Ralf Becker 2014-01-21 10:21:59 +00:00
parent 045d1a3b19
commit eaa6376170
2 changed files with 43 additions and 1 deletions

View File

@ -40,7 +40,7 @@ app.classes.mail = AppJS.extend(
timeout: null,
request: null
},
/**
* abbrevations for common access rights
* @array
@ -2456,4 +2456,26 @@ app.classes.mail = AppJS.extend(
}
},
/**
* Lock tree so it does NOT receive any more mouse-clicks
*/
lock_tree: function()
{
if (!document.getElementById('mail_folder_lock_div'))
{
var parent = jQuery('#mail-index_nm\\[foldertree\\]');
var lock_div = jQuery(document.createElement('div'));
lock_div.attr('id', 'mail_folder_lock_div')
.addClass('mail_folder_lock');
parent.prepend(lock_div);
}
},
/**
* Unlock tree so it receives again mouse-clicks after calling lock_tree()
*/
unlock_tree: function()
{
jQuery('#mail_folder_lock_div').remove();
}
});

View File

@ -567,3 +567,23 @@ div.mailPreviewHeaders #mail-index_previewAttachmentArea.visible {
.mail_extraEmails.visible > a {
display: list-item;
}
/**
* Lock div for tree to prevent further clicks
*/
#mail-index_nm\[foldertree\] {
position: relative;
}
#mail_folder_lock_div {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 10000;
// only change styling below:
background-image: url(../../../phpgwapi/templates/default/images/ajax-loader.gif);
background-position: left top;
background-repeat: no-repeat;
background-color: rgba(255,255,255,0.5);
}