From d9947b05dcac69220c269cd53ca1c9434da1b7d1 Mon Sep 17 00:00:00 2001 From: Jono Brandel Date: Fri, 11 Feb 2011 11:18:40 -0800 Subject: [PATCH] cleaning up --- controllers/slider.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/controllers/slider.js b/controllers/slider.js index 2243a92..c7cec99 100644 --- a/controllers/slider.js +++ b/controllers/slider.js @@ -1,8 +1,18 @@ GUI.Slider = function(numberController, min, max, step, initValue) { - + var clicked = false; var _this = this; + var x, px; + + this.domElement = document.createElement('div'); + this.domElement.setAttribute('class', 'guidat-slider-bg'); + + this.fg = document.createElement('div'); + this.fg.setAttribute('class', 'guidat-slider-fg'); + + this.domElement.appendChild(this.fg); + var onDrag = function(e) { if (!clicked) return; var pos = findPos(_this.domElement); @@ -32,16 +42,6 @@ GUI.Slider = function(numberController, min, max, step, initValue) { document.removeEventListener('mouseup', mouseup, false); }; - var x, px; - - this.domElement = document.createElement('div'); - this.domElement.setAttribute('class', 'guidat-slider-bg'); - - this.fg = document.createElement('div'); - this.fg.setAttribute('class', 'guidat-slider-fg'); - - this.domElement.appendChild(this.fg); - var findPos = function(obj) { var curleft = 0, curtop = 0; if (obj.offsetParent) {