Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit e1f2dff

Browse files
author
Michael Chang
committed
+ adding a mouse wheel listener for firefox
+ fixing an issue causing mouse down to not work on firefox + adding overflow hidden for firefox (is this the right way?) + reducing the number of verts required per line
1 parent acd0295 commit e1f2dff

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

js/main.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,12 @@ function initScene() {
304304

305305
masterContainer.addEventListener( 'click', onClick, true );
306306
masterContainer.addEventListener( 'mousewheel', onMouseWheel, false );
307+
308+
// firefox
309+
masterContainer.addEventListener( 'DOMMouseScroll', function(e){
310+
var evt=window.event || e; //equalize event object
311+
onMouseWheel(evt);
312+
}, false );
307313

308314
document.addEventListener( 'keydown', onKeyDown, false);
309315

js/mousekeyboard.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function onDocumentMouseMove( event ) {
3333
}
3434

3535
function onDocumentMouseDown( event ) {
36-
if(event.srcElement.className.indexOf('noMapDrag') !== -1) {
36+
if(event.target.className.indexOf('noMapDrag') !== -1) {
3737
return;
3838
}
3939
dragging = true;
@@ -91,6 +91,10 @@ function onMouseWheel( event ){
9191
if (event.wheelDelta) { /* IE/Opera. */
9292
delta = event.wheelDelta/120;
9393
}
94+
// firefox
95+
else if( event.detail ){
96+
delta = -event.detail/3;
97+
}
9498

9599
if (delta)
96100
handleMWheel(delta);

js/visualize_lines.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function makeConnectionLineGeometry( exporter, importer, value, type ){
5555
// splineCurveB.updateArcLengths();
5656

5757
// how many vertices do we want on this guy? this is for *each* side
58-
var vertexCountDesired = Math.floor( /*splineCurveA.getLength()*/ distanceBetweenCountryCenter * 0.04 + 6 ) * 2;
58+
var vertexCountDesired = Math.floor( /*splineCurveA.getLength()*/ distanceBetweenCountryCenter * 0.02 + 6 ) * 2;
5959

6060
// collect the vertices
6161
var points = splineCurveA.getPoints( vertexCountDesired );

style.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
}
6060

6161
/* Main Styles */
62-
body { color:#000000; font-family:'Roboto'; font-size:14px; height:768px; min-width: 1280px; min-height: 860px;}
62+
body { color:#000000; font-family:'Roboto'; font-size:14px; height:768px; min-width: 1280px; min-height: 860px; overflow: hidden;}
6363
a { color:#ffffff; text-decoration:none; text-transform:uppercase; }
6464
a:hover { color:#8eb423; }
6565
h1 { font-family:'RopaSans'; font-weight:normal; }
@@ -72,6 +72,10 @@ li { list-style-type:none; }
7272
/* min-width:1280px;*/
7373
}
7474

75+
#visualization{
76+
position: fixed;
77+
}
78+
7579
#dataviz {
7680
background-color: #000000;
7781
margin: 0px;

0 commit comments

Comments
 (0)