Показ карточек точек при клике в маршруте. FIX ошибки при повторном открытии точки.

This commit is contained in:
Krivchikov Dmitry 2014-12-14 15:36:22 +03:00
parent 3d9b6eaf08
commit c378657c43
3 changed files with 3 additions and 8 deletions

View File

@ -44,7 +44,7 @@ div.leaflet-popup-content button:hover span.label {display: inline;}
#wayPoints {margin-bottom: 10px;} #wayPoints {margin-bottom: 10px;}
#wayPoints .wayPoint {cursor: pointer; border: solid 1px #999; padding: 2px 5px; margin-bottom: 3px; background-color: #fff;} #wayPoints .wayPoint {cursor: pointer; border: solid 1px #999; padding: 2px 5px; margin-bottom: 3px; background-color: #fff;}
#wayPoints .wayPoint span {font-weight: bold; color: red;} #wayPoints .wayPoint span.del {font-weight: bold; color: red;}
#routes {margin-bottom: 10px; height: 200px;} #routes {margin-bottom: 10px; height: 200px;}
#routes .route {cursor: pointer; border: solid 1px #999; padding: 2px 5px; margin-bottom: 3px;} #routes .route {cursor: pointer; border: solid 1px #999; padding: 2px 5px; margin-bottom: 3px;}

View File

@ -203,14 +203,8 @@ function showInfo(id)
description += data.descriptionHtml; description += data.descriptionHtml;
description += '</div><div class="clear"></div>'; description += '</div><div class="clear"></div>';
description += '<div class="btn-group control">'; description += '<div class="btn-group control">';
// if (data.source.length > 11)
// {
// description += '<a type="button" class="btn btn-default" href="' + data.source + '" target="blank"><span class="glyphicon glyphicon-eye-open"></span> <span class="label">Подробнее</span></a>';
// }
description += '<a type="button" class="btn btn-default" href="/page/point/id/' + id + '"><span class="glyphicon glyphicon-eye-open"></span> <span class="label">Подробнее</span></a>'; description += '<a type="button" class="btn btn-default" href="/page/point/id/' + id + '"><span class="glyphicon glyphicon-eye-open"></span> <span class="label">Подробнее</span></a>';
description += '<button type="button" class="btn btn-default" onclick="addToRoute(' + id + ')"><span class="glyphicon glyphicon-map-marker"></span> <span class="label">В маршрут</span></button>'; description += '<button type="button" class="btn btn-default" onclick="addToRoute(' + id + ')"><span class="glyphicon glyphicon-map-marker"></span> <span class="label">В маршрут</span></button>';
// description += '<button type="button" class="btn btn-default"><span class="glyphicon glyphicon-ok"></span> <span class="label">Был здесь</span></button>';
description += '<button type="button" class="btn btn-default" onclick="addRemoveLike(' + id + ')"><span id="myLikesButton" class="glyphicon glyphicon-' + (data.iLike ? 'ok' : 'thumbs-up') + '"></span> <span class="label">Нравится</span></button>'; description += '<button type="button" class="btn btn-default" onclick="addRemoveLike(' + id + ')"><span id="myLikesButton" class="glyphicon glyphicon-' + (data.iLike ? 'ok' : 'thumbs-up') + '"></span> <span class="label">Нравится</span></button>';
description += '<button type="button" class="btn btn-default" onclick="addRemoveFavorite(' + id + ')"><span id="myFavoritesButton" class="glyphicon glyphicon-star' + (data.inFavorites ? '' : '-empty') + ' "></span> <span class="label">Хочу посетить</span></button>'; description += '<button type="button" class="btn btn-default" onclick="addRemoveFavorite(' + id + ')"><span id="myFavoritesButton" class="glyphicon glyphicon-star' + (data.inFavorites ? '' : '-empty') + ' "></span> <span class="label">Хочу посетить</span></button>';
@ -242,6 +236,7 @@ function showInfo(id)
history.pushState({pointId: id}, document.title, "/?point=" + id); history.pushState({pointId: id}, document.title, "/?point=" + id);
document.title = points[id].options.title; document.title = points[id].options.title;
marker.openPopup();
} }
} }

View File

@ -151,7 +151,7 @@ function deleteRoute(id)
*/ */
function addToRoute(id, build) function addToRoute(id, build)
{ {
$('#wayPoints').append('<div pointid="' + id + '" class="wayPoint"><span onclick="$(this).parent().remove();buildRoute();">&times;</span> ' + points[id].options.title + '</div>'); $('#wayPoints').append('<div pointid="' + id + '" class="wayPoint" onclick="showInfo('+ id +');"><span class="del" onclick="$(this).parent().remove();buildRoute();">&times;</span> '+ points[id].options.title + '</div>');
closePopup(); closePopup();
openBox('Route', true); openBox('Route', true);