WebGUI
      Click here to register.
      
YAPC North America 2008

Positionable slidePanel (top only)

User: arjan
Date: 5/26/2007 8:40 am
Views: 985
Rating: 11    Rate [
|
]

The top-position of the slidePanel you seen on the left of your site when you are in Admin mode can be changed with this package. It fixes some (not all) of the bugs that are in the javascript of the slidePanel.

Usage:
1. import this package, for example here: root/import/macro/adminbar?func=manageAssets
2. Enter the desired offset by changing this.ypos=165; in this file:
slidepanel/slidepanel-rijk.js?func=edit;proceed=manageAssets
3. use ^AdminBar(1k2znwdV-mKqS9G2QrDRbw); instead of ^AdminBar();

Explanation: 

The slidePanel is positioned by a javascript in the extras folder of WebGUI.

On line 235 of this script you seem to be able to change the y-position (top) of the slidePanelBar. However, changing this value is not taken into account by several functions. Below is a diff of the changes. All changes have comments.

15c15
<       var i=parseInt(this.obj.style.height);
---
>       var i=parseInt(this.obj.style.height);
17,18c17,18
<       var k=parseInt(this.objf.style.top);
<       if (k==slidePanelLinkTop)
---
>       var k=parseInt(this.objf.style.top)+this.parentYpos;    //Arjan: the panel is positioned by the function createSlidePanelBar. Original: var k=parseIn t(this.objf.style.top);
>       if (k==(slidePanelLinkTop+this.parentYpos)) //Arjan: slidePanelLinkTop didn't take into account the position of the SlidePanelBar. Original: if (k==s lidePanelLinkTop)
148c148
<                       document.write((this.height-(this.panels.length)*slidePanelButtonHeight)+'px; left:');
---
>               document.write((this.height-this.ypos-(this.panels.length)*slidePanelButtonHeight)+'px; left:'); // Arjan: the height of the scroll-down butt on should take into account the positioning of the PanelBar. Original: document.write((this.height-(this.panels.length)*slidePanelButtonHeight)+'px; left:');
165a166
>               this.panels.parentYpos=this.ypos; //Arjan: added so that the top-position of the PanelBar will be accessable in the function testScroll.
216c217
<                     this.panels.obj.style.top=this.height-((l-i)*slidePanelButtonHeight)+"px";
---
>             this.panels.obj.style.top=this.height-(((l-i)*slidePanelButtonHeight)+this.ypos)+"px"; //Arjan: the panel should be positioned in relation t o the PanelBar as well. Original: this.panels.obj.style.top=this.height-((l-i)*slidePanelButtonHeight)+"px";
235c236
<       this.ypos=0;                            // bar y-pos
---
>       this.ypos=165;                            // bar y-pos //Arjan: changed

Kind regards,

Arjan Widlak. 



Replies

PreviousBackNext