diff --git a/ground/views/indexTemplate.php b/ground/views/indexTemplate.php index 77eb1e1..45551bb 100644 --- a/ground/views/indexTemplate.php +++ b/ground/views/indexTemplate.php @@ -34,15 +34,18 @@
+
+
+
diff --git a/public/css/style.css b/public/css/style.css index 4a0d295..d7fbb4a 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -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 table{} + +.form-group .error {display: none;} +.form-group.has-error .error {display: inline-block;} diff --git a/public/js/main.js b/public/js/main.js index df96c82..4de26d4 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -195,9 +195,23 @@ function addPoint() points[id].events.add('click', function(e) { showInfo(e.get('target').properties.get('id')); }); - myMap.geoObjects.add(points[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]); + }, 3000); + $('#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) { response = data.responseJSON;