Create Bootstrap Elements Programmatically with Backbone
I threw together a little library to make it easy to programmatically create the HTML elements required for Bootstrap's Javascript. It uses Backbone.js Views to lace it all together.
the source is up on github: https://github.com/chriswoodford/tarsus
there's even a quick ruby gem for rails integration: https://github.com/chriswoodford/tarsus-rails
Here's an example of how to use it (written in CoffeeScript)
Instantiate the Modal with options
$(document).ready ->
login = new YourApplication.Views.Login
title: 'Login'
noCloseButton: true
bootstrap:
show: false
login.render()Written by Chris Woodford
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
projectcleverweb
309.1K
mcansky
156.2K
Filed Under
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#