Skip to content

Commit f068ee3

Browse files
committed
update js files
1 parent 7a0ca96 commit f068ee3

File tree

2 files changed

+27
-13
lines changed

2 files changed

+27
-13
lines changed

1.3.0/bootstrap-modal.js

+17-9
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,10 @@
5757
this.$element = $(content)
5858
.delegate('.close', 'click.modal', $.proxy(this.hide, this))
5959

60-
if ( options ) {
61-
$.extend( this.settings, options )
60+
$.extend( this.settings, options )
6261

63-
if ( options.show ) {
64-
this.show()
65-
}
62+
if ( this.settings.show ) {
63+
this.show()
6664
}
6765

6866
return this
@@ -81,17 +79,23 @@
8179

8280
escape.call(this)
8381
backdrop.call(this, function () {
82+
var transition = $.support.transition && that.$element.hasClass('fade')
83+
8484
that.$element
8585
.appendTo(document.body)
8686
.show()
8787

88-
if ($.support.transition && that.$element.hasClass('fade')) {
88+
if (transition) {
8989
that.$element[0].offsetWidth // force reflow
9090
}
9191

9292
that.$element
9393
.addClass('in')
94-
.trigger('shown')
94+
95+
transition ?
96+
that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) :
97+
that.$element.trigger('shown')
98+
9599
})
96100

97101
return this
@@ -100,6 +104,10 @@
100104
, hide: function (e) {
101105
e && e.preventDefault()
102106

107+
if ( !this.isShown ) {
108+
return this
109+
}
110+
103111
var that = this
104112
this.isShown = false
105113

@@ -220,7 +228,7 @@
220228
$.fn.modal.defaults = {
221229
backdrop: false
222230
, keyboard: false
223-
, show: true
231+
, show: false
224232
}
225233

226234

@@ -235,4 +243,4 @@
235243
})
236244
})
237245

238-
}( window.jQuery || window.ender );
246+
}( window.jQuery || window.ender );

1.3.0/bootstrap-tabs.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,27 @@
2727

2828
function tab( e ) {
2929
var $this = $(this)
30-
, href = $this.attr('href')
3130
, $ul = $this.closest('ul')
32-
, $controlled
31+
, href = $this.attr('href')
32+
, previous
3333

3434
if (/^#\w+/.test(href)) {
3535
e.preventDefault()
3636

37-
if ($this.hasClass('active')) {
37+
if ($this.parent('li').hasClass('active')) {
3838
return
3939
}
4040

41+
previous = $ul.find('.active a')[0]
4142
$href = $(href)
4243

4344
activate($this.parent('li'), $ul)
4445
activate($href, $href.parent())
46+
47+
$this.trigger({
48+
type: 'change'
49+
, relatedTarget: previous
50+
})
4551
}
4652
}
4753

@@ -59,4 +65,4 @@
5965
$('body').tabs('ul[data-tabs] li > a, ul[data-pills] > li > a')
6066
})
6167

62-
}( window.jQuery || window.ender );
68+
}( window.jQuery || window.ender );

0 commit comments

Comments
 (0)