egroupware_official/pixelegg/js/slider.js

52 lines
1.3 KiB
JavaScript
Raw Normal View History

/**
* EGroupware: Pixelegg template: hiding/showing header
*
* @link http://www.egroupware.org
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
2013-11-20 09:41:08 +01:00
* @author Wolfgang Ott <wolfgang.ott@pixelegg.de>
* @package pixelegg
*/
egw_ready.then(function()
{
/**
* replace [+] on mouseover with quick-add selectbox
*
* Must run after DOM is ready!
*/
jQuery('#quick_add').on({
mouseover: function(ev){
// do NOT react on bubbeling events from contained selectbox
2019-03-25 16:36:21 +01:00
var $select = jQuery('#quick_add_selectbox');
2019-03-26 12:02:11 +01:00
if (!$select.children()[0]['value']) $select.children()[0].text = '';
2019-03-25 16:36:21 +01:00
var $chosen_div = $select.next();
if ($chosen_div.hasClass('chzn-container'))
{
2019-03-25 16:36:21 +01:00
$chosen_div.show();
}
else
{
$select.chosen({
2019-03-26 12:02:11 +01:00
disable_search: true,
display_selected_options: false
});
2019-03-25 16:36:21 +01:00
$chosen_div = $select.next();
}
2019-03-25 16:36:21 +01:00
$select.trigger('liszt:open');
$select.on('liszt:hiding_dropdown', function(e){
$chosen_div.hide();
});
ev.stopPropagation();
},
mouseout: function(ev){
// do NOT react on bubbeling events from contained selectbox
if (ev.target && ev.relatedTarget && ev.target.id != 'quick_add_selectbox'
2019-03-25 16:36:21 +01:00
&& !jQuery(ev.relatedTarget).hasClass('chzn-container'))
{
2019-03-25 16:36:21 +01:00
jQuery('#quick_add_selectbox').next().hide();
}
ev.stopPropagation();
}
});
});