Текст ошибок, баллун с информацией о том, что точка добавлена.
This commit is contained in:
parent
18a0acd77b
commit
c52e23f2df
|
|
@ -34,15 +34,18 @@
|
||||||
<form method="POST" action="/json/addpoint/" id="addPointForm">
|
<form method="POST" action="/json/addpoint/" id="addPointForm">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label" for="name">Название</label>
|
<label class="control-label" for="name">Название</label>
|
||||||
|
<label class="control-label error" for="name">(Слишком короткое название точки)</label>
|
||||||
<input type="text" id="addPointName" name="name" class="form-control" />
|
<input type="text" id="addPointName" name="name" class="form-control" />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label" for="img">URL изображения</label>
|
<label class="control-label" for="img">URL изображения</label>
|
||||||
|
<label class="control-label error" for="img">(Что-то не так с сылкой на изображение)</label>
|
||||||
<input type="text" id="addPointImg" name="img" class="form-control" />
|
<input type="text" id="addPointImg" name="img" class="form-control" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label" for="description">Описание</label>
|
<label class="control-label" for="description">Описание</label>
|
||||||
|
<label class="control-label error" for="img">(Слишком короткое описание - минимум 25 символов)</label>
|
||||||
<textarea id="addPointDescription" name="description" class="form-control"></textarea>
|
<textarea id="addPointDescription" name="description" class="form-control"></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,3 +17,6 @@ div.add {cursor: pointer;}
|
||||||
|
|
||||||
div#footer {position: absolute; width: 100%; height: 50px; bottom: 0; padding: 12px 10px 0 10px;;}
|
div#footer {position: absolute; width: 100%; height: 50px; bottom: 0; padding: 12px 10px 0 10px;;}
|
||||||
div#footer table{}
|
div#footer table{}
|
||||||
|
|
||||||
|
.form-group .error {display: none;}
|
||||||
|
.form-group.has-error .error {display: inline-block;}
|
||||||
|
|
|
||||||
|
|
@ -195,9 +195,23 @@ function addPoint()
|
||||||
points[id].events.add('click', function(e) {
|
points[id].events.add('click', function(e) {
|
||||||
showInfo(e.get('target').properties.get('id'));
|
showInfo(e.get('target').properties.get('id'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var balloon = myMap.balloon.open([$('#addPointLat').val(), $('#addPointLng').val()], {content: 'Точка успешно добавлена!'}, {closeButton: false});
|
||||||
|
setTimeout(function() {
|
||||||
|
balloon.close();
|
||||||
|
}, 3000);
|
||||||
|
|
||||||
|
setTimeout(function(){
|
||||||
myMap.geoObjects.add(points[id]);
|
myMap.geoObjects.add(points[id]);
|
||||||
|
}, 3000);
|
||||||
|
|
||||||
$('#addPointModal').modal('hide');
|
$('#addPointModal').modal('hide');
|
||||||
$('#addPointButton').toggleClass('btn-success').toggleClass('btn-default');
|
|
||||||
|
// Clear form
|
||||||
|
$('#addPointForm input').val('');
|
||||||
|
$('#addPointForm textarea').val('');
|
||||||
|
$('.form-group').removeClass('has-error');
|
||||||
|
$('#addPointButton').removeClass('btn-success').addClass('btn-default');
|
||||||
},
|
},
|
||||||
error: function(data) {
|
error: function(data) {
|
||||||
response = data.responseJSON;
|
response = data.responseJSON;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue