update js files

This commit is contained in:
Jacob Thornton
2011-10-02 22:27:34 -07:00
parent 7a0ca96f79
commit f068ee36aa
2 changed files with 27 additions and 13 deletions
+17 -9
View File
@@ -57,12 +57,10 @@
this.$element = $(content)
.delegate('.close', 'click.modal', $.proxy(this.hide, this))
if ( options ) {
$.extend( this.settings, options )
$.extend( this.settings, options )
if ( options.show ) {
this.show()
}
if ( this.settings.show ) {
this.show()
}
return this
@@ -81,17 +79,23 @@
escape.call(this)
backdrop.call(this, function () {
var transition = $.support.transition && that.$element.hasClass('fade')
that.$element
.appendTo(document.body)
.show()
if ($.support.transition && that.$element.hasClass('fade')) {
if (transition) {
that.$element[0].offsetWidth // force reflow
}
that.$element
.addClass('in')
.trigger('shown')
transition ?
that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) :
that.$element.trigger('shown')
})
return this
@@ -100,6 +104,10 @@
, hide: function (e) {
e && e.preventDefault()
if ( !this.isShown ) {
return this
}
var that = this
this.isShown = false
@@ -220,7 +228,7 @@
$.fn.modal.defaults = {
backdrop: false
, keyboard: false
, show: true
, show: false
}
@@ -235,4 +243,4 @@
})
})
}( window.jQuery || window.ender );
}( window.jQuery || window.ender );
+10 -4
View File
@@ -27,21 +27,27 @@
function tab( e ) {
var $this = $(this)
, href = $this.attr('href')
, $ul = $this.closest('ul')
, $controlled
, href = $this.attr('href')
, previous
if (/^#\w+/.test(href)) {
e.preventDefault()
if ($this.hasClass('active')) {
if ($this.parent('li').hasClass('active')) {
return
}
previous = $ul.find('.active a')[0]
$href = $(href)
activate($this.parent('li'), $ul)
activate($href, $href.parent())
$this.trigger({
type: 'change'
, relatedTarget: previous
})
}
}
@@ -59,4 +65,4 @@
$('body').tabs('ul[data-tabs] li > a, ul[data-pills] > li > a')
})
}( window.jQuery || window.ender );
}( window.jQuery || window.ender );