-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathReportReactor.js
46 lines (39 loc) · 1.11 KB
/
ReportReactor.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
define([
'dojo/_base/declare',
'dijit/_WidgetBase',
'dojo/query',
'dojo/on',
'dojo/topic',
'dojo/_base/lang'
], function (
declare,
_WidgetBase,
domQuery,
on,
topic,
lang
) {
return declare([_WidgetBase], {
postCreate: function () {
this.inherited(arguments);
this.map.infoWindow.on('selection-change', lang.hitch(this, function (evt) {
var infoWindow = evt.target;
var nodes = domQuery('#parcel-report', infoWindow.domNode),
targetNode = null;
if (nodes.length > 0) {
targetNode = nodes[0];
if (targetNode) {
on(targetNode, 'click', lang.hitch(this, 'parcelReportClick'));
}
}
}));
},
parcelReportClick: function () {
var feature = this.map.infoWindow.getSelectedFeature();
topic.publish('parcelReportWidget/createReport', {
feature: feature
});
return false;
}
});
});