cartodb-4.42/lib/assets/javascripts/cartodb/table/map/layerview_from_layergroup.js

22 lines
596 B
JavaScript
Raw Normal View History

2024-04-06 13:25:13 +08:00
/**
* 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;
}
});