[dev] DIMP - changing 'delete' behaviour

Johny Ågotnes horde at agotnes.com
Tue Jul 5 21:42:56 UTC 2011


Presently when deleting a message using backspace or the 'Delete'  
button in DIMP (5.0.8) it defaults to not selecting another message  
and the preview window has 'No Message Selected' displayed.

I found this quite annoying and figured that the following would sort  
this out for both using the keypress and the delete button, is there  
any hope in getting this in as part of DIMP rather than me keeping it  
as my own patch? :)


--- dimpbase.js	2011-07-05 23:36:55.000000000 +0200
+++ dimpbase.js.deleteMoveToNext	2011-07-05 23:23:58.000000000 +0200
@@ -2023,9 +2023,7 @@
          case Event.KEY_BACKSPACE:
              if (!this.viewport.getMetaData('nodelete')) {
                  r = sel.get('dataob');
-                if (e.shiftKey) {
-                    this.moveSelected((r.last().VP_rownum ==  
this.viewport.getMetaData('total_rows')) ? (r.first().VP_rownum - 1) :  
(r.last().VP_rownum + 1), true);
-                }
+                this.moveSelected((r.last().VP_rownum ==  
this.viewport.getMetaData('total_rows')) ? (r.first().VP_rownum - 1) :  
(r.last().VP_rownum + 1), true);
                  this.deleteMsg({ vs: sel });
              }
              e.stop();
@@ -2300,7 +2298,11 @@
                  return;

              case 'button_deleted':
-                this.deleteMsg();
+		var sel = this.viewport.getSelected();
+                r = sel.get('dataob');
+                this.moveSelected((r.last().VP_rownum ==  
this.viewport.getMetaData('total_rows')) ? (r.first().VP_rownum - 1) :  
(r.last().VP_rownum + 1), true);
+                this.deleteMsg({ vs: sel });
                  e.stop();
                  return;




More information about the dev mailing list