Line | |
---|
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 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.