Fix bug when aborting dragging with ESC key didn't stop the move action (#6623)

+ small code improvements
+ focus the list on drag start to make sure it's focused state is up-to-date
  which is needed for proper keypress handling (e.g. ESC key on drag action)
pull/6841/head
Aleksander Machniak 5 years ago
parent 5b6b1133dc
commit 1dbf187a45

@ -8,6 +8,7 @@ CHANGELOG Roundcube Webmail
- Fix so ANY record is not used for email domain validation, use A, MX, CNAME, AAAA instead (#6581)
- Fix so mime_content_type check in Installer uses files that should always be available (i.e. from program/resources) (#6599)
- Fix missing CSRF token on a link to download too-big message part (#6621)
- Fix bug when aborting dragging with ESC key didn't stop the move action (#6623)
RELEASE 1.3.8
-------------

@ -1604,6 +1604,7 @@ function rcube_webmail()
if (menu) {
$(menu).hide();
}
this.command(action, this.env.drag_target);
this.env.drag_target = null;
};
@ -1633,7 +1634,8 @@ function rcube_webmail()
else if (list = this.contact_list)
model = this.env.contactfolders;
if (this.drag_active && model && this.env.last_folder_target) {
// Note: we accept only mouse events to ignore dragging aborts with ESC key (#6623)
if (this.drag_active && model && this.env.last_folder_target && !rcube_event.is_keyboard(e)) {
var target = model[this.env.last_folder_target];
list.draglayer.hide();
@ -1718,7 +1720,7 @@ function rcube_webmail()
// remove focus from list widgets
if (window.rcube_list_widget && rcube_list_widget._instances.length) {
$.each(rcube_list_widget._instances, function(i,list){
$.each(rcube_list_widget._instances, function(i,list) {
if (list && !rcube_mouse_is_over(e, list.list.parentNode))
list.blur();
});
@ -1733,7 +1735,7 @@ function rcube_webmail()
}
// reset popup menus; delayed to have updated menu_stack data
setTimeout(function(e){
setTimeout(function(e) {
var obj, skip, config, id, i, parents = $(target).parents();
for (i = ref.menu_stack.length - 1; i >= 0; i--) {
id = ref.menu_stack[i];

@ -579,6 +579,7 @@ drag_row: function(e, id)
rcube_event.add_listener({event:'mousemove', object:this, method:'drag_mouse_move'});
rcube_event.add_listener({event:'mouseup', object:this, method:'drag_mouse_up'});
if (bw.touch) {
rcube_event.add_listener({event:'touchmove', object:this, method:'drag_mouse_move'});
rcube_event.add_listener({event:'touchend', object:this, method:'drag_mouse_up'});
@ -586,6 +587,7 @@ drag_row: function(e, id)
// enable dragging over iframes
this.add_dragfix();
this.focus();
}
return false;
@ -1323,9 +1325,7 @@ highlight_children: function(id, status)
*/
key_press: function(e)
{
var target = e.target || {};
if (!this.focused || target.nodeName == 'INPUT' || target.nodeName == 'TEXTAREA' || target.nodeName == 'SELECT')
if (!this.focused || $(e.target).is('input,textarea,select'))
return true;
var keyCode = rcube_event.get_keycode(e),

Loading…
Cancel
Save