JSFiddle - React, Tailwind, and code Playground
by jaygiri
HTML
<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<script src="http://documentcloud.github.com/backbone/backbone-min.js"></script>
<script type="text/template" id="map-modal-template">
<div id="map_modal">
<button title="Close" id="closeMapModal" class="right">Close</button>
</div>
</script>
<div class="modal_box"></div>
CSS
.modal_box {
background: #eee;
}
.modal_box button {
margin: 10px;
}
JavaScript
MapModalView = Backbone.View.extend({
events: {
'click #closeMapModal': 'closeModal'
},
initialize: function() {
this.el = '.modal_box';
this.template = _.template($('#map-modal-template').html());
},
render: function() {
$(this.el).append(this.template({}));
this.setElement(this.el);
},
closeModal: function(e) {
alert('hello');
}
});
m = new MapModalView();
m.render();