Mercurial > pub > ImplabJs
comparison src/djol/PopupContainer.js @ 8:f0035923ff3e
добавлена библиотека для работы с openlayers 3+
author | cin |
---|---|
date | Mon, 21 Aug 2017 17:47:00 +0300 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
7:9c0943c68a90 | 8:f0035923ff3e |
---|---|
1 define([ | |
2 "dijit/_WidgetBase", | |
3 "dijit/_TemplatedMixin", | |
4 "dijit/_WidgetsInTemplateMixin", | |
5 "dijit/_Container", | |
6 "dojo/_base/declare", | |
7 "dojo/Evented", | |
8 "dojo/dom-class", | |
9 "dojo/on", | |
10 "dojo/text!./resources/PopupContainerTemplate.html", | |
11 "ol" | |
12 ], | |
13 function (_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Container, declare, Evented, domClass, on, templateString, ol) { | |
14 return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Container/*, Evented*/], { | |
15 | |
16 templateString: templateString, | |
17 | |
18 overlay: null, | |
19 | |
20 map : null, | |
21 | |
22 constructor: function (options) { | |
23 options = options || {}; | |
24 }, | |
25 | |
26 postCreate: function () { | |
27 var me = this; | |
28 this.inherited(arguments); | |
29 on(this.popupCloser, "click", function () { | |
30 me.destroyRecursive(); | |
31 me.onClose(); | |
32 }); | |
33 }, | |
34 | |
35 show: function (widget, opts) { | |
36 opts = opts || "only"; | |
37 if (widget) { | |
38 widget.placeAt(this.popupContent, opts); | |
39 } | |
40 }, | |
41 | |
42 hideOverlay: function () { | |
43 domClass.add(this.popupOverlay, "hidden") | |
44 }, | |
45 | |
46 showOverlay: function () { | |
47 domClass.remove(this.popupOverlay, "hidden") | |
48 }, | |
49 | |
50 destroy : function() { | |
51 this.map.removeOverlay(this.overlay); | |
52 this.inherited(arguments); | |
53 }, | |
54 | |
55 onClose: function () { | |
56 this.emit("close"); | |
57 } | |
58 | |
59 }); | |
60 }); |