@ -54,6 +54,7 @@ function rcube_elastic_ui()
this . register _content _buttons = register _content _buttons ;
this . menu _hide = menu _hide ;
this . menu _toggle = menu _toggle ;
this . menu _destroy = menu _destroy ;
this . popup _init = popup _init ;
this . about _dialog = about _dialog ;
this . headers _dialog = headers _dialog ;
@ -1814,6 +1815,39 @@ function rcube_elastic_ui()
* Close menu by name
* /
function menu _hide ( name , event )
{
var target = menu _target ( name ) ;
if ( name . match ( /^drag/ ) ) {
$ ( target ) . popover ( 'dispose' ) . remove ( ) ;
}
else {
$ ( target ) . popover ( 'hide' ) ;
// In phone mode close all menus when forwardmenu is requested to be closed
// FIXME: This is a hack, we need some generic solution.
if ( name == 'forwardmenu' ) {
popups _close ( event ) ;
}
}
} ;
/ * *
* Destroys menu by name
*
* This is required when you replace the menu content element
* /
function menu _destroy ( name )
{
var target = menu _target ( name ) ;
$ ( target || '[aria-owns=' + name + ']' ) . popover ( 'dispose' ) ;
} ;
/ * *
* Get menu target by name
* /
function menu _target ( name )
{
var target ;
@ -1829,18 +1863,7 @@ function rcube_elastic_ui()
}
}
if ( name . match ( /^drag/ ) ) {
$ ( target ) . popover ( 'dispose' ) . remove ( ) ;
}
else {
$ ( target ) . popover ( 'hide' ) ;
// In phone mode close all menus when forwardmenu is requested to be closed
// FIXME: This is a hack, we need some generic solution.
if ( name == 'forwardmenu' ) {
popups _close ( event ) ;
}
}
return target ;
} ;
/ * *