Compact theme:

- Fix framework tabs not being able to get closed
- Fix some styling
- Fix framework tabs are overriding last active opened tab
This commit is contained in:
Hadi Nategh 2021-03-17 14:00:33 +01:00
parent b882b5fdd0
commit 739bfb482b
5 changed files with 74 additions and 6 deletions

View File

@ -77,6 +77,11 @@ var fw_ui_sidemenu_entry = (function(){ "use strict"; return Class.extend(
return true;
});
//close button on active header
this.closeButton = document.createElement('span');
this.closeButton.classList.add('close')
//Create the content div
this.contentDiv = document.createElement("div");
this.contentDiv.id = _app+'_sidebox_content';
@ -146,6 +151,15 @@ var fw_ui_sidemenu_entry = (function(){ "use strict"; return Class.extend(
jQuery(this.contentDiv).hide();
},
setCloseButton: function(_callback)
{
if (typeof _callback == "function" && this.closeButton)
{
this.headerDiv.append(this.closeButton);
this.closeButton.addEventListener('click', _callback);
}
},
/**
* egw_fw_ui_sidemenu_entry_header_active
* showAjaxLoader shows the AjaxLoader animation which should be displayed when
@ -381,8 +395,21 @@ function egw_fw_ui_tab(_parent, _contHeaderDiv, _contDiv, _icon, _callback,
this.setTitle('');
jQuery(this.headerDiv).append(this.headerH1);
//Add close tab button on sidemenuentry for frameworkTabs
if (this.tag.isFrameworkTab)
{
this.tag.sidemenuEntry.setCloseButton(function(){
jQuery(this.headerDiv).append(this.closeButton);
//Only call the close callback if the tab is set closeable
if (this._callbackObject.context.closeable)
{
this._callbackObject.call(this);
return false;
}
return true;
}.bind(this.closeButton))
}
this.contentDiv = document.createElement("div");
jQuery(this.contentDiv).addClass("egw_fw_ui_tab_content");

View File

@ -7600,6 +7600,17 @@ img.et2_button_icon[src*="svg"]:hover {
border-bottom: none;
height: 33px;
}
body #egw_fw_sidebar #egw_fw_sidemenu .egw_fw_ui_sidemenu_entry_header_active .close {
background-image: url(/egroupware/pixelegg/images/close.svg);
width: 18px;
height: 33px;
display: inline-block;
float: right;
background-size: 18px;
background-repeat: no-repeat;
background-position: center;
margin-right: 5px;
}
body #egw_fw_sidebar #egw_fw_sidemenu .egw_fw_ui_sidemenu_entry_header_active img {
padding-left: 9px;
padding-top: 6px;
@ -7611,6 +7622,7 @@ img.et2_button_icon[src*="svg"]:hover {
color: #000000;
padding-top: 4px;
padding-left: 25px !important;
display: inline-block;
}
body #egw_fw_sidebar #egw_fw_sidemenu .egw_fw_ui_sidemenu_entry_header_active:hover {
-webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6);
@ -7666,6 +7678,9 @@ img.et2_button_icon[src*="svg"]:hover {
body .sidebar-toggle #egw_fw_sidebar #egw_fw_sidemenu .egw_fw_ui_sidemenu_entry_content {
display: none !important;
}
body .sidebar-toggle #egw_fw_sidebar #egw_fw_sidemenu .egw_fw_ui_sidemenu_entry_header_active .close {
display: none;
}
body .sidebar-toggle #egw_fw_sidebar #egw_fw_sidemenu .egw_fw_ui_sidemenu_entry_header_active:hover {
border-radius: 0;
background-image: url("../images/ajax-loader.gif");

View File

@ -513,7 +513,17 @@
background-image: url("../images/clear.png");
background-position: 95% -3000px;
background-repeat: no-repeat;
.close {
background-image: url(/egroupware/pixelegg/images/close.svg);
width: 18px;
height: 33px;
display: inline-block;
float: right;
background-size: 18px;
background-repeat: no-repeat;
background-position: center;
margin-right: 5px;
}
.background_color_10_gray;
.bordered (@gray_30, @gray_30, @gray_30, @gray_30);
@ -530,7 +540,7 @@
.color_100_gray;
padding-top: 4px;
padding-left:25px !important;
display: inline-block;
}
&:hover {
@ -588,6 +598,7 @@
display:none !important;
}
.egw_fw_ui_sidemenu_entry_header_active {
.close {display: none;}
&:hover {
border-radius:0;
background-image: url("../images/ajax-loader.gif");

View File

@ -510,7 +510,7 @@
if (_state === 'on' || _state === 'off')
{
this.activeApp.preferences['toggleMenu'] = _state;
egw.set_preference(this.activeApp.appName,'egw_fw_mobile',this.activeApp.preferences);
if ((!framework.isAnInternalApp(this.activeApp))) egw.set_preference(this.activeApp.appName,'egw_fw_mobile',this.activeApp.preferences);
}
else
{
@ -653,7 +653,7 @@
if (serialized != this.serializedTabState)
{
this.serializedTabState = serialized;
if (this.tabApps) this._setTabAppsSession(this.tabApps);
egw.jsonq("EGroupware\\Api\\Framework\\Ajax::ajax_tab_changed_state", [data]);
}
},
@ -744,7 +744,7 @@
if (_app.tab == null)
{
//Create the tab
_app.tab = this.tabsUi.addTab(_app.icon, this.tabClickCallback, function(){},
_app.tab = this.tabsUi.addTab(_app.icon, this.tabClickCallback, this.tabCloseClickCallback,
_app, _pos);
_app.tab.setTitle(_app.displayName);
}

View File

@ -7421,6 +7421,17 @@ img.et2_button_icon[src*="svg"]:hover {
border-bottom: none;
height: 33px;
}
body #egw_fw_sidebar #egw_fw_sidemenu .egw_fw_ui_sidemenu_entry_header_active .close {
background-image: url(/egroupware/pixelegg/images/close.svg);
width: 18px;
height: 33px;
display: inline-block;
float: right;
background-size: 18px;
background-repeat: no-repeat;
background-position: center;
margin-right: 5px;
}
body #egw_fw_sidebar #egw_fw_sidemenu .egw_fw_ui_sidemenu_entry_header_active img {
padding-left: 9px;
padding-top: 6px;
@ -7432,6 +7443,7 @@ img.et2_button_icon[src*="svg"]:hover {
color: #000000;
padding-top: 4px;
padding-left: 25px !important;
display: inline-block;
}
body #egw_fw_sidebar #egw_fw_sidemenu .egw_fw_ui_sidemenu_entry_header_active:hover {
-webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6);
@ -7487,6 +7499,9 @@ img.et2_button_icon[src*="svg"]:hover {
body .sidebar-toggle #egw_fw_sidebar #egw_fw_sidemenu .egw_fw_ui_sidemenu_entry_content {
display: none !important;
}
body .sidebar-toggle #egw_fw_sidebar #egw_fw_sidemenu .egw_fw_ui_sidemenu_entry_header_active .close {
display: none;
}
body .sidebar-toggle #egw_fw_sidebar #egw_fw_sidemenu .egw_fw_ui_sidemenu_entry_header_active:hover {
border-radius: 0;
background-image: url("../images/ajax-loader.gif");