Commit 0980a33b authored by Jacob Thornton's avatar Jacob Thornton

update all to new on api + add animation support to tabs

parent 1ef5fa7d
......@@ -6,7 +6,7 @@
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
* Date: Mon Dec 12 09:51:27 PST 2011
* Date: Tue Dec 20 19:08:51 PST 2011
*/
html, body {
margin: 0;
......
......@@ -37,7 +37,7 @@ $(function(){
// POSITION STATIC TWIPSIES
// ========================
$(window).bind( 'load resize', function () {
$(window).on('load resize', function () {
$(".twipsies a").each(function () {
$(this)
.twipsy({
......
This diff is collapsed.
......@@ -9,11 +9,11 @@ We believe you should be able to use all plugins provided by Bootstrap purely th
We acknowledge that this isn't always the most performant and sometimes it may be desirable to turn this functionality off altogether. Therefore, as of 2.0 we provide the ability to disable the data attribute API by unbinding all events on the body namespaced with `'data-api'`. This looks like this:
$('body').unbind('.data-api')
$('body').off('.data-api')
To target a specific plugin, just include the plugins name as a namespace along with the data-api namespace like this:
$('body').unbind('.alert.data-api')
$('body').off('.alert.data-api')
---
......
......@@ -46,7 +46,7 @@
}
$.support.transition && $element.hasClass('fade') ?
$element.bind($.support.transition.end, removeElement) :
$element.on($.support.transition.end, removeElement) :
removeElement()
}
......
......@@ -96,7 +96,7 @@
function hideWithTransition() {
var that = this
, timeout = setTimeout(function () {
that.$element.unbind($.support.transition.end)
that.$element.off($.support.transition.end)
hideModal.call(that)
}, 500)
......@@ -156,11 +156,11 @@
function escape() {
var that = this
if (this.isShown && this.options.keyboard) {
$(document).bind('keyup.dismiss.modal', function ( e ) {
$(document).on('keyup.dismiss.modal', function ( e ) {
e.which == 27 && that.hide()
})
} else if (!this.isShown) {
$(document).unbind('keyup.dismiss.modal')
$(document).off('keyup.dismiss.modal')
}
}
......
......@@ -63,8 +63,7 @@
, tip: function() {
if (!this.$tip) {
this.$tip = $('<div class="popover" />')
.html(this.options.template)
this.$tip = $(this.options.template)
}
return this.$tip
}
......@@ -90,7 +89,7 @@
$.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, {
placement: 'right'
, content: ''
, template: '<div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div>'
, template: '<div class="popover"><div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div></div>'
})
}( window.jQuery )
\ No newline at end of file
......@@ -27,7 +27,7 @@
function ScrollSpy( element ) {
var process = $.proxy(this.process, this)
this.$scrollElement = $(element).bind('scroll.scroll.data-api', process)
this.$scrollElement = $(element).on('scroll.scroll.data-api', process)
this.selector = (this.$scrollElement.attr('data-target')
|| this.$scrollElement.attr('href')
|| '') + ' .nav li > a'
......
......@@ -52,26 +52,45 @@
$href = $(href)
this.activate($this.parent('li'), $ul)
this.activate($href, $href.parent())
$this.trigger({
type: 'shown'
, relatedTarget: previous
this.activate($href, $href.parent(), function () {
$this.trigger({
type: 'shown'
, relatedTarget: previous
})
})
}
, activate: function ( element, container ) {
container
.find('> .active')
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
, activate: function ( element, container, callback) {
var $active = container.find('> .active')
, transition = callback
&& $.support.transition
&& $active.hasClass('fade')
function next() {
$active
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
element.addClass('active')
element.addClass('active')
if ( element.parent('.dropdown-menu') ) {
element.closest('li.dropdown').addClass('active')
if (transition) {
element[0].offsetWidth // reflow for transition
element.addClass('in')
}
if ( element.parent('.dropdown-menu') ) {
element.closest('li.dropdown').addClass('active')
}
callback && callback()
}
transition ?
$active.one($.support.transition.end, next) :
next()
$active.removeClass('in')
}
}
......
......@@ -167,7 +167,7 @@
}
$.support.transition && this.$tip.hasClass('fade') ?
$tip.bind( $.support.transition.end, removeElement) :
$tip.on($.support.transition.end, removeElement) :
removeElement()
}
......@@ -196,7 +196,7 @@
}
, tip: function () {
return this.$tip = this.$tip || $('<div class="twipsy" />').html(this.options.template)
return this.$tip = this.$tip || $(this.options.template)
}
, validate: function () {
......@@ -256,7 +256,7 @@
, placement: 'above'
, trigger: 'hover'
, title: ''
, template: '<div class="twipsy-arrow"></div><div class="twipsy-inner"></div>'
, template: '<div class="twipsy"><div class="twipsy-arrow"></div><div class="twipsy-inner"></div></div>'
}
}( window.jQuery )
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment