Commit 3647fc09d8250e4dfdfd96a8d4cb7f83d7c88668
1 parent
72478660
update...
Showing
1 changed file
with
20 additions
and
6 deletions
src/main/resources/static/pages/m/m.html
| ... | ... | @@ -136,7 +136,6 @@ |
| 136 | 136 | svg g.gps-wrap > rect { |
| 137 | 137 | width: 64px; |
| 138 | 138 | height: 15px; |
| 139 | - rx: 2px; | |
| 140 | 139 | cursor: pointer; |
| 141 | 140 | stroke: #c94f21; |
| 142 | 141 | fill: #c94f21; |
| ... | ... | @@ -189,6 +188,13 @@ |
| 189 | 188 | display: block; |
| 190 | 189 | margin-bottom: 2px; |
| 191 | 190 | } |
| 191 | + | |
| 192 | + rect.station_text_rect{ | |
| 193 | + width: 250px; | |
| 194 | + height: 30px; | |
| 195 | + transform: translate(-9px, -11px); | |
| 196 | + fill: #fff0; | |
| 197 | + } | |
| 192 | 198 | </style> |
| 193 | 199 | </head> |
| 194 | 200 | |
| ... | ... | @@ -340,10 +346,10 @@ |
| 340 | 346 | |
| 341 | 347 | if (_call_info.auto) { |
| 342 | 348 | _call_info.auto = null; |
| 343 | - var $text = $('text.station_text[_id=' + _call_info.id + ']').trigger('click'); | |
| 349 | + var $rect = $('rect.station_text_rect[_id=' + _call_info.id + ']').trigger('click'); | |
| 344 | 350 | |
| 345 | 351 | $('.station_chart_wrap').animate({ |
| 346 | - scrollTop: $text.attr('y') - 25 | |
| 352 | + scrollTop: $rect.attr('y') - 25 | |
| 347 | 353 | }); |
| 348 | 354 | } |
| 349 | 355 | } |
| ... | ... | @@ -381,6 +387,14 @@ |
| 381 | 387 | return d.stationCode; |
| 382 | 388 | }); |
| 383 | 389 | |
| 390 | + //text覆盖一个rect 方便点击 | |
| 391 | + items.append('rect').classed({'station_text_rect': true}) | |
| 392 | + .attr('x', cx) | |
| 393 | + .attr('y', cy) | |
| 394 | + .attr('_id', function (d) { | |
| 395 | + return d.stationCode; | |
| 396 | + }); | |
| 397 | + | |
| 384 | 398 | //path |
| 385 | 399 | items.append('path').classed({'station_link': true}) |
| 386 | 400 | .attr('d', function (d, i) { |
| ... | ... | @@ -410,7 +424,7 @@ |
| 410 | 424 | items.append('path').classed({'cut_link': true}) |
| 411 | 425 | .attr('d', function (d, i) { |
| 412 | 426 | var y = yScale(i) + 26; |
| 413 | - return i == len - 1 ? 'M15,' + y + 'L' + w + ',' + y : 'M85,' + y + 'L' + w + ',' + y; | |
| 427 | + return i == len - 1 ? 'M15,' + y + 'L' + w + ',' + y : 'M100,' + y + 'L' + w + ',' + y; | |
| 414 | 428 | }); |
| 415 | 429 | |
| 416 | 430 | svg.append('g').classed({ |
| ... | ... | @@ -458,9 +472,9 @@ |
| 458 | 472 | }, null, {enableHighAccuracy: true}); |
| 459 | 473 | }; |
| 460 | 474 | |
| 461 | - $(document).on('click', 'svg text.station_text', function () { | |
| 475 | + $(document).on('click', 'svg rect.station_text_rect', function () { | |
| 462 | 476 | $('text.station_text.active').attr('class', 'station_text'); |
| 463 | - $(this).attr('class', 'station_text active'); | |
| 477 | + $(this).prev().attr('class', 'station_text active'); | |
| 464 | 478 | |
| 465 | 479 | var _id = $(this).attr('_id'); |
| 466 | 480 | var ci; | ... | ... |