From: Michael M Slusarz Date: Wed, 15 Apr 2009 02:55:36 +0000 (-0600) Subject: Update flag in base view also if currently in search view X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a7dcd8e539c0ad643c848fbfcea240751404e611;p=horde.git Update flag in base view also if currently in search view --- diff --git a/imp/js/src/DimpBase.js b/imp/js/src/DimpBase.js index 5cf5ba9b1..795ace025 100644 --- a/imp/js/src/DimpBase.js +++ b/imp/js/src/DimpBase.js @@ -2162,15 +2162,29 @@ var DimpBase = { add = this.convertFlag(flag, add); vs.get('dataob').each(function(ob) { - ob.flag = ob.flag.without(flag); - if (add) { - ob.flag.push(flag); + this._updateFlag(ob, flag, add); + + /* If this is a search mailbox, also need to update flag in base + * view, if it is in the buffer. */ + if (this.isSearch()) { + var tmp = this.viewport.getSelection(ob.view).search({ imapuid: { equal: [ ob.imapuid ] }, view: { equal: [ ob.view ] } }); + if (tmp.size()) { + this._updateFlag(tmp.get('dataob').first(), flag, add); + } } - - this.viewport.updateRow(ob); }, this); }, + _updateFlag: function(ob, flag, add) + { + ob.flag = ob.flag.without(flag); + if (add) { + ob.flag.push(flag); + } + + this.viewport.updateRow(ob); + }, + /* Miscellaneous folder actions. */ purgeDeleted: function() {