From a9dda59a655f4f121459f7a060a3f69c7e5206bd Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Sat, 20 Oct 2007 13:49:01 -0400
Subject: [PATCH] Fix toggleselect of list widget

---
 program/js/list.js |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/program/js/list.js b/program/js/list.js
index be7b02d..de4d7c8 100644
--- a/program/js/list.js
+++ b/program/js/list.js
@@ -344,15 +344,20 @@
 
   if (this.last_selected != 0 && this.rows[this.last_selected])
     this.set_classname(this.rows[this.last_selected].obj, 'focused', false);
-    
+
+  // unselect if toggleselect is active and the same row was clicked again
+  if (this.toggleselect && this.last_selected == id)
+  {
+    this.clear_selection();
+    id = null;
+  }
+  else
+    this.set_classname(this.rows[id].obj, 'focused', true);
+
   if (!this.selection.length)
     this.shift_start = null;
 
-  if (this.toggleselect && this.last_selected==id)
-    this.highlight_row(id, true);
-
   this.last_selected = id;
-  this.set_classname(this.rows[id].obj, 'focused', true);
 },
 
 

--
Gitblit v1.9.1