mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
made some browser depended changes
This commit is contained in:
parent
88eb51e7d5
commit
f814a59131
0
FETCH_HEAD
Normal file
0
FETCH_HEAD
Normal 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();
|
||||||
|
Loading…
Reference in New Issue
Block a user