Mercurial > pub > ImplabJs
diff src/djol/LayerRadioButton.js @ 34:27e8e9e38e07 default tip
Слияние
author | nickolay |
---|---|
date | Wed, 05 Jun 2019 20:44:15 +0300 |
parents | 8af8e840dd49 1dc2fd263b90 |
children |
line wrap: on
line diff
--- a/src/djol/LayerRadioButton.js Wed Jun 05 17:44:17 2019 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -define([ - "dojo/_base/declare", - "dijit/_WidgetBase", - "dijit/_TemplatedMixin", - "dijit/_WidgetsInTemplateMixin", - "dojo/text!./resources/LayerRadioButtonTemplate.html", - "dijit/form/RadioButton" ], function(declare, _WidgetBase, _TemplatedMixin, - _WidgetsInTemplateMixin, templateString) { - return declare([ _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin ], { - templateString : templateString, - - labelNode : null, - radioButton : null, - - label : "", - _setLabelAttr : { - node : "labelNode", - type : "innerHTML" - }, - - name : "layers", - - _layer : null, - - constructor : function(options) { - options = options || {}; - - if (!options.layer) - throw new Error("The layer is required"); - - this._layer = options.layer; - this.label = options.layer.get("label") || "unnamed"; - }, - - postCreate : function() { - var me = this; - me.inherited(arguments); - - me.radioButton.set('name', me.name); - me.radioButton.set('value', me._layer.getVisible()); - this.radioButton.on("change", function(value) { - me._changed(value); - }); - }, - - _changed : function(visible) { - this._layer.setVisible(visible); - } - }); -}); \ No newline at end of file