made some browser depended changes

This commit is contained in:
jonobr1 2011-01-24 22:51:06 -08:00
parent 88eb51e7d5
commit f814a59131
2 changed files with 12 additions and 14 deletions

0
FETCH_HEAD Normal file
View File

View File

@ -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();