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; var slider;
if (min && max) { if (min && max &&
(navigator.appVersion.indexOf("chrome") != -1 || navigator.appVersion.indexOf("Safari") != -1)) {
slider = document.createElement('input'); slider = document.createElement('input');
slider.setAttribute('type', 'range'); slider.setAttribute('type', 'range');
@ -58,24 +59,21 @@ var NumberController = function() {
}, false); }, false);
numberField.addEventListener('mousedown', function(e) { numberField.addEventListener('mousedown', function(e) {
py = y = e.pageY; py = y = e.pageY;
document.addEventListener('mousemove', dragNumberField, false); document.addEventListener('mousemove', dragNumberField, false);
}, false);
numberField.addEventListener('mouseup', function(e) {
updateValue(this.value);
}, false); }, false);
document.addEventListener('mouseup', function(e) { document.addEventListener('mouseup', function(e) {
document.removeEventListener('mousemove', dragNumberField, false); document.removeEventListener('mousemove', dragNumberField, false);
_this.makeSelectable(GUI.domElement); _this.makeSelectable(GUI.domElement);
_this.makeSelectable(numberField); _this.makeSelectable(numberField);
}, false); }, false);
document.addEventListener('mouseout', function(e) { if(navigator.appVersion.indexOf('chrome') != -1) {
document.removeEventListener('mousemove', dragNumberField, false); document.addEventListener('mouseout', function(e) {
}, false); document.removeEventListener('mousemove', dragNumberField, false);
}, false);
}
var dragNumberField = function(e) { var dragNumberField = function(e) {
e.preventDefault(); e.preventDefault();