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 @@ ...@@ -6,7 +6,7 @@
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Designed and built with all the love in the world @twitter by @mdo and @fat. * 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 { html, body {
margin: 0; margin: 0;
......
...@@ -37,7 +37,7 @@ $(function(){ ...@@ -37,7 +37,7 @@ $(function(){
// POSITION STATIC TWIPSIES // POSITION STATIC TWIPSIES
// ======================== // ========================
$(window).bind( 'load resize', function () { $(window).on('load resize', function () {
$(".twipsies a").each(function () { $(".twipsies a").each(function () {
$(this) $(this)
.twipsy({ .twipsy({
......
This diff is collapsed.
...@@ -9,11 +9,11 @@ We believe you should be able to use all plugins provided by Bootstrap purely th ...@@ -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: 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: 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 @@ ...@@ -46,7 +46,7 @@
} }
$.support.transition && $element.hasClass('fade') ? $.support.transition && $element.hasClass('fade') ?
$element.bind($.support.transition.end, removeElement) : $element.on($.support.transition.end, removeElement) :
removeElement() removeElement()
} }
......
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
function hideWithTransition() { function hideWithTransition() {
var that = this var that = this
, timeout = setTimeout(function () { , timeout = setTimeout(function () {
that.$element.unbind($.support.transition.end) that.$element.off($.support.transition.end)
hideModal.call(that) hideModal.call(that)
}, 500) }, 500)
...@@ -156,11 +156,11 @@ ...@@ -156,11 +156,11 @@
function escape() { function escape() {
var that = this var that = this
if (this.isShown && this.options.keyboard) { 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() e.which == 27 && that.hide()
}) })
} else if (!this.isShown) { } else if (!this.isShown) {
$(document).unbind('keyup.dismiss.modal') $(document).off('keyup.dismiss.modal')
} }
} }
......
...@@ -63,8 +63,7 @@ ...@@ -63,8 +63,7 @@
, tip: function() { , tip: function() {
if (!this.$tip) { if (!this.$tip) {
this.$tip = $('<div class="popover" />') this.$tip = $(this.options.template)
.html(this.options.template)
} }
return this.$tip return this.$tip
} }
...@@ -90,7 +89,7 @@ ...@@ -90,7 +89,7 @@
$.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, { $.fn.popover.defaults = $.extend({} , $.fn.twipsy.defaults, {
placement: 'right' placement: 'right'
, content: '' , 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 ) }( window.jQuery )
\ No newline at end of file
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
function ScrollSpy( element ) { function ScrollSpy( element ) {
var process = $.proxy(this.process, this) 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.selector = (this.$scrollElement.attr('data-target')
|| this.$scrollElement.attr('href') || this.$scrollElement.attr('href')
|| '') + ' .nav li > a' || '') + ' .nav li > a'
......
...@@ -52,26 +52,45 @@ ...@@ -52,26 +52,45 @@
$href = $(href) $href = $(href)
this.activate($this.parent('li'), $ul) this.activate($this.parent('li'), $ul)
this.activate($href, $href.parent()) this.activate($href, $href.parent(), function () {
$this.trigger({
$this.trigger({ type: 'shown'
type: 'shown' , relatedTarget: previous
, relatedTarget: previous })
}) })
} }
, activate: function ( element, container ) { , activate: function ( element, container, callback) {
container var $active = container.find('> .active')
.find('> .active') , transition = callback
.removeClass('active') && $.support.transition
.find('> .dropdown-menu > .active') && $active.hasClass('fade')
.removeClass('active')
function next() {
$active
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
element.addClass('active') element.addClass('active')
if ( element.parent('.dropdown-menu') ) { if (transition) {
element.closest('li.dropdown').addClass('active') 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 @@ ...@@ -167,7 +167,7 @@
} }
$.support.transition && this.$tip.hasClass('fade') ? $.support.transition && this.$tip.hasClass('fade') ?
$tip.bind( $.support.transition.end, removeElement) : $tip.on($.support.transition.end, removeElement) :
removeElement() removeElement()
} }
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
} }
, tip: function () { , tip: function () {
return this.$tip = this.$tip || $('<div class="twipsy" />').html(this.options.template) return this.$tip = this.$tip || $(this.options.template)
} }
, validate: function () { , validate: function () {
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
, placement: 'above' , placement: 'above'
, trigger: 'hover' , trigger: 'hover'
, title: '' , 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 ) }( 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