From 17dedaed2a260044770fe1dc0b368de469d0b8f6 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 7 Sep 2010 23:59:52 -0600 Subject: [PATCH] Title setting tweaks. Don't use escaped mailbox name for window title - since it is not HTML code, it doesn't need to be escaped. Don't continually defer setTitle() if mailbox does not exist on remote server. --- imp/js/dimpbase.js | 12 ++++++++---- imp/lib/Ajax/Application.php | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/imp/js/dimpbase.js b/imp/js/dimpbase.js index 060749e9e..75e85b510 100644 --- a/imp/js/dimpbase.js +++ b/imp/js/dimpbase.js @@ -554,7 +554,7 @@ var DimpBase = { if (!this.isSearch()) { this.setFolderLabel(this.folder, this.viewport.getMetaData('unseen') || 0); } - this.updateTitle(); + this.updateTitle(this.viewport.getMetaData('noexist')); if (this.rownum) { this.viewport.select(this.viewport.createSelection('rownum', this.rownum)); @@ -986,10 +986,13 @@ var DimpBase = { } }, - updateTitle: function() + // nodefer - (boolean) If true, don't defer updating if folder element + // does not exist. + updateTitle: function(nodefer) { var elt, unseen, - label = this.viewport.getMetaData('label'); + // Label is HTML encoded - but this is not HTML code so unescape. + label = this.viewport.getMetaData('label').unescapeHTML(); if (this.isSearch(null, true)) { label += ' (' + this.search.label + ')'; @@ -1000,10 +1003,11 @@ var DimpBase = { if (unseen > 0) { label += ' (' + unseen + ')'; } - } else { + } else if (!nodefer) { this.updateTitle.bind(this).defer(); } } + DimpCore.setTitle(label); }, diff --git a/imp/lib/Ajax/Application.php b/imp/lib/Ajax/Application.php index da89dd2b4..b7a320921 100644 --- a/imp/lib/Ajax/Application.php +++ b/imp/lib/Ajax/Application.php @@ -575,6 +575,8 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application if (!is_null($req_id)) { $result->ViewPort->requestid = intval($req_id); } + + $result->ViewPort->metadata->noexist = 1; } elseif ($changed || $this->_vars->rangeslice || !$this->_vars->checkcache) { -- 2.11.0