Skip to content

Commit

Permalink
issue arieh#5 fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
arieh committed Mar 2, 2011
1 parent 7d658c3 commit 1974d8c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Docs/ScrollerBar.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ ScrollerBar Method: constructor {#ScrollerBar:constructor}
1. step (`int`) how many pixels to move for each scroll step (default is `30`)
2. mode (`string`) can be either `vertical` or `horizontal`(default is `vertical`)
3. margins (`int`) how many margins to add to the end of the scroll zone (can help fix some issues). default is `0`.
4. scrollerHTML (`string`) - the html used to create the ScrollerBar. If you wish to customize it, make sure you keep the default class names, or it will break:
4. alwaysShow (`bool`) - if set to true, will show the bar even if there is no scrolling needed. default is `false`.
5. scrollerHTML (`string`) - the html used to create the ScrollerBar. If you wish to customize it, make sure you keep the default class names, or it will break:
- scroller - the ScrollerBar container
- scroll - the scroll area
- handle - the scroll handle
- increase - the increase button (up/left)
- decrease - the decrease button (down/right)
5. wrapped (`Element` | `String`) - if provided, the class will use this element for creating the scroller effect instead of creating a wrapping element.
6. wrapped (`Element` | `String`) - if provided, the class will use this element for creating the scroller effect instead of creating a wrapping element.

*note: the scroller element will be added with a class representing it's mode (vertical/horizontal) so that you can style it, allowing you to use both types on the same element*

Expand Down
11 changes: 10 additions & 1 deletion Source/ScrollerBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ var params = {
, mode : 'vertical'
, margins : 0
, wrapped : null
, alwaysShow : false
}
, element : null
, scroller : null
Expand Down Expand Up @@ -105,7 +106,9 @@ var params = {
handleSize = +this.scroller.scroll.getDimensions()[this.axis] * ratio;

this.scroller.handle.setStyle(this.property,handleSize);


if (this.areaSize >= this.scrollSize+this.options.margins && false == this.options.alwaysShow) this.hide();

this.slider = new Slider(this.scroller.scroll,this.scroller.handle,{mode:this.options.mode, range : [0,this.scrollSize-this.areaSize/2+this.options.margins]});

this.generated = true;
Expand Down Expand Up @@ -171,6 +174,12 @@ var params = {
this.scrolled.setStyle('margin-'+this.dir,-1*this.position);
this.fireEvent('decrease',[this.position]);
}
, show : function show(){
this.scroller.element.setStyle('visibility','visible');
}
, hide : function hide(){
this.scroller.element.setStyle('visibility','hidden');
}
, toElement : function toElement(){return this.element;}
},
ScrollerBar = this.ScrollerBar = new Class(params);
Expand Down
2 changes: 1 addition & 1 deletion package.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ScrollerBar
author: arieh
current: 0.5.4
current: 0.6
category: Interface
tags: [scroller,scrollbar, costum scrollbar]
demo: http://arieh.github.com/ScrollBar
Expand Down

0 comments on commit 1974d8c

Please sign in to comment.