From e0896df54040413d382100f68788469433baa5ae Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Thu, 27 Aug 2009 03:37:15 -0400
Subject: [PATCH] Reset pressed buttons on next click (#1485987)

---
 CHANGELOG         |    1 +
 program/js/app.js |   10 ++++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 025bd5e..9759bf7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
 CHANGELOG RoundCube Webmail
 ===========================
 
+- Unselect pressed buttons on mouse up (#1485987)
 - Don't set php_value error_log in .htaccess but mention in INSTALL (#1485924)
 - Fix too small status/flag/attachment columns in Safari 4 (#1486063)
 - Fix selection disabling while dragging splitter in webkit browsers (#1486056)
diff --git a/program/js/app.js b/program/js/app.js
index 88e1339..6adc7f4 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -22,6 +22,7 @@
   this.env = new Object();
   this.labels = new Object();
   this.buttons = new Object();
+  this.buttons_sel = new Object();
   this.gui_objects = new Object();
   this.gui_containers = new Object();
   this.commands = new Object();
@@ -1256,6 +1257,14 @@
       this.command('moveto', model[this.env.last_folder_target].id);
       this.env.last_folder_target = null;
       list.draglayer.hide();
+    }
+    
+    // reset 'pressed' buttons
+    if (this.buttons_sel) {
+      for (var id in this.buttons_sel)
+        if (typeof id != 'function')
+          this.button_out(this.buttons_sel[id], id);
+      this.buttons_sel = {};
     }
   };
 
@@ -3546,6 +3555,7 @@
           else
             elm.className = button.sel;
         }
+        this.buttons_sel[id] = command;
       }
     }
   };

--
Gitblit v1.9.1