Mercurial > pub > ImplabJs
comparison src/djol/PopupContainer.js @ 10:8705103f074f
Слияние
author | cin |
---|---|
date | Mon, 21 Aug 2017 18:03:00 +0300 |
parents | f0035923ff3e |
children |
comparison
equal
deleted
inserted
replaced
9:37e9e6bbe87a | 10:8705103f074f |
---|---|
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 }); |