From 36a154e934b2e43fa24f2e177a5b6fe25b5eeffd Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 18 Apr 2014 07:05:06 -0400
Subject: [PATCH] Fix next message display after removing a message (#1489800)

---
 program/js/common.js |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/program/js/common.js b/program/js/common.js
index 722eb3f..72a68bb 100644
--- a/program/js/common.js
+++ b/program/js/common.js
@@ -327,13 +327,17 @@
 triggerEvent: function(evt, e)
 {
   var ret, h;
+
   if (e === undefined)
     e = this;
   else if (typeof e === 'object')
     e.event = evt;
 
-  if (this._events && this._events[evt] && !this._event_exec) {
-    this._event_exec = true;
+  if (!this._event_exec)
+    this._event_exec = {};
+
+  if (this._events && this._events[evt] && !this._event_exec[evt]) {
+    this._event_exec[evt] = true;
     for (var i=0; i < this._events[evt].length; i++) {
       if ((h = this._events[evt][i])) {
         if (typeof h.func === 'function')
@@ -356,7 +360,8 @@
     }
   }
 
-  this._event_exec = false;
+  delete this._event_exec[evt];
+
   if (e.event) {
     try {
       delete e.event;

--
Gitblit v1.9.1