@ -230,7 +230,6 @@ function rcube_webmail()
this . message _list
. addEventListener ( 'initrow' , function ( o ) { ref . init _message _row ( o ) ; } )
. addEventListener ( 'dblclick' , function ( o ) { ref . msglist _dbl _click ( o ) ; } )
. addEventListener ( 'click' , function ( o ) { ref . msglist _click ( o ) ; } )
. addEventListener ( 'keypress' , function ( o ) { ref . msglist _keypress ( o ) ; } )
. addEventListener ( 'select' , function ( o ) { ref . msglist _select ( o ) ; } )
. addEventListener ( 'dragstart' , function ( o ) { ref . drag _start ( o ) ; } )
@ -1060,12 +1059,10 @@ function rcube_webmail()
case 'select-all' :
this . select _all _mode = props ? false : true ;
this . dummy _select = true ; // prevent msg opening if there's only one msg on the list
if ( props == 'invert' )
this . message _list . invert _selection ( ) ;
else
this . message _list . select _all ( props == 'page' ? '' : props ) ;
this . dummy _select = null ;
break ;
case 'select-none' :
@ -1850,31 +1847,12 @@ function rcube_webmail()
this . select _all _mode = false ;
// start timer for message preview (wait for double click)
if ( selected && this . env . contentframe && ! list . multi _selecting && ! this . dummy _select )
if ( selected && this . env . contentframe && ! list . multi _selecting )
this . preview _timer = setTimeout ( function ( ) { ref . msglist _get _preview ( ) ; } , list . dblclick _time ) ;
else if ( this . env . contentframe )
this . show _contentframe ( false ) ;
} ;
// This allow as to re-select selected message and display it in preview frame
this . msglist _click = function ( list )
{
if ( list . multi _selecting || ! this . env . contentframe )
return ;
if ( list . get _single _selection ( ) )
return ;
var win = this . get _frame _window ( this . env . contentframe ) ;
if ( win && win . location . href . indexOf ( this . env . blankpage ) >= 0 ) {
if ( this . preview _timer )
clearTimeout ( this . preview _timer ) ;
this . preview _timer = setTimeout ( function ( ) { ref . msglist _get _preview ( ) ; } , list . dblclick _time ) ;
}
} ;
this . msglist _dbl _click = function ( list )
{
if ( this . preview _timer )
@ -2622,10 +2600,12 @@ function rcube_webmail()
url . _mbox = mbox ;
url . _page = page ;
// disable double-click on the list when preview pane is on
// this eliminates delay when opening a message in preview pane (#5199)
// Disable double-click on the list when preview pane is on
// to make the delay when opening a message in preview pane minimal (#5199)
// Standard double-click time is 500ms, we use 100ms, the smaller the value is
// unwanted message opening (on drag) can happen more often (#5616)
if ( this . message _list )
this . message _list . dblclick _time = this . env . layout != 'list' ? 10 : this . dblclick _time ;
this . message _list . dblclick _time = this . env . layout != 'list' ? 10 0 : this . dblclick _time ;
this . http _request ( 'list' , url , lock ) ;
this . update _state ( { _mbox : mbox , _page : ( page && page > 1 ? page : null ) } ) ;
@ -3356,7 +3336,8 @@ function rcube_webmail()
var r _uids = [ ] ,
post _data = this . selection _post _data ( { _uid : this . uids _to _list ( a _uids ) , _flag : 'delete' } ) ,
lock = this . display _message ( this . get _label ( 'markingmessage' ) , 'loading' ) ,
rows = this . message _list ? this . message _list . rows : { } ,
list = this . message _list ,
rows = list ? list . rows : { } ,
count = 0 ;
for ( var i = 0 , len = a _uids . length ; i < len ; i ++ ) {
@ -3367,7 +3348,7 @@ function rcube_webmail()
if ( this . env . skip _deleted ) {
count += this . update _thread ( uid ) ;
this . message_ list. remove _row ( uid , ( this . env . display _next && i == this . message_ list. selection . length - 1 ) ) ;
list. remove _row ( uid , ( this . env . display _next && i == list. selection . length - 1 ) ) ;
}
else
this . set _message ( uid , 'deleted' , true ) ;
@ -3375,9 +3356,9 @@ function rcube_webmail()
}
// make sure there are no selected rows
if ( this . env . skip _deleted && this . message_ list) {
if ( ! this . env . display _next )
this . message_ list. clear _selection ( ) ;
if ( this . env . skip _deleted && list) {
if ( ! this . env . display _next || ! list . rowcount )
list. clear _selection ( ) ;
if ( count < 0 )
post _data . _count = ( count * - 1 ) ;
else if ( count > 0 )
@ -4214,6 +4195,8 @@ function rcube_webmail()
// add signature according to selected identity
// if we have HTML editor, signature is added in a callback
if ( input _from . prop ( 'type' ) == 'select-one' ) {
// for some reason the caret initially is not at pos=0 in Firefox 51 (#5628)
this . set _caret _pos ( input _message , 0 ) ;
this . change _identity ( input _from [ 0 ] ) ;
}
@ -4323,6 +4306,9 @@ function rcube_webmail()
obj . keydown ( function ( e ) { return ref . ksearch _keydown ( e , this , props ) ; } )
. attr ( { 'autocomplete' : 'off' , 'aria-autocomplete' : 'list' , 'aria-expanded' : 'false' , 'role' : 'combobox' } ) ;
// hide the popup on any click
$ ( document ) . on ( 'click' , function ( ) { ref . ksearch _hide ( ) ; } ) ;
} ;
this . submit _messageform = function ( draft , saveonly )
@ -5404,8 +5390,7 @@ function rcube_webmail()
if ( this . ksearch _timer )
clearTimeout ( this . ksearch _timer ) ;
var key = rcube _event . get _keycode ( e ) ,
mod = rcube _event . get _modifier ( e ) ;
var key = rcube _event . get _keycode ( e ) ;
switch ( key ) {
case 38 : // arrow up
@ -5424,12 +5409,6 @@ function rcube_webmail()
return rcube _event . cancel ( e ) ;
case 9 : // tab
if ( mod == SHIFT _KEY || ! this . ksearch _visible ( ) ) {
this . ksearch _hide ( ) ;
return ;
}
case 13 : // enter
if ( ! this . ksearch _visible ( ) )
return false ;
@ -5440,6 +5419,7 @@ function rcube_webmail()
return rcube _event . cancel ( e ) ;
case 9 : // tab
case 27 : // escape
this . ksearch _hide ( ) ;
return ;
@ -5930,9 +5910,6 @@ function rcube_webmail()
boxtitle . append ( $ ( '<span>' ) . text ( prop ? prop . name : this . get _label ( 'contacts' ) ) ) ;
}
if ( prop )
this . triggerEvent ( 'groupupdate' , prop ) ;
} ;
// load contact record
@ -6220,13 +6197,14 @@ function rcube_webmail()
this . group _create = function ( )
{
var input = $ ( '<input>' ) . attr ( 'type' , 'text' ) ,
content = $ ( '<label>' ) . text ( this . get _label ( 'namex' ) ) . append ( input ) ;
content = $ ( '<label>' ) . text ( this . get _label ( 'namex' ) ) . append ( input ) ,
source = this . env . source ;
this . simple _dialog ( content , 'newgroup' ,
function ( ) {
var name ;
if ( name = input . val ( ) ) {
ref . http _post ( 'group-create' , { _source : ref. env . source, _name : name } ,
ref . http _post ( 'group-create' , { _source : source, _name : name } ,
ref . set _busy ( true , 'loading' ) ) ;
return true ;
}
@ -6241,13 +6219,15 @@ function rcube_webmail()
var group _name = this . env . contactgroups [ 'G' + this . env . source + this . env . group ] . name ,
input = $ ( '<input>' ) . attr ( 'type' , 'text' ) . val ( group _name ) ,
content = $ ( '<label>' ) . text ( this . get _label ( 'namex' ) ) . append ( input ) ;
content = $ ( '<label>' ) . text ( this . get _label ( 'namex' ) ) . append ( input ) ,
source = this . env . source ,
group = this . env . group ;
this . simple _dialog ( content , 'grouprename' ,
function ( ) {
var name ;
if ( ( name = input . val ( ) ) && name != group _name ) {
ref . http _post ( 'group-rename' , { _source : ref. env . source, _gid : ref . env . group , _name : name } ,
ref . http _post ( 'group-rename' , { _source : source, _gid : group , _name : name } ,
ref . set _busy ( true , 'loading' ) ) ;
return true ;
}
@ -6275,7 +6255,8 @@ function rcube_webmail()
delete this . env . contactgroups [ key ] ;
}
this . list _contacts ( prop . source , 0 ) ;
if ( prop . source == this . env . source && prop . id == this . env . group )
this . list _contacts ( prop . source , 0 ) ;
} ;
//remove selected contacts from current active group
@ -6345,6 +6326,9 @@ function rcube_webmail()
else {
$ ( this . treelist . get _item ( key ) ) . children ( ) . first ( ) . html ( prop . name ) ;
this . env . contactfolders [ key ] . name = this . env . contactgroups [ key ] . name = prop . name ;
if ( prop . source == this . env . source && prop . id == this . env . group )
this . set _group _prop ( prop ) ;
}
// update list node and re-sort it
@ -6851,7 +6835,7 @@ function rcube_webmail()
. addEventListener ( 'collapse' , function ( node ) { ref . folder _collapsed ( node ) } )
. addEventListener ( 'expand' , function ( node ) { ref . folder _collapsed ( node ) } )
. addEventListener ( 'search' , function ( p ) { if ( p . query ) ref . subscription _select ( ) ; } )
. draggable ( { cancel : 'li.mailbox.root '} )
. draggable ( { cancel : 'li.mailbox.root ,input,div.treetoggle '} )
. droppable ( {
// @todo: find better way, accept callback is executed for every folder
// on the list when dragging starts (and stops), this is slow, but