source: Dev/trunk/src/client/dojox/calendar/_VerticalScrollBarBase.js @ 532

Last change on this file since 532 was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 1.9 KB
Line 
1define(["dojo/_base/declare", "dojo/_base/event", "dojo/_base/lang", "dojo/on", "dojo/dom-style", "dijit/_WidgetBase"],
2function(declare, event, lang, on, domStyle, _WidgetBase){
3       
4                return declare('dojox.calendar._VerticalScrollBarBase', _WidgetBase, {
5               
6                // value: Number
7                //              The value of the scroll bar in pixel offset.
8                value: 0,
9               
10                // minimum: Number
11                //              The minimum value of the scroll bar.
12                minimum: 0,
13               
14                // maximum: Number
15                //              The maximum value of the scroll bar.
16                maximum: 100,
17               
18                _scrollHandle: null,
19               
20                buildRendering: function(){
21                        this.inherited(arguments);
22                        this.own(on(this.domNode, "scroll", lang.hitch(this, function(param) {
23                                this.value = this._getDomScrollerValue();
24                                this.onChange(this.value);
25                                this.onScroll(this.value);
26                        })));
27                },
28
29                _getDomScrollerValue : function() {
30                        return this.domNode.scrollTop;
31                },
32               
33                _setDomScrollerValue : function(value) {
34                        this.domNode.scrollTop = value;
35                },
36                       
37                _setValueAttr: function(value){
38                        value = Math.min(this.maximum, value);
39                        value = Math.max(this.minimum, value);
40                        if (this.value != value) {
41                                this.value = value;                     
42                                this.onChange(value);
43                                this._setDomScrollerValue(value);
44                        }
45                },
46                               
47                onChange: function(value){
48                        // summary:
49                        //               An extension point invoked when the value has changed.
50                        // value: Integer
51                        //              The postiion of the scroll bar in pixels.
52                        // tags:
53                        //              callback
54                },
55               
56                onScroll: function(value){
57                        // summary:
58                        //               An extension point invoked when the user scrolls with the mouse.
59                        // value: Integer
60                        //              The position of the scroll bar in pixels.
61                        // tags:
62                        //              callback
63                },
64               
65                _setMinimumAttr: function(value){
66                        value = Math.min(value, this.maximum);
67                        this.minimum = value;
68                },
69               
70                _setMaximumAttr: function(value){
71                        value = Math.max(value, this.minimum);
72                        this.maximum = value;
73                       
74                        domStyle.set(this.content, "height", value + "px");
75                }
76
77        });
78
79});
Note: See TracBrowser for help on using the repository browser.