cartodb-4.42/lib/assets/javascripts/cartodb/table/map/layerview_from_layergroup.js
2024-04-06 05:25:13 +00:00

22 lines
596 B
JavaScript

/**
* Layer view item for layer selector within app
*/
cdb.geo.ui.LayerView = cdb.geo.ui.LayerView.extend({
defaults: {
template: '\
<a class="layer" href="#/change-layer"><%- table_name_alias || table_name %></a>\
<a href="#switch" class="right <%- visible ? "enabled" : "disabled" %> switch"><span class="handle"></span></a>\
'
},
render: function() {
var attrs = _.clone(this.model.attributes);
attrs.table_name_alias = attrs.table_name_alias || "";
this.$el.append(this.template(attrs));
return this;
}
});