Bind to nextmatch refresh event to update folder status too

This commit is contained in:
Nathan Gray 2014-01-11 14:16:36 +00:00
parent 5f12847fb3
commit c8cfe6464e
2 changed files with 15 additions and 17 deletions

View File

@ -1334,8 +1334,6 @@ unset($query['actions']);
if ($GLOBALS['egw_info']['user']['preferences']['common']['select_mode']=='EGW_SELECTMODE_TOGGLE') unset($cols[0]);
$rows = $this->header2gridelements($sortResult['header'],$cols, $_folderName, $folderType=$toSchema,$previewMessage);
//error_log(__METHOD__.__LINE__.array2string($rows));
$response = egw_json_response::get();
$response->call('app.mail.mail_refreshFolderStatus',array('_nodeID'=>$_profileID.self::$delimiter.$_folderName,'mode'=>null,'_refreshGridArea'=>false),'mail');
$endtime = microtime(true) - $starttime;
//error_log(__METHOD__.__LINE__. " time used: ".$endtime.' for Folder:'.$_folderName.' Start:'.$query['start'].' NumRows:'.$query['num_rows']);
@ -3238,7 +3236,7 @@ blockquote[type=cite] {
if ($oA)
{
$response = egw_json_response::get();
$response->call('app.mail.mail_setFolderStatus',$oA,'mail');
$response->call('app.mail.mail_setFolderStatus',$oA);
}
}
}

View File

@ -75,6 +75,12 @@ app.classes.mail = AppJS.extend(
*/
destroy: function()
{
// Unbind from nm refresh
var nm = this.et2.getWidgetById('nm');
if(nm != null)
{
$j(nm).off('refresh');
}
delete this.et2;
delete this.et2_obj;
// call parent
@ -117,20 +123,14 @@ app.classes.mail = AppJS.extend(
if (isMainView)
{
this.mail_disablePreviewArea(true);
this.mail_startTimerFolderStatusUpdate(this.mail_refreshTimeOut);
//inital call of refresh folderstatus
var self = this;
window.setTimeout(function() {
self.mail_refreshFolderStatus.call(self,undefined,undefined,false);
},1000);
// intention was, to enable drag and drop with the tree
// and then somehow hook into the event and do the server side action
// does not work here at that time, do not know why, so we go for
// the traditional way of a rightclick action on the tree
//var tree_wdg = this.et2.getWidgetById(this.nm_index+'[foldertree]');
//tree_wdg.enableDragAndDrop(true,false);
//tree_wdg.setDragBehavior('child',true);
//tree_wdg.enableDragAndDropScrolling(true);
// Bind to nextmatch refresh to update folder status
var nm = this.et2.getWidgetById('nm');
if(nm != null)
{
var self = this;
$j(nm).on('refresh',function() {self.mail_refreshFolderStatus.call(self,undefined,undefined,false);});
}
}
if (isDisplay)
{