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)
|
|
|
|
{
|
|
|
|
$j("#egw_fw_header").slideToggle();
|
2014-02-16 11:23:41 +01:00
|
|
|
|
2014-04-01 11:14:34 +02:00
|
|
|
// $j("#egw_fw_topmenu_info_items").animate({"margin-right": "20px","bottom": "0px","padding-right" : "0", "height": "0px"},_delay);
|
|
|
|
// $j("#egw_fw_topmenu_info_items").css("position", "relative");
|
|
|
|
// $j("#egw_fw_topmenu_info_items").css("display", "flex");
|
|
|
|
// $j("#egw_fw_topmenu_info_items").css("float", "right");
|
2014-02-16 11:23:41 +01:00
|
|
|
|
2014-04-01 11:14:34 +02:00
|
|
|
$j("#egw_fw_sidebar").animate({'top':'43px'},_delay);
|
|
|
|
$j("#egw_fw_tabs").animate({'margin-top':'3px'},_delay);
|
2014-02-28 18:44:23 +01:00
|
|
|
$j(".egw_fw_ui_tabs_header").css("padding", "1px 1px 0px 1px");
|
2013-11-25 04:16:41 +01:00
|
|
|
$j(".egw_fw_ui_sidemenu_entry_header_active").css("background-position","95% -3000px");
|
2013-11-20 09:41:08 +01:00
|
|
|
$j(_toggle).parent().removeClass("slidedown");
|
|
|
|
$j(_toggle).parent().addClass("slideup");
|
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)
|
|
|
|
{
|
|
|
|
$j("#egw_fw_header").slideToggle();
|
2014-01-20 19:34:20 +01:00
|
|
|
$j("#egw_fw_sidebar").animate({'top':'-3px'},_delay);
|
2014-04-01 11:14:34 +02:00
|
|
|
// $j("#egw_fw_topmenu_info_items").show();
|
2013-11-18 21:48:59 +01:00
|
|
|
$j("#egw_fw_logout").show();
|
|
|
|
$j("#egw_fw_print").show();
|
2014-02-28 18:44:23 +01:00
|
|
|
$j("#egw_fw_tabs").animate({'margin-top':'2px', "top": "0px"},_delay);
|
2014-04-01 11:14:34 +02:00
|
|
|
// $j("#egw_fw_topmenu_info_items").animate({
|
|
|
|
// "bottom": "3px",
|
|
|
|
// "right": "5px",
|
|
|
|
// "display": "flex",
|
|
|
|
// "padding-right" : "20px",
|
|
|
|
// "text-align": "right",
|
|
|
|
// "white-space": "nowrap",
|
|
|
|
// },_delay);
|
2013-11-25 04:16:41 +01:00
|
|
|
$j(".egw_fw_ui_sidemenu_entry_header_active").css("background-position","95% 50%");
|
2014-02-16 11:23:41 +01:00
|
|
|
|
2014-04-01 11:14:34 +02:00
|
|
|
// $j("#egw_fw_topmenu_info_items").css("position", "fixed");
|
|
|
|
// $j("#egw_fw_topmenu_info_items").css("z-index", "1000");
|
2014-02-06 08:40:54 +01:00
|
|
|
// Form - Country Switch
|
2014-04-01 11:14:34 +02:00
|
|
|
// $j("#egw_fw_topmenu_info_items form").css("display", "none");
|
2014-02-16 11:23:41 +01:00
|
|
|
|
2014-03-25 15:13:50 +01:00
|
|
|
$j(".egw_fw_ui_tabs_header").css("height", "34px")
|
2014-03-25 22:52:31 +01:00
|
|
|
// Padding to adjust for icons left & right of the tabs
|
2014-03-25 15:13:50 +01:00
|
|
|
.css("padding", "1px 75px 0px 20px");
|
2014-02-16 11:23:41 +01:00
|
|
|
|
2014-02-28 18:44:23 +01:00
|
|
|
|
2014-01-08 19:49:09 +01:00
|
|
|
//Tab
|
2014-01-17 09:10:35 +01:00
|
|
|
$j(".egw_fw_ui_tab_header").css("height", "24px");
|
2014-01-08 19:49:09 +01:00
|
|
|
// ICON
|
2014-01-21 18:30:43 +01:00
|
|
|
//$j(".egw_fw_ui_tab_icon").css("height", "17px");
|
2014-01-08 19:49:09 +01:00
|
|
|
$j(".egw_fw_ui_tab_icon").css("display", "inline-block");
|
|
|
|
$j(".egw_fw_ui_tab_icon").css("margin-right", "5px");
|
|
|
|
// H1
|
|
|
|
$j(".egw_fw_ui_tabs_header h1").css("float", "none");
|
|
|
|
$j(".egw_fw_ui_tabs_header h1").css("display", "inline");
|
2014-02-16 11:23:41 +01:00
|
|
|
|
2014-01-08 19:49:09 +01:00
|
|
|
|
2013-11-20 09:41:08 +01:00
|
|
|
$j(_toggle).parent().removeClass("slideup");
|
|
|
|
$j(_toggle).parent().addClass("slidedown");
|
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()
|
|
|
|
{
|
|
|
|
$j('img.svg').each(function()
|
|
|
|
{
|
|
|
|
var $img = $j(this);
|
|
|
|
var imgID = $img.attr('id');
|
|
|
|
var imgClass = $img.attr('class');
|
|
|
|
var imgURL = $img.attr('src');
|
|
|
|
|
|
|
|
$j.get(imgURL, function(data)
|
|
|
|
{
|
|
|
|
// Get the SVG tag, ignore the rest
|
|
|
|
var $svg = $j(data).find('svg');
|
|
|
|
|
|
|
|
// 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() {
|
2013-11-12 18:23:52 +01:00
|
|
|
$j(document).ready(function() {
|
2013-11-18 21:48:59 +01:00
|
|
|
|
2013-11-12 18:23:52 +01:00
|
|
|
$j('#slidetoggle').click(function(){
|
2013-11-18 21:48:59 +01:00
|
|
|
if ($j('#egw_fw_header').css('display') === 'none') {
|
|
|
|
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
|
|
|
});
|
2013-11-18 21:48:59 +01:00
|
|
|
|
|
|
|
// hide header, if pref says it is not shown
|
|
|
|
if (egw.preference('pixelegg_header_hidden')) {
|
|
|
|
hide_pixelegg_header($j('#slidetoggle'),0);
|
|
|
|
}
|
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!
|
|
|
|
*/
|
|
|
|
$j('#quick_add').on({
|
|
|
|
mouseover: function(ev){
|
|
|
|
// do NOT react on bubbeling events from contained selectbox
|
2014-06-27 18:48:35 +02:00
|
|
|
if (ev.relatedTarget && ev.relatedTarget.id != 'quick_add_selectbox' && ev.target.id !='quick_add_selectbox')
|
2014-02-16 11:23:41 +01:00
|
|
|
{
|
|
|
|
$j(this).css({
|
|
|
|
transition: "0.2s ease-out 0s",
|
|
|
|
width: "166px",
|
|
|
|
'border-top-left-radius': "20px",
|
|
|
|
'background-color': "#0B5FA4"
|
|
|
|
});
|
|
|
|
$j('select', this).css({
|
|
|
|
transition: "0.1s linear 0.2s",
|
2014-08-25 15:13:16 +02:00
|
|
|
visibility: "visible",
|
|
|
|
width:"120px"
|
2014-02-16 11:23:41 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
ev.stopPropagation();
|
|
|
|
},
|
|
|
|
mouseout: function(ev){
|
|
|
|
// do NOT react on bubbeling events from contained selectbox
|
2014-06-27 18:48:35 +02:00
|
|
|
if (ev.target && ev.target.id != 'quick_add_selectbox' && ev.relatedTarget.id != 'quick_add' && ev.relatedTarget.id !='quick_add_selectbox')
|
2014-02-16 11:23:41 +01:00
|
|
|
{
|
|
|
|
$j(this).css({
|
2014-02-20 20:42:42 +01:00
|
|
|
transition: "0.6s ease-out 0s",
|
2014-02-16 11:23:41 +01:00
|
|
|
width: "16px",
|
|
|
|
'border-top-left-radius': "0px",
|
|
|
|
'background-color': "transparent"
|
|
|
|
});
|
|
|
|
$j('select', this).css({
|
|
|
|
transition: "0s linear 0s",
|
2014-08-25 15:13:16 +02:00
|
|
|
visibility: "hidden",
|
|
|
|
width:"10px"
|
2014-02-16 11:23:41 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
ev.stopPropagation();
|
2014-06-27 18:48:35 +02:00
|
|
|
},
|
|
|
|
focusout: function (ev)
|
|
|
|
{
|
|
|
|
$j(this).css({
|
|
|
|
transition: "0.6s ease-out 0s",
|
|
|
|
width: "16px",
|
|
|
|
'border-top-left-radius': "0px",
|
|
|
|
'background-color': "transparent"
|
|
|
|
});
|
|
|
|
$j('select', this).css({
|
|
|
|
transition: "0s linear 0s",
|
2014-08-25 15:13:16 +02:00
|
|
|
visibility: "hidden",
|
|
|
|
width:"10px"
|
2014-06-27 18:48:35 +02:00
|
|
|
});
|
2014-02-16 11:23:41 +01:00
|
|
|
}
|
|
|
|
});
|
2014-01-06 09:47:46 +01:00
|
|
|
|
2014-02-16 11:23:41 +01:00
|
|
|
replace_svg();
|
|
|
|
});
|