From 6e6e89324c231737936acc3a30558df7e9649551 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Fri, 05 Sep 2008 06:32:25 -0400
Subject: [PATCH] Capture backspace key in list mode (#1484566)

---
 program/js/list.js |    4 ++++
 CHANGELOG          |    1 +
 program/js/app.js  |    2 ++
 3 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 034f33d..124b52e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -7,6 +7,7 @@
 - Respect Content-Location headers in multipart/related messages according to RFC2110 (#1484946)
 - Applied mime_decode patch by David Lublink
 - Allowed max. attachment size now indicated in compose screen (#1485030)
+- Also capture backspace key in list mode (#1484566)
 
 2008/09/04 (alec)
 ----------
diff --git a/program/js/app.js b/program/js/app.js
index 9a9865d..e533e7b 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -1283,6 +1283,8 @@
       this.command('show');
     else if (list.key_pressed == list.DELETE_KEY)
       this.command('delete');
+    else if (list.key_pressed == list.BACKSPACE_KEY)
+      this.command('delete');
     else
       list.shiftkey = false;
     };
diff --git a/program/js/list.js b/program/js/list.js
index 97549f7..f33c67c 100644
--- a/program/js/list.js
+++ b/program/js/list.js
@@ -26,6 +26,7 @@
   // static contants
   this.ENTER_KEY = 13;
   this.DELETE_KEY = 46;
+  this.BACKSPACE_KEY = 8;
   
   this.list = list ? list : null;
   this.frame = null;
@@ -574,6 +575,9 @@
       this.shiftkey = e.shiftKey;
       this.key_pressed = keyCode;
       this.trigger_event('keypress');
+      
+      if (this.key_pressed == list.BACKSPACE_KEY)
+        return rcube_event.cancel(e);
   }
   
   return true;

--
Gitblit v1.9.1