From f814a5913126eb9894d0bb5a4ffc8df4c5600972 Mon Sep 17 00:00:00 2001 From: jonobr1 Date: Mon, 24 Jan 2011 22:51:06 -0800 Subject: [PATCH] made some browser depended changes --- FETCH_HEAD | 0 controller.number.js | 26 ++++++++++++-------------- 2 files changed, 12 insertions(+), 14 deletions(-) create mode 100644 FETCH_HEAD diff --git a/FETCH_HEAD b/FETCH_HEAD new file mode 100644 index 0000000..e69de29 diff --git a/controller.number.js b/controller.number.js index 3f569e1..90e835f 100644 --- a/controller.number.js +++ b/controller.number.js @@ -26,7 +26,8 @@ var NumberController = function() { var slider; - if (min && max) { + if (min && max && + (navigator.appVersion.indexOf("chrome") != -1 || navigator.appVersion.indexOf("Safari") != -1)) { slider = document.createElement('input'); slider.setAttribute('type', 'range'); @@ -58,24 +59,21 @@ var NumberController = function() { }, false); numberField.addEventListener('mousedown', function(e) { - py = y = e.pageY; - document.addEventListener('mousemove', dragNumberField, false); - }, false); - - - numberField.addEventListener('mouseup', function(e) { - updateValue(this.value); + py = y = e.pageY; + document.addEventListener('mousemove', dragNumberField, false); }, false); document.addEventListener('mouseup', function(e) { - document.removeEventListener('mousemove', dragNumberField, false); - _this.makeSelectable(GUI.domElement); - _this.makeSelectable(numberField); + document.removeEventListener('mousemove', dragNumberField, false); + _this.makeSelectable(GUI.domElement); + _this.makeSelectable(numberField); }, false); - document.addEventListener('mouseout', function(e) { - document.removeEventListener('mousemove', dragNumberField, false); - }, false); + if(navigator.appVersion.indexOf('chrome') != -1) { + document.addEventListener('mouseout', function(e) { + document.removeEventListener('mousemove', dragNumberField, false); + }, false); + } var dragNumberField = function(e) { e.preventDefault();