2013-11-18 21:48:59 +01:00
|
|
|
/**
|
|
|
|
* EGroupware: Stylite 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>
|
2013-11-18 21:48:59 +01:00
|
|
|
* @package pixelegg
|
|
|
|
* @version $Id: class.pixelegg_framework.inc.php 2741 2013-11-14 13:53:24Z ralfbecker $
|
|
|
|
*/
|
|
|
|
|
2013-12-12 21:27:20 +01:00
|
|
|
//open
|
2013-11-18 21:48:59 +01:00
|
|
|
function show_pixelegg_header(_toggle, _delay)
|
|
|
|
{
|
2016-06-02 16:51:15 +02:00
|
|
|
jQuery("#egw_fw_header").slideToggle();
|
2018-07-13 16:23:26 +02:00
|
|
|
jQuery("#egw_fw_sidebar").animate({'top':'48px'},_delay);
|
2018-06-01 10:38:18 +02:00
|
|
|
jQuery("#jsxc_roster").animate({'top':'89px'});
|
2018-07-13 16:23:26 +02:00
|
|
|
jQuery("#egw_fw_tabs").animate({'margin-top':'8px'},_delay);
|
|
|
|
jQuery(".egw_fw_ui_tabs_header").css("padding", "1px 1px 0px 1px");
|
|
|
|
jQuery(".egw_fw_ui_sidemenu_entry_header_active").css("background-position","95% -3000px");
|
2016-06-02 16:51:15 +02:00
|
|
|
jQuery(_toggle).parent().removeClass("slidedown");
|
|
|
|
jQuery(_toggle).parent().addClass("slideup");
|
2018-07-13 16:23:26 +02:00
|
|
|
jQuery('#egwpopup, .egwpopup_message.egwpopup_expanded').css({top:'90px', height:'calc(100% - 130px)'});
|
2019-03-07 16:31:47 +01:00
|
|
|
jQuery('#egw_fw_basecontainer').addClass('slideIsUp');
|
2013-11-18 21:48:59 +01:00
|
|
|
}
|
|
|
|
|
2014-02-28 18:44:23 +01:00
|
|
|
//closed = Topmenu is gone
|
2013-11-18 21:48:59 +01:00
|
|
|
function hide_pixelegg_header(_toggle, _delay)
|
|
|
|
{
|
2016-06-02 16:51:15 +02:00
|
|
|
jQuery("#egw_fw_header").slideToggle();
|
|
|
|
jQuery("#egw_fw_sidebar").animate({'top':'3px'},_delay);
|
2018-07-13 16:23:26 +02:00
|
|
|
// jQuery("#egw_fw_topmenu_info_items").show();
|
2016-06-02 16:51:15 +02:00
|
|
|
jQuery("#egw_fw_logout").show();
|
|
|
|
jQuery("#egw_fw_print").show();
|
2018-07-13 16:23:26 +02:00
|
|
|
jQuery("#egw_fw_tabs").animate({'margin-top':'8px', "top": "0px"},_delay);
|
2018-06-01 10:38:18 +02:00
|
|
|
jQuery("#jsxc_roster").animate({'top':'43px'});
|
2016-06-02 16:51:15 +02:00
|
|
|
jQuery(".egw_fw_ui_sidemenu_entry_header_active").css("background-position","95% 50%");
|
2018-07-13 16:23:26 +02:00
|
|
|
jQuery(".egw_fw_ui_tabs_header").css("height", "34px")
|
|
|
|
// Padding to adjust for icons left & right of the tabs
|
|
|
|
.css("padding", "1px 150px 0px 20px");
|
|
|
|
//Tab
|
|
|
|
jQuery(".egw_fw_ui_tab_header").css("height", "24px");
|
|
|
|
// ICON
|
|
|
|
//jQuery(".egw_fw_ui_tab_icon").css("height", "17px");
|
|
|
|
jQuery(".egw_fw_ui_tab_icon").css("display", "inline-block");
|
|
|
|
jQuery(".egw_fw_ui_tab_icon").css("margin-right", "5px");
|
|
|
|
// H1
|
|
|
|
jQuery(".egw_fw_ui_tabs_header h1").css("float", "none");
|
|
|
|
jQuery(".egw_fw_ui_tabs_header h1").css("display", "inline");
|
2016-06-02 16:51:15 +02:00
|
|
|
jQuery(_toggle).parent().removeClass("slideup");
|
|
|
|
jQuery(_toggle).parent().addClass("slidedown");
|
2018-07-13 16:23:26 +02:00
|
|
|
jQuery('#egwpopup, .egwpopup_message.egwpopup_expanded').css({top:'45px', height:'calc(100% - 85px)'});
|
2019-03-07 16:31:47 +01:00
|
|
|
jQuery('#egw_fw_basecontainer').removeClass('slideIsUp');
|
2013-11-18 21:48:59 +01:00
|
|
|
}
|
|
|
|
|
2014-02-16 11:23:41 +01:00
|
|
|
/*
|
|
|
|
* Replace all SVG images with inline SVG
|
|
|
|
*/
|
|
|
|
function replace_svg()
|
|
|
|
{
|
2016-06-02 16:51:15 +02:00
|
|
|
jQuery('img.svg').each(function()
|
2014-02-16 11:23:41 +01:00
|
|
|
{
|
2016-06-02 16:51:15 +02:00
|
|
|
var $img = jQuery(this);
|
2014-02-16 11:23:41 +01:00
|
|
|
var imgID = $img.attr('id');
|
|
|
|
var imgClass = $img.attr('class');
|
|
|
|
var imgURL = $img.attr('src');
|
|
|
|
|
2016-06-02 16:51:15 +02:00
|
|
|
jQuery.get(imgURL, function(data)
|
2014-02-16 11:23:41 +01:00
|
|
|
{
|
|
|
|
// Get the SVG tag, ignore the rest
|
2016-06-02 16:51:15 +02:00
|
|
|
var $svg = jQuery(data).find('svg');
|
2014-02-16 11:23:41 +01:00
|
|
|
|
|
|
|
// Add replaced image's ID to the new SVG
|
|
|
|
if(typeof imgID !== 'undefined') {
|
|
|
|
$svg = $svg.attr('id', imgID);
|
|
|
|
}
|
|
|
|
// Add replaced image's classes to the new SVG
|
|
|
|
if(typeof imgClass !== 'undefined') {
|
|
|
|
$svg = $svg.attr('class', imgClass+' replaced-svg');
|
|
|
|
}
|
|
|
|
|
|
|
|
// Remove any invalid XML tags as per http://validator.w3.org
|
|
|
|
$svg = $svg.removeAttr('xmlns:a');
|
|
|
|
|
|
|
|
// Replace image with new SVG
|
|
|
|
$img.replaceWith($svg);
|
|
|
|
|
|
|
|
}, 'xml');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2013-11-18 21:48:59 +01:00
|
|
|
egw_LAB.wait(function() {
|
2016-06-02 16:51:15 +02:00
|
|
|
jQuery(document).ready(function() {
|
2013-11-18 21:48:59 +01:00
|
|
|
|
2016-06-02 16:51:15 +02:00
|
|
|
jQuery('#slidetoggle').click(function(){
|
|
|
|
if (jQuery('#egw_fw_header').css('display') === 'none') {
|
2013-11-18 21:48:59 +01:00
|
|
|
show_pixelegg_header(this, 1000);
|
2014-03-25 15:13:50 +01:00
|
|
|
// Check for too many tabs, and adjust width if needed
|
2014-03-25 22:52:31 +01:00
|
|
|
egw_getFramework().checkTabOverflow();
|
2013-11-18 21:48:59 +01:00
|
|
|
egw.set_preference('common', 'pixelegg_header_hidden', '');
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
hide_pixelegg_header(this, 1000);
|
2014-03-25 15:13:50 +01:00
|
|
|
// Check for too many tabs, and adjust width if needed
|
2014-03-25 22:52:31 +01:00
|
|
|
egw_getFramework().checkTabOverflow();
|
2013-11-18 21:48:59 +01:00
|
|
|
egw.set_preference('common', 'pixelegg_header_hidden', 'true');
|
|
|
|
}
|
2014-07-14 18:44:36 +02:00
|
|
|
window.setTimeout(function() {
|
|
|
|
egw_getFramework().notifyTabChange();
|
|
|
|
},1000);
|
2013-11-12 18:23:52 +01:00
|
|
|
});
|
2019-03-07 16:31:47 +01:00
|
|
|
jQuery('#egw_fw_basecontainer').addClass('slideIsUp');
|
2013-11-18 21:48:59 +01:00
|
|
|
// hide header, if pref says it is not shown
|
|
|
|
if (egw.preference('pixelegg_header_hidden')) {
|
2016-06-15 18:04:34 +02:00
|
|
|
setTimeout(function(){hide_pixelegg_header(jQuery('#slidetoggle'),0)},1);
|
2013-11-18 21:48:59 +01:00
|
|
|
}
|
2014-02-16 11:23:41 +01:00
|
|
|
|
2013-11-12 18:23:52 +01:00
|
|
|
});
|
2013-11-18 21:48:59 +01:00
|
|
|
|
2014-02-16 11:23:41 +01:00
|
|
|
/**
|
|
|
|
* replace [+] on mouseover with quick-add selectbox
|
|
|
|
*
|
|
|
|
* Must run after DOM is ready!
|
|
|
|
*/
|
2016-06-02 16:51:15 +02:00
|
|
|
jQuery('#quick_add').on({
|
2014-02-16 11:23:41 +01:00
|
|
|
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'))
|
2014-02-16 11:23:41 +01:00
|
|
|
{
|
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
|
2014-02-16 11:23:41 +01:00
|
|
|
});
|
2019-03-25 16:36:21 +01:00
|
|
|
$chosen_div = $select.next();
|
2014-02-16 11:23:41 +01:00
|
|
|
}
|
2019-03-25 16:36:21 +01:00
|
|
|
$select.trigger('liszt:open');
|
|
|
|
$select.on('liszt:hiding_dropdown', function(e){
|
|
|
|
$chosen_div.hide();
|
|
|
|
});
|
2014-02-16 11:23:41 +01:00
|
|
|
ev.stopPropagation();
|
|
|
|
},
|
|
|
|
mouseout: function(ev){
|
|
|
|
// do NOT react on bubbeling events from contained selectbox
|
2016-06-15 18:04:34 +02:00
|
|
|
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'))
|
2014-02-16 11:23:41 +01:00
|
|
|
{
|
2019-03-25 16:36:21 +01:00
|
|
|
jQuery('#quick_add_selectbox').next().hide();
|
2014-02-16 11:23:41 +01:00
|
|
|
}
|
|
|
|
ev.stopPropagation();
|
|
|
|
}
|
|
|
|
});
|
2014-01-06 09:47:46 +01:00
|
|
|
|
2014-02-16 11:23:41 +01:00
|
|
|
replace_svg();
|
|
|
|
});
|