From b4b0d690b4b23e89d8488172ad5a7f5990f8435f Mon Sep 17 00:00:00 2001 From: Krivchikov Dmitry Date: Fri, 11 Apr 2014 11:24:50 +0400 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B4=D0=B5=D0=B9=D1=81=D1=82?= =?UTF-8?q?=D0=B2=D0=BE=D0=B2=D0=B0=D0=BD=D0=B0=20=D0=BA=D0=BD=D0=BE=D0=BF?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D1=82=D0=BE=D1=87=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ground/views/indexTemplate.php | 2 +- public/js/main.js | 56 +++++++++++++++++++++------------- 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/ground/views/indexTemplate.php b/ground/views/indexTemplate.php index a064b4e..644287b 100644 --- a/ground/views/indexTemplate.php +++ b/ground/views/indexTemplate.php @@ -18,7 +18,7 @@ - + diff --git a/public/js/main.js b/public/js/main.js index 3f4ef62..6e7a2a5 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -23,29 +23,32 @@ function init() { myMap.events.add('click', function (e) { if (!myMap.balloon.isOpen()) { - var coords = e.get('coordPosition'); - myMap.balloon.open(coords, { - contentHeader:'Добавление точки', - contentBody: - '
' + - '

Название:
' + - '

' + - '

URL изображения:
' + - '

' + - '

Описание:
' + - '

' + - '

Тип:
' + - '' + - '

Источник:
' + - '

' + + if ( $('#addPointButton').hasClass('btn-success') ) + { + var coords = e.get('coordPosition'); + myMap.balloon.open(coords, { + contentHeader:'Добавление точки', + contentBody: + '' + + '

Название:
' + + '

' + + '

URL изображения:
' + + '

' + + '

Описание:
' + + '

' + + '

Тип:
' + + '' + + '

Источник:
' + + '

' + - '' + - '' + - '' + - '
' - }); + '' + + '' + + '' + + '' + }); + } } else { myMap.balloon.close(); @@ -147,3 +150,12 @@ function showMeOnTheMap() myMap.setCenter([userLat, userLng]); }); } + +function tryAddPoint(el) +{ + $(el).toggleClass('btn-success').toggleClass('btn-default'); + if ( $('#addPointButton').hasClass('btn-success') ) + myMap.cursors.push('crosshair'); + else + myMap.cursors.push('arrow'); +}