X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..6e39d509471fe9b4e2660e0d1631b350d0c66f40:/docs/source/Slider.html diff --git a/docs/source/Slider.html b/docs/source/Slider.html index 764ecfcf..529a424b 100644 --- a/docs/source/Slider.html +++ b/docs/source/Slider.html @@ -1,17 +1,12 @@ - - - The source code - - - - -
/*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-
/** + + + + The source code + + + + +
/** * @class Ext.Slider * @extends Ext.BoxComponent * Slider which supports vertical or horizontal orientation, keyboard adjustments, @@ -169,12 +164,13 @@ Ext.Slider = Ext.extend(Ext.BoxComponent, { autoStart: 300 }); this.tracker.initEl(this.thumb); - this.on('beforedestroy', this.tracker.destroy, this.tracker); }, // private override onMouseDown : function(e){ - if(this.disabled) {return;} + if(this.disabled){ + return; + } if(this.clickToChange && e.target != this.thumb.dom){ var local = this.innerEl.translatePoints(e.getXY()); this.onClickChange(local); @@ -219,11 +215,12 @@ Ext.Slider = Ext.extend(Ext.BoxComponent, { // private doSnap : function(value){ - if(!this.increment || this.increment == 1 || !value) { + if(!(this.increment && value)){ return value; } - var newValue = value, inc = this.increment; - var m = value % inc; + var newValue = value, + inc = this.increment, + m = value % inc; if(m != 0){ newValue -= m; if(m * 2 > inc){ @@ -251,8 +248,8 @@ Ext.Slider = Ext.extend(Ext.BoxComponent, { // private getRatio : function(){ - var w = this.innerEl.getWidth(); - var v = this.maxValue - this.minValue; + var w = this.innerEl.getWidth(), + v = this.maxValue - this.minValue; return v == 0 ? w : (w/v); }, @@ -285,12 +282,12 @@ Ext.Slider = Ext.extend(Ext.BoxComponent, { // private translateValue : function(v){ var ratio = this.getRatio(); - return (v * ratio)-(this.minValue * ratio)-this.halfThumb; + return (v * ratio) - (this.minValue * ratio) - this.halfThumb; }, reverseValue : function(pos){ var ratio = this.getRatio(); - return (pos+this.halfThumb+(this.minValue * ratio))/ratio; + return (pos + this.halfThumb + (this.minValue * ratio)) / ratio; }, // private @@ -366,7 +363,7 @@ Ext.Slider = Ext.extend(Ext.BoxComponent, { this.thumb.removeClass(this.disabledClass); if(Ext.isIE){ this.innerEl.removeClass(this.disabledClass).dom.disabled = false; - if (this.thumbHolder){ + if(this.thumbHolder){ this.thumbHolder.hide(); } this.thumb.show(); @@ -392,6 +389,12 @@ Ext.Slider = Ext.extend(Ext.BoxComponent, { */ getValue : function(){ return this.value; + }, + + // private + beforeDestroy : function(){ + Ext.destroyMembers(this, 'endEl', 'innerEl', 'thumb', 'halfThumb', 'focusEl', 'tracker', 'thumbHolder'); + Ext.Slider.superclass.beforeDestroy.call(this); } }); Ext.reg('slider', Ext.Slider); @@ -404,8 +407,8 @@ Ext.Slider.Vertical = { }, getRatio : function(){ - var h = this.innerEl.getHeight(); - var v = this.maxValue - this.minValue; + var h = this.innerEl.getHeight(), + v = this.maxValue - this.minValue; return h/v; }, @@ -418,18 +421,18 @@ Ext.Slider.Vertical = { }, onDrag: function(e){ - var pos = this.innerEl.translatePoints(this.tracker.getXY()); - var bottom = this.innerEl.getHeight()-pos.top; + var pos = this.innerEl.translatePoints(this.tracker.getXY()), + bottom = this.innerEl.getHeight()-pos.top; this.setValue(this.minValue + Ext.util.Format.round(bottom/this.getRatio(), this.decimalPrecision), false); this.fireEvent('drag', this, e); }, onClickChange : function(local){ if(local.left > this.clickRange[0] && local.left < this.clickRange[1]){ - var bottom = this.innerEl.getHeight()-local.top; + var bottom = this.innerEl.getHeight() - local.top; this.setValue(this.minValue + Ext.util.Format.round(bottom/this.getRatio(), this.decimalPrecision), undefined, true); } } -};
- +};
+ \ No newline at end of file