Make active header fixed inside sidebox while scrolling

This commit is contained in:
Hadi Nategh 2019-04-02 12:02:28 +02:00
parent bec4eb8cf1
commit 8d7ec84a80
6 changed files with 71 additions and 22 deletions

View File

@ -840,8 +840,6 @@ function egw_fw_ui_scrollarea(_contDiv)
this.buttonsVisible = true; this.buttonsVisible = true;
this.mouseOver = false; this.mouseOver = false;
this.scrollTime = 0.0; this.scrollTime = 0.0;
this.btnUpEnabled = true;
this.btnDownEnabled = true;
//Wrap a new "scroll" div around the content of the content div //Wrap a new "scroll" div around the content of the content div
this.scrollDiv = document.createElement("div"); this.scrollDiv = document.createElement("div");
@ -927,38 +925,25 @@ function egw_fw_ui_scrollarea(_contDiv)
egw_fw_ui_scrollarea.prototype.setScrollPos = function(_pos) egw_fw_ui_scrollarea.prototype.setScrollPos = function(_pos)
{ {
var $activeHeader = jQuery('.egw_fw_ui_sidemenu_entry_header_active');
if (this.buttonsVisible) if (this.buttonsVisible)
{ {
if (_pos <= 0) if (_pos <= 0)
{ {
if (this.btnUpEnabled) if (window.framework) jQuery(framework.sidemenuDiv).removeClass("egw_fw_ui_scrollarea_enabled");
jQuery(this.btnUp).addClass("egw_fw_ui_scrollarea_button_disabled");
if (!this.btnDownEnabled)
jQuery(this.btnDown).removeClass("egw_fw_ui_scrollarea_button_disabled");
this.btnDownEnabled = true;
this.btnUpEnabled = false;
_pos = 0; _pos = 0;
} }
else if (_pos >= this.maxScrollPos) else if (_pos >= this.maxScrollPos)
{ {
if (this.btnDownEnabled)
jQuery(this.btnDown).addClass("egw_fw_ui_scrollarea_button_disabled");
if (!this.btnUpEnabled)
jQuery(this.btnUp).removeClass("egw_fw_ui_scrollarea_button_disabled");
this.btnDownEnabled = false;
this.btnUpEnabled = true;
_pos = this.maxScrollPos; _pos = this.maxScrollPos;
} }
else else
{ {
if (!this.btnUpEnabled) if (egw.preference('toggleSidebar',framework.activeApp.appName) != 'on')
jQuery(this.btnUp).removeClass("egw_fw_ui_scrollarea_button_disabled"); {
if (!this.btnDownEnabled) $activeHeader.width($activeHeader.width());
jQuery(this.btnDown).removeClass("egw_fw_ui_scrollarea_button_disabled"); if (window.framework) jQuery(framework.sidemenuDiv).addClass("egw_fw_ui_scrollarea_enabled");
this.btnUpEnabled = true; }
this.btnDownEnabled = true;
} }
this.scrollPos = _pos; this.scrollPos = _pos;

View File

@ -4862,6 +4862,7 @@ td.message span.message {
width: 100%; width: 100%;
height: 12px; height: 12px;
z-index: 2; z-index: 2;
display: none !important;
} }
.egw_fw_ui_scrollarea_button_up.egw_fw_ui_scrollarea_button_hover, .egw_fw_ui_scrollarea_button_up.egw_fw_ui_scrollarea_button_hover,
.egw_fw_ui_scrollarea_button_down.egw_fw_ui_scrollarea_button_hover { .egw_fw_ui_scrollarea_button_down.egw_fw_ui_scrollarea_button_hover {
@ -4870,6 +4871,18 @@ td.message span.message {
.egw_fw_ui_scrollarea_button_disabled { .egw_fw_ui_scrollarea_button_disabled {
display: none !important; display: none !important;
} }
#egw_fw_sidemenu.egw_fw_ui_scrollarea_enabled {
top: 7px !important;
}
#egw_fw_sidemenu.egw_fw_ui_scrollarea_enabled #egw_fw_toggler {
top: 1px;
}
#egw_fw_sidemenu.egw_fw_ui_scrollarea_enabled .egw_fw_ui_sidemenu_entry_header_active {
position: fixed;
top: 50px;
background: white;
z-index: 1;
}
.egw_fw_ui_scrollarea_button_up, .egw_fw_ui_scrollarea_button_up,
.egw_fw_ui_scrollarea_button_down { .egw_fw_ui_scrollarea_button_down {
height: 14px; height: 14px;

View File

@ -4851,6 +4851,7 @@ td.message span.message {
width: 100%; width: 100%;
height: 12px; height: 12px;
z-index: 2; z-index: 2;
display: none !important;
} }
.egw_fw_ui_scrollarea_button_up.egw_fw_ui_scrollarea_button_hover, .egw_fw_ui_scrollarea_button_up.egw_fw_ui_scrollarea_button_hover,
.egw_fw_ui_scrollarea_button_down.egw_fw_ui_scrollarea_button_hover { .egw_fw_ui_scrollarea_button_down.egw_fw_ui_scrollarea_button_hover {
@ -4859,6 +4860,18 @@ td.message span.message {
.egw_fw_ui_scrollarea_button_disabled { .egw_fw_ui_scrollarea_button_disabled {
display: none !important; display: none !important;
} }
#egw_fw_sidemenu.egw_fw_ui_scrollarea_enabled {
top: 7px !important;
}
#egw_fw_sidemenu.egw_fw_ui_scrollarea_enabled #egw_fw_toggler {
top: 1px;
}
#egw_fw_sidemenu.egw_fw_ui_scrollarea_enabled .egw_fw_ui_sidemenu_entry_header_active {
position: fixed;
top: 50px;
background: white;
z-index: 1;
}
.egw_fw_ui_scrollarea_button_up, .egw_fw_ui_scrollarea_button_up,
.egw_fw_ui_scrollarea_button_down { .egw_fw_ui_scrollarea_button_down {
height: 14px; height: 14px;

View File

@ -4862,6 +4862,7 @@ td.message span.message {
width: 100%; width: 100%;
height: 12px; height: 12px;
z-index: 2; z-index: 2;
display: none !important;
} }
.egw_fw_ui_scrollarea_button_up.egw_fw_ui_scrollarea_button_hover, .egw_fw_ui_scrollarea_button_up.egw_fw_ui_scrollarea_button_hover,
.egw_fw_ui_scrollarea_button_down.egw_fw_ui_scrollarea_button_hover { .egw_fw_ui_scrollarea_button_down.egw_fw_ui_scrollarea_button_hover {
@ -4870,6 +4871,18 @@ td.message span.message {
.egw_fw_ui_scrollarea_button_disabled { .egw_fw_ui_scrollarea_button_disabled {
display: none !important; display: none !important;
} }
#egw_fw_sidemenu.egw_fw_ui_scrollarea_enabled {
top: 7px !important;
}
#egw_fw_sidemenu.egw_fw_ui_scrollarea_enabled #egw_fw_toggler {
top: 1px;
}
#egw_fw_sidemenu.egw_fw_ui_scrollarea_enabled .egw_fw_ui_sidemenu_entry_header_active {
position: fixed;
top: 50px;
background: white;
z-index: 1;
}
.egw_fw_ui_scrollarea_button_up, .egw_fw_ui_scrollarea_button_up,
.egw_fw_ui_scrollarea_button_down { .egw_fw_ui_scrollarea_button_down {
height: 14px; height: 14px;

View File

@ -37,6 +37,7 @@
width: 100%; width: 100%;
height: 12px; height: 12px;
z-index: 2; z-index: 2;
display: none !important;
} }
.egw_fw_ui_scrollarea_button_up.egw_fw_ui_scrollarea_button_hover, .egw_fw_ui_scrollarea_button_up.egw_fw_ui_scrollarea_button_hover,
@ -50,6 +51,17 @@
display: none !important; display: none !important;
} }
#egw_fw_sidemenu.egw_fw_ui_scrollarea_enabled {
top: 7px !important;
#egw_fw_toggler {top:1px;}
.egw_fw_ui_sidemenu_entry_header_active {
position: fixed;
top: 50px;
background: white;
z-index: 1;
}
}
.egw_fw_ui_scrollarea_button_up, .egw_fw_ui_scrollarea_button_down .egw_fw_ui_scrollarea_button_up, .egw_fw_ui_scrollarea_button_down
{ {
height: 14px; height: 14px;

View File

@ -4873,6 +4873,7 @@ td.message span.message {
width: 100%; width: 100%;
height: 12px; height: 12px;
z-index: 2; z-index: 2;
display: none !important;
} }
.egw_fw_ui_scrollarea_button_up.egw_fw_ui_scrollarea_button_hover, .egw_fw_ui_scrollarea_button_up.egw_fw_ui_scrollarea_button_hover,
.egw_fw_ui_scrollarea_button_down.egw_fw_ui_scrollarea_button_hover { .egw_fw_ui_scrollarea_button_down.egw_fw_ui_scrollarea_button_hover {
@ -4881,6 +4882,18 @@ td.message span.message {
.egw_fw_ui_scrollarea_button_disabled { .egw_fw_ui_scrollarea_button_disabled {
display: none !important; display: none !important;
} }
#egw_fw_sidemenu.egw_fw_ui_scrollarea_enabled {
top: 7px !important;
}
#egw_fw_sidemenu.egw_fw_ui_scrollarea_enabled #egw_fw_toggler {
top: 1px;
}
#egw_fw_sidemenu.egw_fw_ui_scrollarea_enabled .egw_fw_ui_sidemenu_entry_header_active {
position: fixed;
top: 50px;
background: white;
z-index: 1;
}
.egw_fw_ui_scrollarea_button_up, .egw_fw_ui_scrollarea_button_up,
.egw_fw_ui_scrollarea_button_down { .egw_fw_ui_scrollarea_button_down {
height: 14px; height: 14px;