From c2b6b0027d7a46cf094516b23d30d772340eb0ab Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 17 Mar 2015 13:58:58 +0000 Subject: [PATCH] Fix couple of glitches in mobile theme: - Fix extra gap between topmenu icons - Shows no print button - Resize sidebox - Fix not loading the default app --- jdots/inc/class.jdots_framework.inc.php | 26 ++++++++---- jdots/js/fw_mobile.js | 10 ++++- pixelegg/css/mobile.css | 44 ++++++++------------ pixelegg/css/mobile.less | 46 +++++++++------------ pixelegg/templates/pixelegg/head_mobile.tpl | 2 - 5 files changed, 65 insertions(+), 63 deletions(-) diff --git a/jdots/inc/class.jdots_framework.inc.php b/jdots/inc/class.jdots_framework.inc.php index ac1edfd8f4..5b1af596c2 100755 --- a/jdots/inc/class.jdots_framework.inc.php +++ b/jdots/inc/class.jdots_framework.inc.php @@ -367,13 +367,15 @@ div .egw_fw_ui_sidemenu_entry_content > div { $this->tpl->set_var('sidebox_width', self::get_global_sidebar_width()); $this->tpl->set_var('sidebox_min_width', self::MIN_SIDEBAR_WIDTH); - // logout button - $this->tpl->set_var('title_logout', lang("Logout")); - $this->tpl->set_var('link_logout', egw::link('/logout.php')); - - //Print button title - $this->tpl->set_var('title_print', lang("Print current view")); - + if (!(html::$ua_mobile || $GLOBALS['egw_info']['user']['preferences']['common']['theme'] == 'mobile')) + { + // logout button + $this->tpl->set_var('title_logout', lang("Logout")); + $this->tpl->set_var('link_logout', egw::link('/logout.php')); + //Print button title + $this->tpl->set_var('title_print', lang("Print current view")); + } + // add framework div's $this->tpl->set_var($this->_get_footer()); $content .= $this->tpl->fp('out','framework'); @@ -443,7 +445,15 @@ div .egw_fw_ui_sidemenu_entry_content > div { switch($app_data['name']) { case 'logout': - return; // no need for logout in topmenu on jdots + if (html::$ua_mobile || $GLOBALS['egw_info']['user']['preferences']['common']['theme'] == 'mobile') + { + + } + else + { + return; // no need for logout in topmenu on jdots + } + break; case 'manual': $app_data['url'] = "javascript:callManual();"; diff --git a/jdots/js/fw_mobile.js b/jdots/js/fw_mobile.js index 87233cf3ea..38cb3f2daa 100644 --- a/jdots/js/fw_mobile.js +++ b/jdots/js/fw_mobile.js @@ -534,6 +534,14 @@ // Do not load the apps which are not in the navbar if (app_navbar_lookup(app)) this.applicationTabNavigate(restore[app].app, restore[app].url, app == activeApp?false:true,-1); } + // Check if there is no activeApp active the Home app if exist + // otherwise the first app in the list + if (activeApp =="" || !activeApp) + { + this.setActiveApp(typeof this.applications.home !='undefined'? + this.applications.home:this.applications[Object.keys(this.applications)[0]]); + } + //Set the current state of the tabs and activate TabChangeNotification. this.serializedTabState = egw.jsonEncode(this.assembleTabList()); @@ -876,7 +884,7 @@ $j(document).ready(function() { window.framework = new fw_mobile("egw_fw_sidemenu", "egw_fw_tabs", - window.egw_webserverUrl, egw_setSideboxSize, 350, 'egw_fw_basecontainer', 'egw_fw_menu'); + window.egw_webserverUrl, egw_setSideboxSize, 300, 'egw_fw_basecontainer', 'egw_fw_menu'); window.callManual = window.framework.callManual; jQuery('#egw_fw_print').click(function(){window.framework.print();}); jQuery('#egw_fw_logout').click(function(){ window.framework.redirect(this.getAttribute('data-logout-url')); }); diff --git a/pixelegg/css/mobile.css b/pixelegg/css/mobile.css index 79b5c7dcf7..86588737b3 100644 --- a/pixelegg/css/mobile.css +++ b/pixelegg/css/mobile.css @@ -6335,22 +6335,6 @@ a.textSidebox { #egw_fw_basecontainer #egw_fw_top_toolbar div.egw_fw_ui_tabs_header span h1 { display: none; } - #egw_fw_basecontainer div#egw_fw_logout { - left: 310px; - top: 20px; - width: 24px; - height: 24px; - background-size: 24px 24px; - z-index: 1; - } - #egw_fw_basecontainer div#egw_fw_print { - left: 268px; - top: 20px; - width: 24px; - height: 24px; - background-size: 24px 24px; - z-index: 1; - } #egw_fw_basecontainer .egw_fw_top_toolbar > div:hover { -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); -moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); @@ -6381,7 +6365,7 @@ a.textSidebox { box-shadow: inset 1px 2px 1px rgba(0, 0, 0, 0.5); } #egw_fw_basecontainer div#egw_fw_topmenu_items { - width: 250px; + width: 280px; display: inline; float: left; position: fixed; @@ -6397,13 +6381,23 @@ a.textSidebox { #egw_fw_basecontainer div#egw_fw_topmenu_items ul li { display: -webkit-inline-box; display: -moz-inline-box; - padding-right: 0.5em; + padding: 2px; } #egw_fw_basecontainer div#egw_fw_topmenu_items ul li:hover { -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5); -moz-box-shadow: 1px 2px 1px rgba(0, 0, 0, 0.5); box-shadow: 1px 2px 1px rgba(0, 0, 0, 0.5); } + #egw_fw_basecontainer div#egw_fw_topmenu_items ul a#topmenu_logout:before { + content: ""; + background-image: url(../images/logout.png); + background-repeat: no-repeat; + width: 32px; + height: 32px; + background-size: 30px 30px; + display: inline-block; + background-position: center; + } #egw_fw_basecontainer div#egw_fw_topmenu_items ul a#topmenu_home:before { content: " "; background-image: url(../images/topmenu_items/mobile/home.png); @@ -6422,6 +6416,7 @@ a.textSidebox { height: 32px; background-size: 32px 32px; display: inline-block; + background-position: center; } #egw_fw_basecontainer div#egw_fw_topmenu_items ul a#topmenu_prefs:active { -webkit-transform: rotate(180deg); @@ -6435,6 +6430,7 @@ a.textSidebox { background-size: 32px 32px; background-image: url(../images/topmenu_items/mobile/access.png); display: inline-block; + background-position: center; } #egw_fw_basecontainer div#egw_fw_topmenu_items ul a#topmenu_cats:before { background-image: url(../images/topmenu_items/mobile/category.png); @@ -6444,6 +6440,7 @@ a.textSidebox { height: 32px; background-size: 32px 32px; display: inline-block; + background-position: center; } #egw_fw_basecontainer div#egw_fw_topmenu_items ul a#topmenu_password:before { background-image: url(../images/topmenu_items/mobile/password.png); @@ -6453,6 +6450,7 @@ a.textSidebox { height: 32px; background-size: 32px 32px; display: inline-block; + background-position: center; } #egw_fw_basecontainer div#egw_fw_topmenu_items ul a#topmenu_manual:before { background-image: url(../images/topmenu_items/mobile/help.png); @@ -6471,11 +6469,7 @@ a.textSidebox { height: 32px; background-size: 32px 32px; display: inline-block; - } - #egw_fw_basecontainer div#egw_fw_topmenu_items ul a#topmenu_search:active { - transform: scale(-2); - -webkit-transform: scale(-2); - -webkit-transition: 1s ease; + background-position: center; } .egw_fw_ui_tabs_header { margin: 0px 0 0 0; @@ -6963,9 +6957,7 @@ a.textSidebox { .sidebar-toggle #egw_fw_sidebar #egw_fw_sidemenu .egw_fw_ui_sidemenu_entry_header_active h1 { display: none; } - .sidebar-toggle #egw_fw_logout, - .sidebar-toggle #egw_fw_topmenu_items, - .sidebar-toggle #egw_fw_print { + .sidebar-toggle #egw_fw_topmenu_items { display: none !important; } .tabs-header-portrait-collapsed { diff --git a/pixelegg/css/mobile.less b/pixelegg/css/mobile.less index d796d9f217..5aed62a696 100644 --- a/pixelegg/css/mobile.less +++ b/pixelegg/css/mobile.less @@ -132,25 +132,7 @@ } } } - //FW Logout - div#egw_fw_logout{ - left: 310px; - top: 20px; - width: 24px; - height: 24px; - background-size: 24px 24px; - z-index: 1; - } - //FW Print - div#egw_fw_print{ - left: 268px; - top: 20px; - width: 24px; - height: 24px; - background-size: 24px 24px; - z-index: 1; - } .egw_fw_top_toolbar>div:hover{ -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); -moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6); @@ -184,7 +166,7 @@ box-shadow: inset 1px 2px 1px rgba(0, 0, 0, 0.5); } div#egw_fw_topmenu_items{ - width: 250px; + width: 280px; display: inline; float: left; position: fixed; @@ -198,13 +180,25 @@ li{ display: -webkit-inline-box; display: -moz-inline-box; - padding-right: 0.5em; + padding:2px; &:hover { -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5); -moz-box-shadow: 1px 2px 1px rgba(0, 0, 0, 0.5); box-shadow: 1px 2px 1px rgba(0, 0, 0, 0.5); } } + a#topmenu_logout{ + &:before { + content: ""; + background-image: url(../images/logout.png); + background-repeat: no-repeat; + width: 32px; + height: 32px; + background-size: 30px 30px; + display: inline-block; + background-position: center; + } + } a#topmenu_home:before { content: " "; background-image: url(../images/topmenu_items/mobile/home.png); @@ -224,6 +218,7 @@ height: 32px; background-size: 32px 32px; display: inline-block; + background-position: center; } &:active { -webkit-transform:rotate(180deg); @@ -239,6 +234,7 @@ background-size: 32px 32px; background-image: url(../images/topmenu_items/mobile/access.png); display: inline-block; + background-position: center; } a#topmenu_cats:before { @@ -249,6 +245,7 @@ height: 32px; background-size: 32px 32px; display: inline-block; + background-position: center; } a#topmenu_password:before { background-image: url(../images/topmenu_items/mobile/password.png); @@ -258,6 +255,7 @@ height: 32px; background-size: 32px 32px; display: inline-block; + background-position: center; } a#topmenu_manual:before { @@ -279,11 +277,7 @@ height: 32px; background-size: 32px 32px; display: inline-block; - } - &:active { - transform: scale(-2); - -webkit-transform:scale(-2); - -webkit-transition: 1s ease; + background-position: center; } } } @@ -717,7 +711,7 @@ } } } - #egw_fw_logout, #egw_fw_topmenu_items, #egw_fw_print{ + #egw_fw_topmenu_items { display:none !important; } } diff --git a/pixelegg/templates/pixelegg/head_mobile.tpl b/pixelegg/templates/pixelegg/head_mobile.tpl index 39161be2a6..0413f66f71 100644 --- a/pixelegg/templates/pixelegg/head_mobile.tpl +++ b/pixelegg/templates/pixelegg/head_mobile.tpl @@ -28,8 +28,6 @@ {hook_after_navbar}
-
-
{topmenu_items}