~cdparra/gelee/trunk

« back to all changes in this revision

Viewing changes to webui/ecosystem/workspace/extjs/docs/source/PanelResizer.html

  • Committer: parra
  • Date: 2010-03-15 15:56:56 UTC
  • Revision ID: svn-v4:ac5bba68-f036-4e09-846e-8f32731cc928:trunk/gelee:1448
merged gelee at svn

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
  <title>The source code</title>
 
4
    <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
 
5
    <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
 
6
</head>
 
7
<body  onload="prettyPrint();">
 
8
    <pre class="prettyprint lang-js">Ext.ux.PanelResizer = Ext.extend(Ext.util.Observable, {
 
9
    minHeight: 0,
 
10
    maxHeight:10000000,
 
11
 
 
12
    constructor: function(config){
 
13
        Ext.apply(this, config);
 
14
        this.events = {};
 
15
        Ext.ux.PanelResizer.superclass.constructor.call(this, config);
 
16
    },
 
17
 
 
18
    init : function(p){
 
19
        this.panel = p;
 
20
 
 
21
        if(this.panel.elements.indexOf('footer')==-1){
 
22
            p.elements += ',footer';
 
23
        }
 
24
        p.on('render', this.onRender, this);
 
25
    },
 
26
 
 
27
    onRender : function(p){
 
28
        this.handle = p.footer.createChild({cls:'x-panel-resize'});
 
29
 
 
30
        this.tracker = new Ext.dd.DragTracker({
 
31
            onStart: this.onDragStart.createDelegate(this),
 
32
            onDrag: this.onDrag.createDelegate(this),
 
33
            onEnd: this.onDragEnd.createDelegate(this),
 
34
            tolerance: 3,
 
35
            autoStart: 300
 
36
        });
 
37
        this.tracker.initEl(this.handle);
 
38
        p.on('beforedestroy', this.tracker.destroy, this.tracker);
 
39
    },
 
40
 
 
41
        // private
 
42
    onDragStart: function(e){
 
43
        this.dragging = true;
 
44
        this.startHeight = this.panel.el.getHeight();
 
45
        this.fireEvent('dragstart', this, e);
 
46
    },
 
47
 
 
48
        // private
 
49
    onDrag: function(e){
 
50
        this.panel.setHeight((this.startHeight-this.tracker.getOffset()[1]).constrain(this.minHeight, this.maxHeight));
 
51
        this.fireEvent('drag', this, e);
 
52
    },
 
53
 
 
54
        // private
 
55
    onDragEnd: function(e){
 
56
        this.dragging = false;
 
57
        this.fireEvent('dragend', this, e);
 
58
    }
 
59
});
 
60
Ext.preg('panelresizer', Ext.ux.PanelResizer);</pre>    
 
61
</body>
 
62
</html>
 
 
b'\\ No newline at end of file'