diff --git a/api/js/framework/fw_ui.js b/api/js/framework/fw_ui.js index aa4ece6fe6..db347877db 100644 --- a/api/js/framework/fw_ui.js +++ b/api/js/framework/fw_ui.js @@ -858,6 +858,8 @@ function egw_fw_ui_scrollarea(_contDiv) this.buttonsVisible = true; this.mouseOver = false; this.scrollTime = 0.0; + this.btnUpEnabled = true; + this.btnDownEnabled = true; //Wrap a new "scroll" div around the content of the content div this.scrollDiv = document.createElement("div"); @@ -943,17 +945,54 @@ function egw_fw_ui_scrollarea(_contDiv) egw_fw_ui_scrollarea.prototype.setScrollPos = function(_pos) { + var scrollArea = egw.preference('scroll_area', 'common') == 1 ? true : false; if (this.buttonsVisible) { - if (_pos <= 0) + if (scrollArea) { - _pos = 0; + if (_pos <= 0) + { + if (this.btnUpEnabled) + 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; + } + 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; + } + else + { + if (!this.btnUpEnabled) + jQuery(this.btnUp).removeClass("egw_fw_ui_scrollarea_button_disabled"); + if (!this.btnDownEnabled) + jQuery(this.btnDown).removeClass("egw_fw_ui_scrollarea_button_disabled"); + this.btnUpEnabled = true; + this.btnDownEnabled = true; + } } - else if (_pos >= this.maxScrollPos) + else { - _pos = this.maxScrollPos; + if (_pos <= 0) + { + _pos = 0; + } + else if (_pos >= this.maxScrollPos) + { + _pos = this.maxScrollPos; + } + jQuery(this.btnUp).addClass("egw_fw_ui_scrollarea_button_disabled"); + jQuery(this.btnDown).addClass("egw_fw_ui_scrollarea_button_disabled"); } - this.scrollPos = _pos; //Apply the calculated scroll position to the scrollDiv diff --git a/pixelegg/css/mobile.css b/pixelegg/css/mobile.css index 59a9911a6d..41ee71007d 100644 --- a/pixelegg/css/mobile.css +++ b/pixelegg/css/mobile.css @@ -4858,11 +4858,10 @@ td.message span.message { width: 100%; height: 12px; z-index: 2; - display: none !important; } .egw_fw_ui_scrollarea_button_up.egw_fw_ui_scrollarea_button_hover, .egw_fw_ui_scrollarea_button_down.egw_fw_ui_scrollarea_button_hover { - background-image: none; + background-color: silver; } .egw_fw_ui_scrollarea_button_disabled { display: none !important; @@ -4885,12 +4884,22 @@ td.message span.message { background-position: center; } .egw_fw_ui_scrollarea_button_up { - height: 37px; + height: 35px; top: 0px; border-bottom: 1px solid silver; + background-image: url(../images/up_pointer.png); + background-position: center; + background-repeat: no-repeat; + background-position-y: -1px; } .egw_fw_ui_scrollarea_button_down { bottom: 0px; + height: 35px; + border-top: 1px solid silver; + background-image: url(../images/down_pointer.png); + background-repeat: no-repeat; + background-position: center; + background-position-y: 1px; } .egw_fw_ui_scrollarea_outerdiv { height: 100%; diff --git a/pixelegg/css/monochrome.css b/pixelegg/css/monochrome.css index 260e012a6c..2d01903e2a 100644 --- a/pixelegg/css/monochrome.css +++ b/pixelegg/css/monochrome.css @@ -4847,11 +4847,10 @@ td.message span.message { width: 100%; height: 12px; z-index: 2; - display: none !important; } .egw_fw_ui_scrollarea_button_up.egw_fw_ui_scrollarea_button_hover, .egw_fw_ui_scrollarea_button_down.egw_fw_ui_scrollarea_button_hover { - background-image: none; + background-color: silver; } .egw_fw_ui_scrollarea_button_disabled { display: none !important; @@ -4874,12 +4873,22 @@ td.message span.message { background-position: center; } .egw_fw_ui_scrollarea_button_up { - height: 37px; + height: 35px; top: 0px; border-bottom: 1px solid silver; + background-image: url(../images/up_pointer.png); + background-position: center; + background-repeat: no-repeat; + background-position-y: -1px; } .egw_fw_ui_scrollarea_button_down { bottom: 0px; + height: 35px; + border-top: 1px solid silver; + background-image: url(../images/down_pointer.png); + background-repeat: no-repeat; + background-position: center; + background-position-y: 1px; } .egw_fw_ui_scrollarea_outerdiv { height: 100%; diff --git a/pixelegg/css/pixelegg.css b/pixelegg/css/pixelegg.css index fc6fbd5ca3..a9f8811125 100644 --- a/pixelegg/css/pixelegg.css +++ b/pixelegg/css/pixelegg.css @@ -4858,11 +4858,10 @@ td.message span.message { width: 100%; height: 12px; z-index: 2; - display: none !important; } .egw_fw_ui_scrollarea_button_up.egw_fw_ui_scrollarea_button_hover, .egw_fw_ui_scrollarea_button_down.egw_fw_ui_scrollarea_button_hover { - background-image: none; + background-color: silver; } .egw_fw_ui_scrollarea_button_disabled { display: none !important; @@ -4885,12 +4884,22 @@ td.message span.message { background-position: center; } .egw_fw_ui_scrollarea_button_up { - height: 37px; + height: 35px; top: 0px; border-bottom: 1px solid silver; + background-image: url(../images/up_pointer.png); + background-position: center; + background-repeat: no-repeat; + background-position-y: -1px; } .egw_fw_ui_scrollarea_button_down { bottom: 0px; + height: 35px; + border-top: 1px solid silver; + background-image: url(../images/down_pointer.png); + background-repeat: no-repeat; + background-position: center; + background-position-y: 1px; } .egw_fw_ui_scrollarea_outerdiv { height: 100%; diff --git a/pixelegg/less/layout_raster_scrollarea.less b/pixelegg/less/layout_raster_scrollarea.less index 4b18a97cc8..168449d772 100644 --- a/pixelegg/less/layout_raster_scrollarea.less +++ b/pixelegg/less/layout_raster_scrollarea.less @@ -37,13 +37,12 @@ width: 100%; height: 12px; z-index: 2; - display: none !important; } .egw_fw_ui_scrollarea_button_up.egw_fw_ui_scrollarea_button_hover, .egw_fw_ui_scrollarea_button_down.egw_fw_ui_scrollarea_button_hover { - background-image:none; + background-color: silver; } .egw_fw_ui_scrollarea_button_disabled @@ -72,14 +71,24 @@ .egw_fw_ui_scrollarea_button_up { - height: 37px; + height: 35px; top: 0px; border-bottom: 1px solid silver; + background-image: url(../images/up_pointer.png); + background-position: center; + background-repeat: no-repeat; + background-position-y: -1px; } .egw_fw_ui_scrollarea_button_down { bottom: 0px; + height: 35px; + border-top: 1px solid silver; + background-image: url(../images/down_pointer.png); + background-repeat: no-repeat; + background-position: center; + background-position-y: 1px; } .egw_fw_ui_scrollarea_outerdiv diff --git a/pixelegg/mobile/fw_mobile.css b/pixelegg/mobile/fw_mobile.css index 21fbc5db53..70faa0778d 100644 --- a/pixelegg/mobile/fw_mobile.css +++ b/pixelegg/mobile/fw_mobile.css @@ -4869,11 +4869,10 @@ td.message span.message { width: 100%; height: 12px; z-index: 2; - display: none !important; } .egw_fw_ui_scrollarea_button_up.egw_fw_ui_scrollarea_button_hover, .egw_fw_ui_scrollarea_button_down.egw_fw_ui_scrollarea_button_hover { - background-image: none; + background-color: silver; } .egw_fw_ui_scrollarea_button_disabled { display: none !important; @@ -4896,12 +4895,22 @@ td.message span.message { background-position: center; } .egw_fw_ui_scrollarea_button_up { - height: 37px; + height: 35px; top: 0px; border-bottom: 1px solid silver; + background-image: url(../images/up_pointer.png); + background-position: center; + background-repeat: no-repeat; + background-position-y: -1px; } .egw_fw_ui_scrollarea_button_down { bottom: 0px; + height: 35px; + border-top: 1px solid silver; + background-image: url(../images/down_pointer.png); + background-repeat: no-repeat; + background-position: center; + background-position-y: 1px; } .egw_fw_ui_scrollarea_outerdiv { height: 100%; diff --git a/preferences/inc/class.preferences_hooks.inc.php b/preferences/inc/class.preferences_hooks.inc.php index 74a243ccf1..d6f798291b 100644 --- a/preferences/inc/class.preferences_hooks.inc.php +++ b/preferences/inc/class.preferences_hooks.inc.php @@ -269,6 +269,16 @@ class preferences_hooks 'admin' => True, 'forced' => true, ), + 'scroll_area'=> array( + 'type' => 'select', + 'label' => 'Applications list scroll area', + 'name' => 'scroll_area', + 'values' => array('0'=>lang('Disable'),'1'=>lang('Enable')), + 'help' => 'Make applications list scrollable with up/down scroll buttons (usefull for users working with mouse with no scrollwheel)', + 'xmlrpc' => True, + 'admin' => False, + 'default' => '0', + ), array( 'type' => 'section', 'title' => 'Formatting & general settings'