~cdparra/gelee/trunk

« back to all changes in this revision

Viewing changes to webui/ecosystem/workspace/extjs/examples/ux/SliderTip.js

  • 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
/*!
 
2
 * Ext JS Library 3.0.0
 
3
 * Copyright(c) 2006-2009 Ext JS, LLC
 
4
 * licensing@extjs.com
 
5
 * http://www.extjs.com/license
 
6
 */
 
7
/**
 
8
 * @class Ext.ux.SliderTip
 
9
 * @extends Ext.Tip
 
10
 * Simple plugin for using an Ext.Tip with a slider to show the slider value
 
11
 */
 
12
Ext.ux.SliderTip = Ext.extend(Ext.Tip, {
 
13
    minWidth: 10,
 
14
    offsets : [0, -10],
 
15
    init : function(slider){
 
16
        slider.on('dragstart', this.onSlide, this);
 
17
        slider.on('drag', this.onSlide, this);
 
18
        slider.on('dragend', this.hide, this);
 
19
        slider.on('destroy', this.destroy, this);
 
20
    },
 
21
 
 
22
    onSlide : function(slider){
 
23
        this.show();
 
24
        this.body.update(this.getText(slider));
 
25
        this.doAutoWidth();
 
26
        this.el.alignTo(slider.thumb, 'b-t?', this.offsets);
 
27
    },
 
28
 
 
29
    getText : function(slider){
 
30
        return String(slider.getValue());
 
31
    }
 
32
});