cleaning up

This commit is contained in:
Jono Brandel 2011-02-11 11:18:40 -08:00
parent 5d43707a21
commit d9947b05dc

View File

@ -3,6 +3,16 @@ GUI.Slider = function(numberController, min, max, step, initValue) {
var clicked = false; var clicked = false;
var _this = this; 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) { var onDrag = function(e) {
if (!clicked) return; if (!clicked) return;
var pos = findPos(_this.domElement); var pos = findPos(_this.domElement);
@ -32,16 +42,6 @@ GUI.Slider = function(numberController, min, max, step, initValue) {
document.removeEventListener('mouseup', mouseup, false); 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 findPos = function(obj) {
var curleft = 0, curtop = 0; var curleft = 0, curtop = 0;
if (obj.offsetParent) { if (obj.offsetParent) {