Lazy load toggle buttons #43

Open
cemo opened this Issue Nov 30, 2012 · 1 comment

Comments

Projects
None yet
2 participants

cemo commented Nov 30, 2012

I would like to use and load your buttons in a lazy manner. All components of the bootstrap are capable of this. Consider modal links. A modal link does not aware of modal capabilities until it is clicked. When the link is clicked, it is gaining a modal behavior. What I would like to do is something like this. This is pretty important for ajax contents and reducing the amount of the javascript codes by utilizing Data Attributes as in your sample. This brings extra markup for initial state but It is not a problem.

Check type ahead example:

  $(function () {
    $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
      var $this = $(this)
      if ($this.data('typeahead')) return
      e.preventDefault()
      $this.typeahead($this.data())
    })
  })
Owner

nostalgiaz commented Dec 12, 2012

Can you send me a pull-request please? 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment