Commit 3647fc09d8250e4dfdfd96a8d4cb7f83d7c88668

Authored by panzh
1 parent 72478660

update...

src/main/resources/static/pages/m/m.html
@@ -136,7 +136,6 @@ @@ -136,7 +136,6 @@
136 svg g.gps-wrap > rect { 136 svg g.gps-wrap > rect {
137 width: 64px; 137 width: 64px;
138 height: 15px; 138 height: 15px;
139 - rx: 2px;  
140 cursor: pointer; 139 cursor: pointer;
141 stroke: #c94f21; 140 stroke: #c94f21;
142 fill: #c94f21; 141 fill: #c94f21;
@@ -189,6 +188,13 @@ @@ -189,6 +188,13 @@
189 display: block; 188 display: block;
190 margin-bottom: 2px; 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 </style> 198 </style>
193 </head> 199 </head>
194 200
@@ -340,10 +346,10 @@ @@ -340,10 +346,10 @@
340 346
341 if (_call_info.auto) { 347 if (_call_info.auto) {
342 _call_info.auto = null; 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 $('.station_chart_wrap').animate({ 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,6 +387,14 @@
381 return d.stationCode; 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 //path 398 //path
385 items.append('path').classed({'station_link': true}) 399 items.append('path').classed({'station_link': true})
386 .attr('d', function (d, i) { 400 .attr('d', function (d, i) {
@@ -410,7 +424,7 @@ @@ -410,7 +424,7 @@
410 items.append('path').classed({'cut_link': true}) 424 items.append('path').classed({'cut_link': true})
411 .attr('d', function (d, i) { 425 .attr('d', function (d, i) {
412 var y = yScale(i) + 26; 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 svg.append('g').classed({ 430 svg.append('g').classed({
@@ -458,9 +472,9 @@ @@ -458,9 +472,9 @@
458 }, null, {enableHighAccuracy: true}); 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 $('text.station_text.active').attr('class', 'station_text'); 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 var _id = $(this).attr('_id'); 479 var _id = $(this).attr('_id');
466 var ci; 480 var ci;