IDEMPIERE-626 Zk: Ticket #1002211: Context help pane. Use custom scrollbar for side panel. Use smaller font size for context help.

This commit is contained in:
Heng Sin Low 2013-02-18 12:00:38 +08:00
parent 8da8e02a1c
commit bbbb4eb4c2
7 changed files with 43 additions and 11 deletions

View File

@ -39,6 +39,8 @@ Copyright (C) 2007 Ashley G Ramdass (ADempiere WebUI).
<javascript src="/js/token.js" charset="UTF-8"/> <javascript src="/js/token.js" charset="UTF-8"/>
<javascript src="/js/window.js" charset="UTF-8"/> <javascript src="/js/window.js" charset="UTF-8"/>
<javascript src="/js/jquery-patch.js" charset="UTF-8"/> <javascript src="/js/jquery-patch.js" charset="UTF-8"/>
<javascript src="/js/jquery.slimscroll.min.js" charset="UTF-8"/>
<javascript src="/js/jquery-ui-1.10.1.min.js" charset="UTF-8"/>
<javascript package="jawwa.atmosphere" merge="false" /> <javascript package="jawwa.atmosphere" merge="false" />

View File

@ -78,7 +78,6 @@ import org.zkoss.zul.Iframe;
import org.zkoss.zul.Panel; import org.zkoss.zul.Panel;
import org.zkoss.zul.Panelchildren; import org.zkoss.zul.Panelchildren;
import org.zkoss.zul.Separator; import org.zkoss.zul.Separator;
import org.zkoss.zul.Style;
import org.zkoss.zul.Toolbar; import org.zkoss.zul.Toolbar;
import org.zkoss.zul.Toolbarbutton; import org.zkoss.zul.Toolbarbutton;
import org.zkoss.zul.Vlayout; import org.zkoss.zul.Vlayout;
@ -116,12 +115,9 @@ public class DashboardController implements EventListener<Event> {
} }
public void render(Component parent, IDesktop desktopImpl, boolean isShowInDashboard) { public void render(Component parent, IDesktop desktopImpl, boolean isShowInDashboard) {
Style style = new Style();
//, .z-anchorchildren
style.setContent(".z-anchorlayout-body { overflow:auto } .z-anchorchildren { overflow:visible } ");
style.setPage(parent.getPage());
parent.appendChild(dashboardLayout); parent.appendChild(dashboardLayout);
dashboardLayout.setSclass("slimScroll");
if (!dashboardLayout.getDesktop().isServerPushEnabled()) if (!dashboardLayout.getDesktop().isServerPushEnabled())
dashboardLayout.getDesktop().enableServerPush(true); dashboardLayout.getDesktop().enableServerPush(true);

View File

@ -256,6 +256,8 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
registerWindow(homeTab); registerWindow(homeTab);
dashboardController.render(homeTab, this, true); dashboardController.render(homeTab, this, true);
Clients.response(new AuScript("$('.slimScroll .z-anchorlayout-body').slimScroll({height: '100%',railVisible: true, alwaysVisible: false});"));
} }
public void onEvent(Event event) public void onEvent(Event event)

View File

@ -57,7 +57,7 @@ public class HelpController
public HelpController() public HelpController()
{ {
dashboardLayout = new Anchorlayout(); dashboardLayout = new Anchorlayout();
dashboardLayout.setSclass("dashboard-layout"); dashboardLayout.setSclass("dashboard-layout slimScroll");
dashboardLayout.setVflex("1"); dashboardLayout.setVflex("1");
dashboardLayout.setHflex("1"); dashboardLayout.setHflex("1");
} }

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,14 @@
/*! Copyright (c) 2011 Piotr Rochala (http://rocha.la)
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*
* Version: 1.0.6
*
*/
(function(d){jQuery.fn.extend({slimScroll:function(m){var a=d.extend({wheelStep:20,width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:0.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:"0.2",railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,scroll:0,touchScrollStep:200},m);this.each(function(){function f(h,d,f){var g=h,e=b.outerHeight()-c.outerHeight();d&&(g=parseInt(c.css("top"))+
h*parseInt(a.wheelStep)/100*c.outerHeight(),g=Math.min(Math.max(g,0),e),c.css({top:g+"px"}));j=parseInt(c.css("top"))/(b.outerHeight()-c.outerHeight());g=j*(b[0].scrollHeight-b.outerHeight());f&&(g=h,h=g/b[0].scrollHeight*b.outerHeight(),h=Math.min(Math.max(h,0),e),c.css({top:h+"px"}));b.scrollTop(g);q();l()}function r(){s=Math.max(b.outerHeight()/b[0].scrollHeight*b.outerHeight(),A);c.css({height:s+"px"})}function q(){r();clearTimeout(w);j==~~j&&(n=a.allowPageScroll,x!=j&&b.trigger("slimscroll",
0==~~j?"top":"bottom"));x=j;s>=b.outerHeight()?n=!0:(c.stop(!0,!0).fadeIn("fast"),a.railVisible&&e.stop(!0,!0).fadeIn("fast"))}function l(){a.alwaysVisible||(w=setTimeout(function(){if((!a.disableFadeOut||!p)&&!t&&!u)c.fadeOut("slow"),e.fadeOut("slow")},1E3))}var p,t,u,w,y,s,j,x,A=30,n=!1,b=d(this);if(b.parent().hasClass("slimScrollDiv")){var k=b.scrollTop(),c=b.parent().find(".slimScrollBar"),e=b.parent().find(".slimScrollRail");r();m&&("scrollTo"in m?k=parseInt(a.scrollTo):"scrollBy"in m&&(k+=parseInt(a.scrollBy)),
f(k,!1,!0))}else{a.height="auto"==a.height?b.parent().innerHeight():a.height;k=d("<div></div>").addClass(a.wrapperClass).css({position:"relative",overflow:"hidden",width:a.width,height:a.height});b.css({overflow:"hidden",width:a.width,height:a.height});var e=d("<div></div>").addClass(a.railClass).css({width:a.size,height:"100%",position:"absolute",top:0,display:a.alwaysVisible&&a.railVisible?"block":"none","border-radius":a.size,background:a.railColor,opacity:a.railOpacity,zIndex:90}),c=d("<div></div>").addClass(a.barClass).css({background:a.color,
width:a.size,position:"absolute",top:0,opacity:a.opacity,display:a.alwaysVisible?"block":"none","border-radius":a.size,BorderRadius:a.size,MozBorderRadius:a.size,WebkitBorderRadius:a.size,zIndex:99}),z="right"==a.position?{right:a.distance}:{left:a.distance};e.css(z);c.css(z);b.wrap(k);b.parent().append(c);b.parent().append(e);c.draggable({axis:"y",containment:"parent",start:function(){u=!0},stop:function(){u=!1;l()},drag:function(){f(0,d(this).position().top,!1)}});e.hover(function(){q()},function(){l()});
c.hover(function(){t=!0},function(){t=!1});b.hover(function(){p=!0;q();l()},function(){p=!1;l()});b.bind("touchstart",function(a){a.originalEvent.touches.length&&(y=a.originalEvent.touches[0].pageY)});b.bind("touchmove",function(b){b.originalEvent.preventDefault();b.originalEvent.touches.length&&f((y-b.originalEvent.touches[0].pageY)/a.touchScrollStep,!0)});var v=function(a){if(p){a=a||window.event;var b=0;a.wheelDelta&&(b=-a.wheelDelta/120);a.detail&&(b=a.detail/3);f(b,!0);a.preventDefault&&!n&&
a.preventDefault();n||(a.returnValue=!1)}};(function(){window.addEventListener?(this.addEventListener("DOMMouseScroll",v,!1),this.addEventListener("mousewheel",v,!1)):document.attachEvent("onmousewheel",v)})();r();"bottom"==a.start?(c.css({top:b.outerHeight()-c.outerHeight()}),f(0,!0)):"object"==typeof a.start&&(f(d(a.start).position().top,null,!0),a.alwaysVisible||c.hide())}});return this}});jQuery.fn.extend({slimscroll:jQuery.fn.slimScroll})})(jQuery);

View File

@ -309,6 +309,10 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none {
border-left: 1px solid #c5c5c5; border-left: 1px solid #c5c5c5;
} }
.z-south-splt, .z-west-splt, .z-east-splt, .z-north-splt {
background: none !important;
}
.desktop-left-column .z-west-body { .desktop-left-column .z-west-body {
border-right: none; border-right: none;
} }
@ -325,6 +329,12 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none {
overflow-x: hidden; overflow-x: hidden;
} }
.z-anchorlayout-body { overflow:auto }
.z-anchorchildren { overflow:visible }
.slimScroll .z-anchorlayout-body { overflow:hidden }
.desktop-hometab { .desktop-hometab {
margin-left: 4px !important; margin-left: 4px !important;
} }
@ -1187,5 +1197,7 @@ tbody.z-grid-empty-body td {
.content .content
{ {
font-size: ${fontSizeM}; padding: 5px;
font-size: 11px;
font-weight: normal;
} }