Opened 6 years ago
Closed 5 years ago
#1484316 closed Feature Patches (fixed)
Improve message previewpane - less loading - patch provided
| Reported by: | Emil Wojak | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.1.1 |
| Component: | User Interface | Version: | git-master |
| Severity: | normal | Keywords: | |
| Cc: |
Description
I love the preview pane feature, but there are some minor issues I'd like corrected.
First of all, it would be nice, if the preview pane wasn't filled if it doesn't need to, I mean, I don't wan't it to show a message if I:
a) select a single message by ctrl+clicking it - I know it works when having at least one message selected already, but I'm talking about a single selection. This way, when I select multiple messages the first one won't be previewed either.
b) drag a message
It matters to me mostly because of my extremely slow connection (yes, modems still exist) :)
So here's an attempt to accomplish the above, unfortunately I don't know if this is the correct way you developers would see it implemented.
Index: program/js/list.js
===================================================================
--- program/js/list.js (wersja 536)
+++ program/js/list.js (kopia robocza)
@@ -35,6 +35,7 @@
this.shiftkey = false;
this.multiselect = false;
+ this.multi_selecting = false;
this.draggable = false;
this.keyboard = false;
@@ -216,7 +217,7 @@
if (this.draggable && this.selection.length)
{
this.drag_start = true;
- this.drag_mouse_start = rcube_event.get_mouse_pos(e);
+ this.drag_mouse_start = rcube_event.get_mouse_pos(e);
rcube_event.add_listener({element:document, event:'mousemove', object:this, method:'drag_mouse_move'});
rcube_event.add_listener({element:document, event:'mouseup', object:this, method:'drag_mouse_up'});
}
@@ -304,6 +305,7 @@
{
this.shift_start = id;
this.highlight_row(id, false);
+ this.multi_selecting = false;
}
else
{
@@ -327,6 +329,7 @@
this.highlight_row(id, false);
break;
}
+ this.multi_selecting = true;
}
// trigger event if selection changed
Index: program/js/app.js
===================================================================
--- program/js/app.js (wersja 536)
+++ program/js/app.js (kopia robocza)
@@ -125,7 +125,7 @@
this.message_list.addEventListener('dblclick', function(o){ p.msglist_dbl_click(o); });
this.message_list.addEventListener('keypress', function(o){ p.msglist_keypress(o); });
this.message_list.addEventListener('select', function(o){ p.msglist_select(o); });
- this.message_list.addEventListener('dragstart', function(o){ p.drag_active = true; });
+ this.message_list.addEventListener('dragstart', function(o){ p.drag_active = true; if (p.preview_timer) clearTimeout(p.preview_timer); });
this.message_list.addEventListener('dragend', function(o){ p.drag_active = false; });
this.message_list.init();
@@ -147,15 +147,9 @@
{
this.enable_command('show', 'reply', 'reply-all', 'forward', 'moveto', 'delete', 'viewsource', 'print', 'load-attachment', true);
if (this.env.next_uid)
- {
- this.enable_command('nextmessage', true);
- this.enable_command('lastmessage', true);
- }
+ this.enable_command('nextmessage', 'lastmessage', true);
if (this.env.prev_uid)
- {
- this.enable_command('previousmessage', true);
- this.enable_command('firstmessage', true);
- }
+ this.enable_command('previousmessage', 'firstmessage', true);
}
// make preview/message frame visible
@@ -1097,7 +1091,7 @@
}
// start timer for message preview (wait for double click)
- if (selected && this.env.contentframe)
+ if (selected && this.env.contentframe && !list.multi_selecting)
this.preview_timer = setTimeout(function(){ ref.msglist_get_preview(); }, this.dblclick_time + 10);
else if (this.env.contentframe)
this.show_messageframe(false);
Change History (2)
comment:1 Changed 5 years ago by seansan
- Milestone set to 0.1.1
- Summary changed from Disable message preview when selecting multiple messages or dragging a message to Improve message previewpane - less loading - patch provided
comment:2 Changed 5 years ago by robin
- Resolution set to fixed
- Status changed from new to closed
Thanks, done in [21168d21].

review in 0.1.1