Skip to content

Commit 045a3b8

Browse files
committed
Merge pull request #77 from kane-c/master
Bootstrap 3.3.1
2 parents b67e5f7 + b4661ce commit 045a3b8

27 files changed

+131
-86
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Bootstrap Stylus 3.3.0
1+
Bootstrap Stylus 3.3.1
22
======================
33

4-
Port of the amazing [Bootstrap 3.3.0](https://github.com/twbs/bootstrap) to [Stylus 0.47.0](http://learnboost.github.com/stylus/).
4+
Port of the amazing [Bootstrap 3.3.1](https://github.com/twbs/bootstrap) to [Stylus 0.47.0](http://learnboost.github.com/stylus/).
55

66
There might be some slight color differences due to the differences between the color functions in LESS and those in Stylus.
77

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bootstrap-stylus",
3-
"version": "3.3.0",
3+
"version": "3.3.1",
44
"main": "stylus/bootstrap.styl",
55
"description": "A port of Bootstrap to Stylus",
66
"ignore": [

js/affix.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: affix.js v3.3.0
2+
* Bootstrap: affix.js v3.3.1
33
* http://getbootstrap.com/javascript/#affix
44
* ========================================================================
55
* Copyright 2011-2014 Twitter, Inc.
@@ -28,7 +28,7 @@
2828
this.checkPosition()
2929
}
3030

31-
Affix.VERSION = '3.3.0'
31+
Affix.VERSION = '3.3.1'
3232

3333
Affix.RESET = 'affix affix-top affix-bottom'
3434

js/alert.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: alert.js v3.3.0
2+
* Bootstrap: alert.js v3.3.1
33
* http://getbootstrap.com/javascript/#alerts
44
* ========================================================================
55
* Copyright 2011-2014 Twitter, Inc.
@@ -18,7 +18,7 @@
1818
$(el).on('click', dismiss, this.close)
1919
}
2020

21-
Alert.VERSION = '3.3.0'
21+
Alert.VERSION = '3.3.1'
2222

2323
Alert.TRANSITION_DURATION = 150
2424

js/button.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: button.js v3.3.0
2+
* Bootstrap: button.js v3.3.1
33
* http://getbootstrap.com/javascript/#buttons
44
* ========================================================================
55
* Copyright 2011-2014 Twitter, Inc.
@@ -19,7 +19,7 @@
1919
this.isLoading = false
2020
}
2121

22-
Button.VERSION = '3.3.0'
22+
Button.VERSION = '3.3.1'
2323

2424
Button.DEFAULTS = {
2525
loadingText: 'loading...'
@@ -110,7 +110,7 @@
110110
e.preventDefault()
111111
})
112112
.on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
113-
$(e.target).closest('.btn').toggleClass('focus', e.type == 'focus')
113+
$(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
114114
})
115115

116116
}(jQuery);

js/carousel.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: carousel.js v3.3.0
2+
* Bootstrap: carousel.js v3.3.1
33
* http://getbootstrap.com/javascript/#carousel
44
* ========================================================================
55
* Copyright 2011-2014 Twitter, Inc.
@@ -30,7 +30,7 @@
3030
.on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
3131
}
3232

33-
Carousel.VERSION = '3.3.0'
33+
Carousel.VERSION = '3.3.1'
3434

3535
Carousel.TRANSITION_DURATION = 600
3636

@@ -42,6 +42,7 @@
4242
}
4343

4444
Carousel.prototype.keydown = function (e) {
45+
if (/input|textarea/i.test(e.target.tagName)) return
4546
switch (e.which) {
4647
case 37: this.prev(); break
4748
case 39: this.next(); break

js/collapse.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: collapse.js v3.3.0
2+
* Bootstrap: collapse.js v3.3.1
33
* http://getbootstrap.com/javascript/#collapse
44
* ========================================================================
55
* Copyright 2011-2014 Twitter, Inc.
@@ -28,7 +28,7 @@
2828
if (this.options.toggle) this.toggle()
2929
}
3030

31-
Collapse.VERSION = '3.3.0'
31+
Collapse.VERSION = '3.3.1'
3232

3333
Collapse.TRANSITION_DURATION = 350
3434

js/dropdown.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: dropdown.js v3.3.0
2+
* Bootstrap: dropdown.js v3.3.1
33
* http://getbootstrap.com/javascript/#dropdowns
44
* ========================================================================
55
* Copyright 2011-2014 Twitter, Inc.
@@ -19,7 +19,7 @@
1919
$(element).on('click.bs.dropdown', this.toggle)
2020
}
2121

22-
Dropdown.VERSION = '3.3.0'
22+
Dropdown.VERSION = '3.3.1'
2323

2424
Dropdown.prototype.toggle = function (e) {
2525
var $this = $(this)
@@ -55,7 +55,7 @@
5555
}
5656

5757
Dropdown.prototype.keydown = function (e) {
58-
if (!/(38|40|27|32)/.test(e.which)) return
58+
if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
5959

6060
var $this = $(this)
6161

js/modal.js

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: modal.js v3.3.0
2+
* Bootstrap: modal.js v3.3.1
33
* http://getbootstrap.com/javascript/#modals
44
* ========================================================================
55
* Copyright 2011-2014 Twitter, Inc.
@@ -30,7 +30,7 @@
3030
}
3131
}
3232

33-
Modal.VERSION = '3.3.0'
33+
Modal.VERSION = '3.3.1'
3434

3535
Modal.TRANSITION_DURATION = 300
3636
Modal.BACKDROP_TRANSITION_DURATION = 150
@@ -56,10 +56,11 @@
5656
this.isShown = true
5757

5858
this.checkScrollbar()
59+
this.setScrollbar()
5960
this.$body.addClass('modal-open')
6061

61-
this.setScrollbar()
6262
this.escape()
63+
this.resize()
6364

6465
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
6566

@@ -74,6 +75,9 @@
7475
.show()
7576
.scrollTop(0)
7677

78+
if (that.options.backdrop) that.adjustBackdrop()
79+
that.adjustDialog()
80+
7781
if (transition) {
7882
that.$element[0].offsetWidth // force reflow
7983
}
@@ -108,6 +112,7 @@
108112
this.isShown = false
109113

110114
this.escape()
115+
this.resize()
111116

112117
$(document).off('focusin.bs.modal')
113118

@@ -143,11 +148,20 @@
143148
}
144149
}
145150

151+
Modal.prototype.resize = function () {
152+
if (this.isShown) {
153+
$(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
154+
} else {
155+
$(window).off('resize.bs.modal')
156+
}
157+
}
158+
146159
Modal.prototype.hideModal = function () {
147160
var that = this
148161
this.$element.hide()
149162
this.backdrop(function () {
150163
that.$body.removeClass('modal-open')
164+
that.resetAdjustments()
151165
that.resetScrollbar()
152166
that.$element.trigger('hidden.bs.modal')
153167
})
@@ -204,21 +218,50 @@
204218
}
205219
}
206220

221+
// these following methods are used to handle overflowing modals
222+
223+
Modal.prototype.handleUpdate = function () {
224+
if (this.options.backdrop) this.adjustBackdrop()
225+
this.adjustDialog()
226+
}
227+
228+
Modal.prototype.adjustBackdrop = function () {
229+
this.$backdrop
230+
.css('height', 0)
231+
.css('height', this.$element[0].scrollHeight)
232+
}
233+
234+
Modal.prototype.adjustDialog = function () {
235+
var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
236+
237+
this.$element.css({
238+
paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
239+
paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
240+
})
241+
}
242+
243+
Modal.prototype.resetAdjustments = function () {
244+
this.$element.css({
245+
paddingLeft: '',
246+
paddingRight: ''
247+
})
248+
}
249+
207250
Modal.prototype.checkScrollbar = function () {
251+
this.bodyIsOverflowing = document.body.scrollHeight > document.documentElement.clientHeight
208252
this.scrollbarWidth = this.measureScrollbar()
209253
}
210254

211255
Modal.prototype.setScrollbar = function () {
212256
var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
213-
if (this.scrollbarWidth) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
257+
if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
214258
}
215259

216260
Modal.prototype.resetScrollbar = function () {
217261
this.$body.css('padding-right', '')
218262
}
219263

220264
Modal.prototype.measureScrollbar = function () { // thx walsh
221-
if (document.body.clientWidth >= window.innerWidth) return 0
222265
var scrollDiv = document.createElement('div')
223266
scrollDiv.className = 'modal-scrollbar-measure'
224267
this.$body.append(scrollDiv)

js/popover.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ========================================================================
2-
* Bootstrap: popover.js v3.3.0
2+
* Bootstrap: popover.js v3.3.1
33
* http://getbootstrap.com/javascript/#popovers
44
* ========================================================================
55
* Copyright 2011-2014 Twitter, Inc.
@@ -19,7 +19,7 @@
1919

2020
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
2121

22-
Popover.VERSION = '3.3.0'
22+
Popover.VERSION = '3.3.1'
2323

2424
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
2525
placement: 'right',

0 commit comments

Comments
 (0)