Dial.js revision 3e16868ea3bfcadfeeb8e23aca5bb2317a6a8ba9
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * Create a circular dial value range input visualized as a draggable handle on a
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * background element.
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @module dial
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * Create a dial to represent an input control capable of representing a
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * series of intermediate states based on the position of the Dial's handle.
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * These states are typically aligned to a value algorithm whereby the angle of the handle's
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * position corresponds to a given value.
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @class Dial
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @extends Widget
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @param config {Object} Configuration object
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @constructor
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff Dial.superclass.constructor.apply(this, arguments);
f47f024e093853ad3957be898687fc8317a835daJeff Conniff // Y.Dial static properties
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * The identity of the widget.
10d8bafc5c24f3a4285cf6060a1935ba5cfc4b85Luke Smith * @property Dial.NAME
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @type String
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @default 'dial'
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @protected
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * Static property used to define the default attribute configuration of
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * the Widget.
10d8bafc5c24f3a4285cf6060a1935ba5cfc4b85Luke Smith * @property Dial.ATTRS
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @type {Object}
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @protected
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * minimum value allowed
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @attribute min
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @type {Number}
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @default -220
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * maximum value allowed
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @attribute max
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @type {Number}
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @default 220
04f7ef259d54aeab53258697e1e7f8856adcc8a6Jeff Conniff * diameter of the circular background object
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * other objects scale accordingly
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @attribute diameter
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @type {Number} the number of px in diameter
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @default 100
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * initial value of the Dial
691af6c84a00ad5f629ffcfa3b1e42c38da5da4fJeff Conniff * @attribute value
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @type {Number}
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @default 0
691af6c84a00ad5f629ffcfa3b1e42c38da5da4fJeff Conniff * amount to increment/decrement the dial value
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * when the arrow up/down/left/right keys are pressed
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @attribute minorStep
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @type {Number}
691af6c84a00ad5f629ffcfa3b1e42c38da5da4fJeff Conniff * @default 1
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * amount to increment/decrement the dial value
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * when the page up/down keys are pressed
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @attribute majorStep
691af6c84a00ad5f629ffcfa3b1e42c38da5da4fJeff Conniff * @type {Number}
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @default 10
691af6c84a00ad5f629ffcfa3b1e42c38da5da4fJeff Conniff * number of value increments in one 360 degree revolution
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * of the handle around the dial
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @attribute stepsPerRev
691af6c84a00ad5f629ffcfa3b1e42c38da5da4fJeff Conniff * @type {Number}
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @default 100
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * number of decimal places of accuracy in the value
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * @attribute decimalPlaces
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * @type {Number}
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * @default 0
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * visible strings for the dial UI. This attribute is
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * defined by the base Widget class but has an empty value. The
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * Dial is simply providing a default value for the attribute.
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * Gets localized strings in the current language
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * @attribute strings
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * @type {Object}
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * @default {label: 'My label', resetStr: 'Reset', tooltipHandle: 'Drag to set value'}
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff valueFn: function () {
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * distance from the center of the dial to the
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * resting place of the center of the handle and marker.
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * The value is a percent of the radius of the dial.
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @attribute handleDist
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @type {number}
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @default 0.75
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * returns a properly formed yui class name
44c68f247b9311ea767cb4656220793317e3383bJeff Conniff * @param {String} string to be appended at the end of class name
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff return Y.ClassNameManager.getClassName(Dial.NAME, str);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * array of static constants used to identify the classname applied to the Dial DOM objects
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @property Dial.CSS_CLASSES
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @type {Array}
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff centerButtonVml : makeClassName('center-button-vml'),
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff dragging : Y.ClassNameManager.getClassName("dd-dragging")
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff /* Static constants used to define the markup templates used to create Dial DOM elements */
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff var labelId = Dial.CSS_CLASSES.label + Y.guid(); //get this unique id once then use
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * template that will contain the Dial's label.
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @property Dial.LABEL_TEMPLATE
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @type {String}
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @default <div>...</div>
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff Dial.LABEL_TEMPLATE = '<div id="' + labelId + '" class="' + Dial.CSS_CLASSES.label + '"><span class="' + Dial.CSS_CLASSES.labelString + '">{label}</span><span class="' + Dial.CSS_CLASSES.valueString + '"></span></div>';
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff if(supportsVML === false){
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * template that will contain the Dial's background ring.
8318d5e58f691e33af95ced531746726ad592bb7Jeff Conniff * @property Dial.RING_TEMPLATE
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @type {String}
10d8bafc5c24f3a4285cf6060a1935ba5cfc4b85Luke Smith * @default <div class="[...-ring]"><div class="[...-northMark]"></div></div>
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @protected
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff Dial.RING_TEMPLATE = '<div class="' + Dial.CSS_CLASSES.ring + '"><div class="' + Dial.CSS_CLASSES.northMark + '"></div></div>';
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * template that will contain the Dial's current angle marker.
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @property Dial.MARKER_TEMPLATE
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @type {String}
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @default <div class="[...-marker] [...-marker-hidden]"><div class="[...-markerUser]"></div></div>
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff Dial.MARKER_TEMPLATE = '<div class="' + Dial.CSS_CLASSES.marker + ' ' + Dial.CSS_CLASSES.markerHidden + '"><div class="' + Dial.CSS_CLASSES.markerUser + '"></div></div>';
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * template that will contain the Dial's center button.
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @property Dial.CENTER_BUTTON_TEMPLATE
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @type {String}
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @default <div class="[...-centerButton]"><div class="[...-resetString]">' + Y.substitute('{resetStr}', Dial.ATTRS.strings.value) + '</div></div>
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff Dial.CENTER_BUTTON_TEMPLATE = '<div class="' + Dial.CSS_CLASSES.centerButton + '"><div class="' + Dial.CSS_CLASSES.resetString + '">{resetStr}</div></div>';
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * template that will contain the Dial's handle.
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @property Dial.HANDLE_TEMPLATE
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @type {String}
10d8bafc5c24f3a4285cf6060a1935ba5cfc4b85Luke Smith * @default <div class="[...-handle]"><div class="[...-handleUser]" aria-labelledby="' + labelId + '" aria-valuetext="" aria-valuemax="" aria-valuemin="" aria-valuenow="" role="slider" tabindex="0"></div></div>';// title="{tooltipHandle}"
aa1805d3af3a9ac854fadba9707e18ee5f006804Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff Dial.HANDLE_TEMPLATE = '<div class="' + Dial.CSS_CLASSES.handle + '"><div class="' + Dial.CSS_CLASSES.handleUser + '" aria-labelledby="' + labelId + '" aria-valuetext="" aria-valuemax="" aria-valuemin="" aria-valuenow="" role="slider" tabindex="0" title="{tooltipHandle}"></div></div>';// title="{tooltipHandle}"
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff }else{ // VML case
f51c5d369e8c6bc97e7b9486fc706325ffe1f0adJeff Conniff Dial.RING_TEMPLATE = '<div class="' + Dial.CSS_CLASSES.ring + ' ' + Dial.CSS_CLASSES.ringVml + '">'+
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff '<div class="' + Dial.CSS_CLASSES.northMark + '"></div>'+
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff '<v:oval strokecolor="#ceccc0" strokeweight="1px"><v:fill type=gradient color="#8B8A7F" color2="#EDEDEB" angle="45"/></v:oval>'+
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff //'<v:oval></v:oval>'+
10d8bafc5c24f3a4285cf6060a1935ba5cfc4b85Luke Smith Dial.MARKER_TEMPLATE = '<div class="' + Dial.CSS_CLASSES.marker + ' ' + Dial.CSS_CLASSES.markerHidden + '">'+
aa1805d3af3a9ac854fadba9707e18ee5f006804Jeff Conniff '<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v"/><v:oval stroked="false" class="' + Dial.CSS_CLASSES.markerUser + '">'+
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff '<v:fill opacity="20%" color="#000"/>'+
f47f024e093853ad3957be898687fc8317a835daJeff Conniff '</v:oval>'+
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff //'<v:oval></v:oval>'+
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff Dial.CENTER_BUTTON_TEMPLATE = '<div class="' + Dial.CSS_CLASSES.centerButton + ' ' + Dial.CSS_CLASSES.centerButtonVml + '">'+
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff '<v:oval strokecolor="#ceccc0" strokeweight="1px">'+
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff '<v:fill type=gradient color="#C7C5B9" color2="#fefcf6" colors="35% #d9d7cb, 65% #fefcf6" angle="45"/>'+
10d8bafc5c24f3a4285cf6060a1935ba5cfc4b85Luke Smith '<v:shadow on="True" color="#000" opacity="10%" offset="2px, 2px"/>'+
aa1805d3af3a9ac854fadba9707e18ee5f006804Jeff Conniff '</v:oval>'+
3e16868ea3bfcadfeeb8e23aca5bb2317a6a8ba9Jeff Conniff //'<v:oval></v:oval>'+
f47f024e093853ad3957be898687fc8317a835daJeff Conniff '<div class="' + Dial.CSS_CLASSES.resetString + '">{resetStr}</div>'+
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff Dial.HANDLE_TEMPLATE = '<div class="' + Dial.CSS_CLASSES.handle + '">'+
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff '<v:oval stroked="false" class="' + Dial.CSS_CLASSES.handleUser + '"'+
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff ' aria-labelledby="' + labelId + '" aria-valuetext="" aria-valuemax="" aria-valuemin="" aria-valuenow="" role="slider" tabindex="0" title="{tooltipHandle}">'+ //title="{tooltipHandle}"
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff '<v:fill opacity="20%" color="#6C3A3A"/>'+
10d8bafc5c24f3a4285cf6060a1935ba5cfc4b85Luke Smith '</v:oval>'+
aa1805d3af3a9ac854fadba9707e18ee5f006804Jeff Conniff //'<v:oval></v:oval>'+
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff /* Dial extends the base Widget class */
10d8bafc5c24f3a4285cf6060a1935ba5cfc4b85Luke Smith * creates the DOM structure for the Dial.
f51c5d369e8c6bc97e7b9486fc706325ffe1f0adJeff Conniff * @method renderUI
f47f024e093853ad3957be898687fc8317a835daJeff Conniff * @protected
f51c5d369e8c6bc97e7b9486fc706325ffe1f0adJeff Conniff renderUI : function() {
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff if(supportsVML){
691af6c84a00ad5f629ffcfa3b1e42c38da5da4fJeff Conniff this._setVMLSizes();
624b3d25f12c6e63f607b2690315293ad7ef6481Jeff Conniff // object handles
2aa0883432cf56a974eb9261afcf6ede4313384cJeff Conniff // constants
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff this._handleDist = this._centerX * this.get('handleDist');
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff // variables
f51c5d369e8c6bc97e7b9486fc706325ffe1f0adJeff Conniff this._angle = this._getAngleFromValue(this.get('value'));
624b3d25f12c6e63f607b2690315293ad7ef6481Jeff Conniff this._setTimesWrapedFromValue(this.get('value'));
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff this._handleUserNode.set('aria-valuemin', this.get('min'));
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff this._handleUserNode.set('aria-valuemax', this.get('max'));
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * Creates the Y.DD.Drag instance used for the handle movement and
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * binds Dial interaction to the configured value model.
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method bindUI
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff bindUI : function() {
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this.after("valueChange", this._afterValueChange);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff // Looking for a key event which will fire continously across browsers while the key is held down.
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff keyEventSpec = (!Y.UA.opera) ? "down:" : "press:",
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff keyLeftRightSpec = (!Y.UA.opera) ? "down:" : "press:";
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff // 38, 40 = arrow up/down, 33, 34 = page up/down, 35 , 36 = end/home
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff // 37 , 39 = arrow left/right
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff Y.on("key", Y.bind(this._onDirectionKey, this), boundingBox, keyEventSpec);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff Y.on("key", Y.bind(this._onLeftRightKey, this), boundingBox, keyLeftRightSpec);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff Y.on('mouseenter', Y.bind(this._dialCenterOver, this), this._centerButtonNode);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff Y.on('mouseleave', Y.bind(this._dialCenterOut, this), this._centerButtonNode);
62280f8683de7078a1eb123153c33822cd3bca37Jeff Conniff Y.on('click', Y.bind(this._resetDial, this), this._centerButtonNode);
62280f8683de7078a1eb123153c33822cd3bca37Jeff Conniff Y.on('mousedown', Y.bind(function(){this._handleUserNode.focus();}, this), this._handleNode);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff 'drag:start' : Y.bind(this._handleDragStart, this),
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * Sets _timesWrapped based on Dial value
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * to net integer revolutions the user dragged the handle around the Dial
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _setTimesWrapedFromValue
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @param val {Number} current value of the Dial
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this._timesWrapped = (val / this.get('stepsPerRev')) -1;
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this._timesWrapped = Math.floor(val / this.get('stepsPerRev'));
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * Sets the string in the object the user clicks to reset the Dial value
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _dialCenterOver
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @param e {DOMEvent} the mouseover event object
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this._resetString.setContent(Y.substitute('{resetStr}', this.get('strings')));
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff * Sets the string in the object the user clicks to reset the Dial value
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff * @method _dialCenterOut
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff * @param e {DOMEvent} the mouseover event object
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff * handles the user dragging the handle around the Dial, calculates the angle,
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff * checks for wrapping around top center, handles exceeding min or max values
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff * @method _handleDrag
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff * @param e {DOMEvent} the drag event object
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff * @protected
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff _handleDrag : function(e){
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff var ang = Math.atan( (this._centerYOnPage - e.pageY) / (this._centerXOnPage - e.pageX) ) * (180 / Math.PI),
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff // check for need to set timesWrapped
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff if(e.pageY < this._centerYOnPage){ //if handle is above the middle of the dial...
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff if((this._prevX <= this._centerXOnPage) && (e.pageX > this._centerXOnPage)){ // If wrapping, clockwise
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff }else if((this._prevX > this._centerXOnPage) && (e.pageX <= this._centerXOnPage)){ // if un-wrapping, counter-clockwise
2a43a857fc701d8ce0505c3f133e051f2d3c60d8Jeff Conniff var newValue = this._getValueFromAngle(ang); // This function needs the current _timesWrapped value
2a43a857fc701d8ce0505c3f133e051f2d3c60d8Jeff Conniff // handle hitting max and min and going beyond, stops at max or min
2a43a857fc701d8ce0505c3f133e051f2d3c60d8Jeff Conniff //if((newValue > this.get('min')) && (newValue < this.get('max'))) {
2a43a857fc701d8ce0505c3f133e051f2d3c60d8Jeff Conniff if((newValue > this.get('min')) && (newValue < this.get('max'))) {
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff * handles the user starting to drag the handle around the Dial
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff * @method _handleDragStart
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @param e {DOMEvent} the drag event object
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this._markerNode.removeClass(Dial.CSS_CLASSES.markerHidden);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this._centerYOnPage = (this._ringNode.getY() + this._centerY);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this._centerXOnPage = (this._ringNode.getX() + this._centerX);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * When handle is handleDragEnd, this animates the return to the fixed dial
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * handles the end of a user dragging the handle, animates the handle returning to
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * resting position.
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _handleDragEnd
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
3909982acea3ffce1cb7435b87bee218e423c1ddJeff Conniff }, Y.bind(function(){
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this._markerNode.addClass(Dial.CSS_CLASSES.markerHidden);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this._prevX = this._handleNode.getX(); //makes us ready for next drag.
3909982acea3ffce1cb7435b87bee218e423c1ddJeff Conniff this._setTimesWrapedFromValue(this.get('value'));
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * returns the XY of the fixed position, handleDist, from the center of the Dial (resting position)
7ef04b5748675b524f9891e401b90ba8a0162b07Jeff Conniff * The XY also represents the angle related to the current value
7ef04b5748675b524f9891e401b90ba8a0162b07Jeff Conniff * If no param is passed, [X,Y] is returned.
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * If param is passed, the XY of the node passed is set.
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _setNodeToFixedRadius
b5f4e5800a70a87e769d27222144299256fdb5c5Jeff Conniff * @param obj {Node}
7ef04b5748675b524f9891e401b90ba8a0162b07Jeff Conniff * @protected
b5f4e5800a70a87e769d27222144299256fdb5c5Jeff Conniff * @return {Array} an array of [XY] is optionally returned
7ef04b5748675b524f9891e401b90ba8a0162b07Jeff Conniff var newY = Math.round(Math.sin(thisAngle * rad) * this._handleDist);
7ef04b5748675b524f9891e401b90ba8a0162b07Jeff Conniff var newX = Math.round(Math.cos(thisAngle * rad) * this._handleDist);
b5f4e5800a70a87e769d27222144299256fdb5c5Jeff Conniff obj.setXY([(this._ringNode.getX() + this._centerX + newX), (this._ringNode.getY() + this._centerY + newY)]);
b5f4e5800a70a87e769d27222144299256fdb5c5Jeff Conniff }else{ // just need the style for css transform left and top to animate the handle drag:end
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff return [this._centerX + newX, this._centerX + newY];
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff * Synchronizes the DOM state with the attribute settings.
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff * @method syncUI
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff syncUI : function() {
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff // Trying to fix the bug: "- ie8 ignores percent style sizes/offsets"
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff // After applying other fixes, it seems to not be a problem
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff // Needs more testing
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff // See where it's called above in renderUI
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff _setVMLSizes : function(){
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff var dia = this.get('diameter');
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff var setSize = function(node, dia, percent){
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff var suffix = 'px';
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff //alert(node.getElementsByTagName('fill').getStyle('width') + 'hello');
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff node.getElementsByTagName('fill').setStyle('width', (dia * percent) + suffix);
43505e8a0a678fc9e08ebf98acad98ca67eff976Jeff Conniff node.getElementsByTagName('fill').setStyle('height', (dia * percent) + suffix);
3909982acea3ffce1cb7435b87bee218e423c1ddJeff Conniff //alert(node.getElementsByTagName('fill').getStyle('width') + ' after');
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff setSize(this._ringNode, dia, 1.0);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff setSize(this._handleUserNode, dia, 0.2);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff setSize(this._markerUserNode, dia, 0.1);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff setSize(this._centerButtonNode, dia, 0.5);
7ef04b5748675b524f9891e401b90ba8a0162b07Jeff Conniff * renders the DOM object for the Dial's label
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _renderLabel
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
7ef04b5748675b524f9891e401b90ba8a0162b07Jeff Conniff _renderLabel : function() {
7ef04b5748675b524f9891e401b90ba8a0162b07Jeff Conniff label = contentBox.one("." + Dial.CSS_CLASSES.label);
7ef04b5748675b524f9891e401b90ba8a0162b07Jeff Conniff label = Node.create(Y.substitute(Dial.LABEL_TEMPLATE, this.get('strings')));
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this._valueStringNode = this._labelNode.one("." + Dial.CSS_CLASSES.valueString);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * renders the DOM object for the Dial's background ring
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _renderRing
62280f8683de7078a1eb123153c33822cd3bca37Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff _renderRing : function() {
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff ring = contentBox.one("." + Dial.CSS_CLASSES.ring);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff ring = contentBox.appendChild(Dial.RING_TEMPLATE);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff ring.setStyles({width:this.get('diameter') + 'px', height:this.get('diameter') + 'px'});
62280f8683de7078a1eb123153c33822cd3bca37Jeff Conniff * renders the DOM object for the Dial's background marker which
62280f8683de7078a1eb123153c33822cd3bca37Jeff Conniff * tracks the angle of the user dragging the handle
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _renderMarker
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
7ef04b5748675b524f9891e401b90ba8a0162b07Jeff Conniff marker = contentBox.one("." + Dial.CSS_CLASSES.marker);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff marker = contentBox.one('.' + Dial.CSS_CLASSES.ring).appendChild(Dial.MARKER_TEMPLATE);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this._markerUserNode = this._markerNode.one('.' + Dial.CSS_CLASSES.markerUser);
7ef04b5748675b524f9891e401b90ba8a0162b07Jeff Conniff * places the centerbutton's reset string in the center of the button
3909982acea3ffce1cb7435b87bee218e423c1ddJeff Conniff * based on the size of the string object
7ef04b5748675b524f9891e401b90ba8a0162b07Jeff Conniff * @method _setXYResetString
7ef04b5748675b524f9891e401b90ba8a0162b07Jeff Conniff * @protected
7ef04b5748675b524f9891e401b90ba8a0162b07Jeff Conniff this._resetString.setStyle('top', (this._centerButtonNode.get('region').height / 2) - (this._resetString.get('region').height / 2) + 'px');
7ef04b5748675b524f9891e401b90ba8a0162b07Jeff Conniff this._resetString.setStyle('left', (this._centerButtonNode.get('region').width / 2) - (this._resetString.get('region').width / 2) + 'px');
3909982acea3ffce1cb7435b87bee218e423c1ddJeff Conniff * renders the DOM object for the Dial's center
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _renderCenterButton
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff centerButton = contentBox.one("." + Dial.CSS_CLASSES.centerButton);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff centerButton = Node.create(Y.substitute(Dial.CENTER_BUTTON_TEMPLATE, this.get('strings')));
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff contentBox.one('.' + Dial.CSS_CLASSES.ring).append(centerButton);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this._resetString = this._centerButtonNode.one('.' + Dial.CSS_CLASSES.resetString);
dfce478dfa2a75c4dfcacb60b7321f9ef37c8477Jeff Conniff this._setXYResetString(); // centering the reset string in the button
dfce478dfa2a75c4dfcacb60b7321f9ef37c8477Jeff Conniff //var offset = (this._ringNode.get('region').width - this._centerButtonNode.get('region').width) / 2;
dfce478dfa2a75c4dfcacb60b7321f9ef37c8477Jeff Conniff var offset = this._ringNode.get('region').width * 0.25; //better in IE
dfce478dfa2a75c4dfcacb60b7321f9ef37c8477Jeff Conniff this._centerButtonNode.setXY([(this._ringNode.getX() + offset), (this._ringNode.getY() + offset)]);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * renders the DOM object for the Dial's user draggable handle
dfce478dfa2a75c4dfcacb60b7321f9ef37c8477Jeff Conniff * @method _renderHandle
dfce478dfa2a75c4dfcacb60b7321f9ef37c8477Jeff Conniff * @protected
dfce478dfa2a75c4dfcacb60b7321f9ef37c8477Jeff Conniff handle = contentBox.one("." + Dial.CSS_CLASSES.handle);
dfce478dfa2a75c4dfcacb60b7321f9ef37c8477Jeff Conniff handle = Node.create(Y.substitute(Dial.HANDLE_TEMPLATE, this.get('strings')));
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff contentBox.one('.' + Dial.CSS_CLASSES.ring).append(handle);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this._handleUserNode = this._handleNode.one('.' + Dial.CSS_CLASSES.handleUser);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * sets the visible UI label string
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method setLabelString
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @param str {String}
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this.get("contentBox").one("." + Dial.CSS_CLASSES.labelString).setContent(str);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * sets the visible UI label string
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method setResetString
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @param str {String}
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this.get("contentBox").one("." + Dial.CSS_CLASSES.resetString).setContent(str);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this._setXYResetString(); // recenters the string in the button
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * sets the tooltip string in the Dial's handle
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method setTooltipString
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @param str {String}
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this.get("contentBox").one("." + Dial.CSS_CLASSES.handleUser).set('title', str);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * sets the Dial's value in response to key events.
dfce478dfa2a75c4dfcacb60b7321f9ef37c8477Jeff Conniff * Left and right keys are in a separate method
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * in case an implementation wants to increment values
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * but needs left and right arrow keys for other purposes.
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _onDirectionKey
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @param e {Event} the key event
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff _onDirectionKey : function(e) {
3909982acea3ffce1cb7435b87bee218e423c1ddJeff Conniff * sets the Dial's value in response to left or right key events
3909982acea3ffce1cb7435b87bee218e423c1ddJeff Conniff * @method _onLeftRightKey
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @param e {Event} the key event
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff _onLeftRightKey : function(e) {
3909982acea3ffce1cb7435b87bee218e423c1ddJeff Conniff * increments Dial value by a minor increment
736745cee753d967cf5fb1063c21578ecca61b4aJeff Conniff * @method _incrMinor
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff var newVal = (this.get('value') + this.get("minorStep"));
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * decrements Dial value by a minor increment
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _decrMinor
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff var newVal = (this.get('value') - this.get("minorStep"));
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * increments Dial value by a major increment
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _incrMajor
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff var newVal = (this.get('value') + this.get("majorStep"));
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * decrements Dial value by a major increment
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _decrMajor
62280f8683de7078a1eb123153c33822cd3bca37Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff var newVal = (this.get('value') - this.get("majorStep"));
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * sets Dial value to dial's max attr
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _decrMajor
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * sets Dial value to dial's min attr
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _decrMajor
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * resets Dial value to the orignal initial value.
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _resetDial
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * returns the handle angle associated with the current value of the Dial
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _getAngleFromValue
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @param newVal {Number} the current value of the Dial
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @return {Number} the angle associated with the current Dial value
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff var nonWrapedPartOfValue = newVal % this.get('stepsPerRev');
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff var angleFromValue = nonWrapedPartOfValue / this.get('stepsPerRev') * 360;
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * returns the value of the Dial calculated from the current handle angle
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _getValueFromAngle
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @param angle {Number} the current angle of the Dial's handle
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @return {Number} the current Dial value corresponding to the handle position
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff var value = (angle / 360) * this.get('stepsPerRev');
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff value = (value + (this._timesWrapped * this.get('stepsPerRev')));
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff //return Math.round(value * 100) / 100;
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff return value.toFixed(this.get('decimalPlaces')) - 0;
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * calls the method to update the UI whenever the Dial value changes
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _afterValueChange
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @param e {Event}
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * Updates the UI display value of the Dial to reflect
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * the value passed in.
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * Makes all other needed UI display changes
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @method _uiSetValue
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @param val {Number} value of the Dial
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * @protected
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff if(this._handleNode.hasClass(Dial.CSS_CLASSES.dragging) === false){
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this._handleUserNode.set('aria-valuenow', val);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this._handleUserNode.set('aria-valuetext', val);
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff if((val === this.get('max')) || (val === this.get('min'))){
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff if(this._markerUserNode.hasClass('marker-max-min') === false){
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff this._markerUserNode.addClass('marker-max-min');
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff this._markerUserNode.getElementsByTagName('fill').set('color', '#AB3232');
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff this._markerUserNode.getElementsByTagName('fill').set('color', '#000');
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff if(this._markerUserNode.hasClass('marker-max-min') === true){
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff this._markerUserNode.removeClass('marker-max-min');
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * value attribute default validator. Verifies that
91f1deca7427bc48d15c263856f567a6bab97394Jeff Conniff * the value being set lies between the min/max value
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * @method _validateValue
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * @param val {Number} value of the Dial
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff * @protected
df71f95acec70ebddf0ab97cc1e0ff2b70048017Jeff Conniff return (Lang.isNumber(val) && val >= min && val <= max);