-
Notifications
You must be signed in to change notification settings - Fork 83
/
demo.js
58 lines (51 loc) · 2.69 KB
/
demo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
ym.modules.define('DemoLayout', [
'templateLayoutFactory',
'option.presetStorage'
], function (provide, templateLayoutFactory, presetStorage) {
var DemoLayout = templateLayoutFactory.createClass([
'<div class="well well-white demo" style="width:700px;">',
'<a class="close" href="#">×</a>',
'<h1>Определение координат</h1>',
'<p class="lead">Приложение «Определение координат» позволяет получать координаты мест, областей а также различных типов геообъектов для дальнейшего использования их в <strong>API Яндекс.Карт</strong>.</p>',
'<p class="lead">Приложение использует порядок координат ',
'<strong>',
'{% if data.coordOrder == "latlong" %}',
'широта-долгота',
'{% else %}',
'долгота-широта',
'{% endif %}',
'</strong>',
'.</p>',
'<p class="lead">Информация о состоянии карты доступна в правом нижнем углу карты.</p>',
'<p class="lead"Для создания геообъектов различных геометрий нужно использовать тулбар в левом верхнем углу карты.</p>',
'<a class="btn btn-success btn-large" href="#">Продолжить</a> ',
'<a class="btn btn-warning btn-large" href="?coordorder={% if data.coordOrder == "latlong" %}longlat{% else %}latlong{% endif %}">Сменить порядок координат</a>',
'</div>'
].join(''), {
build: function () {
DemoLayout.superclass.build.call(this);
this._setupListeners();
},
clear: function () {
this._clearListeners();
DemoLayout.superclass.clear.call(this);
},
_setupListeners: function () {
jQuery(this.getElement())
.on('click', '.close,.btn-success', jQuery.proxy(this._onClose, this));
},
_clearListeners: function () {
jQuery(this.getElement())
.off('click');
},
_onClose: function (e) {
e.preventDefault();
var control = this.getData().control;
control.getParent().remove(control);
}
});
presetStorage.add('popup#demo', {
contentBodyLayout: DemoLayout
});
provide(DemoLayout);
});