bootstrap-generators 2.0.4 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +211 -63
- data/lib/bootstrap/generators/version.rb +1 -1
- data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.css.scss +102 -28
- data/lib/generators/bootstrap/install/templates/assets/stylesheets/bootstrap-variables.less +104 -31
- data/vendor/assets/images/glyphicons-halflings.png +0 -0
- data/vendor/assets/javascripts/bootstrap-affix.js +104 -0
- data/vendor/assets/javascripts/bootstrap-alert.js +1 -1
- data/vendor/assets/javascripts/bootstrap-button.js +2 -2
- data/vendor/assets/javascripts/bootstrap-carousel.js +12 -5
- data/vendor/assets/javascripts/bootstrap-collapse.js +4 -3
- data/vendor/assets/javascripts/bootstrap-dropdown.js +66 -16
- data/vendor/assets/javascripts/bootstrap-modal.js +95 -74
- data/vendor/assets/javascripts/bootstrap-popover.js +9 -4
- data/vendor/assets/javascripts/bootstrap-scrollspy.js +9 -9
- data/vendor/assets/javascripts/bootstrap-tab.js +2 -2
- data/vendor/assets/javascripts/bootstrap-tooltip.js +15 -15
- data/vendor/assets/javascripts/bootstrap-transition.js +2 -3
- data/vendor/assets/javascripts/bootstrap-typeahead.js +51 -36
- data/vendor/assets/javascripts/bootstrap.js +1 -1
- data/vendor/assets/stylesheets/bootstrap-responsive.css +1058 -0
- data/vendor/assets/stylesheets/bootstrap-responsive.min.css +9 -0
- data/vendor/assets/stylesheets/bootstrap.css +5774 -0
- data/vendor/assets/stylesheets/bootstrap.min.css +9 -0
- data/vendor/twitter/bootstrap/less/accordion.less +3 -2
- data/vendor/twitter/bootstrap/less/alerts.less +16 -9
- data/vendor/twitter/bootstrap/less/bootstrap.less +1 -1
- data/vendor/twitter/bootstrap/less/breadcrumbs.less +10 -10
- data/vendor/twitter/bootstrap/less/button-groups.less +79 -25
- data/vendor/twitter/bootstrap/less/buttons.less +107 -67
- data/vendor/twitter/bootstrap/less/carousel.less +13 -3
- data/vendor/twitter/bootstrap/less/close.less +4 -2
- data/vendor/twitter/bootstrap/less/code.less +6 -5
- data/vendor/twitter/bootstrap/less/component-animations.less +4 -2
- data/vendor/twitter/bootstrap/less/dropdowns.less +82 -15
- data/vendor/twitter/bootstrap/less/forms.less +124 -57
- data/vendor/twitter/bootstrap/less/grid.less +17 -1
- data/vendor/twitter/bootstrap/less/hero-unit.less +4 -2
- data/vendor/twitter/bootstrap/less/labels-badges.less +19 -2
- data/vendor/twitter/bootstrap/less/layouts.less +1 -2
- data/vendor/twitter/bootstrap/less/mixins.less +112 -77
- data/vendor/twitter/bootstrap/less/modals.less +12 -4
- data/vendor/twitter/bootstrap/less/navbar.less +245 -128
- data/vendor/twitter/bootstrap/less/navs.less +38 -17
- data/vendor/twitter/bootstrap/less/pager.less +11 -7
- data/vendor/twitter/bootstrap/less/pagination.less +23 -15
- data/vendor/twitter/bootstrap/less/popovers.less +101 -33
- data/vendor/twitter/bootstrap/less/progress-bars.less +18 -13
- data/vendor/twitter/bootstrap/less/reset.less +10 -4
- data/vendor/twitter/bootstrap/less/responsive-1200px-min.less +9 -7
- data/vendor/twitter/bootstrap/less/responsive-767px-max.less +95 -70
- data/vendor/twitter/bootstrap/less/responsive-768px-979px.less +7 -5
- data/vendor/twitter/bootstrap/less/responsive-navbar.less +30 -6
- data/vendor/twitter/bootstrap/less/responsive-utilities.less +17 -15
- data/vendor/twitter/bootstrap/less/responsive.less +5 -5
- data/vendor/twitter/bootstrap/less/scaffolding.less +27 -4
- data/vendor/twitter/bootstrap/less/sprites.less +21 -19
- data/vendor/twitter/bootstrap/less/tables.less +81 -12
- data/vendor/twitter/bootstrap/less/thumbnails.less +9 -4
- data/vendor/twitter/bootstrap/less/tooltip.less +47 -12
- data/vendor/twitter/bootstrap/less/type.less +75 -86
- data/vendor/twitter/bootstrap/less/utilities.less +9 -2
- data/vendor/twitter/bootstrap/less/variables.less +104 -31
- data/vendor/twitter/bootstrap/less/wells.less +7 -5
- data/vendor/twitter/bootstrap/sass/_accordion.scss +3 -2
- data/vendor/twitter/bootstrap/sass/_alerts.scss +15 -8
- data/vendor/twitter/bootstrap/sass/_breadcrumbs.scss +10 -10
- data/vendor/twitter/bootstrap/sass/_button-groups.scss +77 -23
- data/vendor/twitter/bootstrap/sass/_buttons.scss +106 -66
- data/vendor/twitter/bootstrap/sass/_carousel.scss +13 -3
- data/vendor/twitter/bootstrap/sass/_close.scss +5 -3
- data/vendor/twitter/bootstrap/sass/_code.scss +7 -6
- data/vendor/twitter/bootstrap/sass/_component-animations.scss +5 -3
- data/vendor/twitter/bootstrap/sass/_dropdowns.scss +85 -18
- data/vendor/twitter/bootstrap/sass/_forms.scss +121 -53
- data/vendor/twitter/bootstrap/sass/_grid.scss +17 -1
- data/vendor/twitter/bootstrap/sass/_hero-unit.scss +4 -2
- data/vendor/twitter/bootstrap/sass/_labels-badges.scss +29 -12
- data/vendor/twitter/bootstrap/sass/_layouts.scss +2 -3
- data/vendor/twitter/bootstrap/sass/_mixins.scss +163 -127
- data/vendor/twitter/bootstrap/sass/_modals.scss +12 -4
- data/vendor/twitter/bootstrap/sass/_navbar.scss +243 -127
- data/vendor/twitter/bootstrap/sass/_navs.scss +36 -15
- data/vendor/twitter/bootstrap/sass/_pager.scss +12 -8
- data/vendor/twitter/bootstrap/sass/_pagination.scss +23 -15
- data/vendor/twitter/bootstrap/sass/_popovers.scss +101 -33
- data/vendor/twitter/bootstrap/sass/_progress-bars.scss +18 -13
- data/vendor/twitter/bootstrap/sass/_reset.scss +8 -3
- data/vendor/twitter/bootstrap/sass/_responsive-1200px-min.scss +9 -7
- data/vendor/twitter/bootstrap/sass/_responsive-767px-max.scss +95 -70
- data/vendor/twitter/bootstrap/sass/_responsive-768px-979px.scss +8 -6
- data/vendor/twitter/bootstrap/sass/_responsive-navbar.scss +29 -5
- data/vendor/twitter/bootstrap/sass/_responsive-utilities.scss +32 -15
- data/vendor/twitter/bootstrap/sass/_scaffolding.scss +29 -4
- data/vendor/twitter/bootstrap/sass/_sprites.scss +21 -19
- data/vendor/twitter/bootstrap/sass/_tables.scss +79 -11
- data/vendor/twitter/bootstrap/sass/_thumbnails.scss +9 -4
- data/vendor/twitter/bootstrap/sass/_tooltip.scss +47 -12
- data/vendor/twitter/bootstrap/sass/_type.scss +74 -85
- data/vendor/twitter/bootstrap/sass/_utilities.scss +24 -2
- data/vendor/twitter/bootstrap/sass/_variables.scss +102 -28
- data/vendor/twitter/bootstrap/sass/_wells.scss +7 -5
- data/vendor/twitter/bootstrap/sass/bootstrap.scss +1 -1
- data/vendor/twitter/bootstrap/sass/responsive.scss +5 -5
- metadata +15 -10
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ==========================================================
|
2
|
-
* bootstrap-alert.js v2.
|
2
|
+
* bootstrap-alert.js v2.1.1
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#alerts
|
4
4
|
* ==========================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ============================================================
|
2
|
-
* bootstrap-button.js v2.
|
2
|
+
* bootstrap-button.js v2.1.1
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#buttons
|
4
4
|
* ============================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -51,7 +51,7 @@
|
|
51
51
|
}
|
52
52
|
|
53
53
|
Button.prototype.toggle = function () {
|
54
|
-
var $parent = this.$element.
|
54
|
+
var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
|
55
55
|
|
56
56
|
$parent && $parent
|
57
57
|
.find('.active')
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ==========================================================
|
2
|
-
* bootstrap-carousel.js v2.
|
2
|
+
* bootstrap-carousel.js v2.1.1
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#carousel
|
4
4
|
* ==========================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -46,7 +46,7 @@
|
|
46
46
|
}
|
47
47
|
|
48
48
|
, to: function (pos) {
|
49
|
-
var $active = this.$element.find('.active')
|
49
|
+
var $active = this.$element.find('.item.active')
|
50
50
|
, children = $active.parent().children()
|
51
51
|
, activePos = children.index($active)
|
52
52
|
, that = this
|
@@ -68,6 +68,10 @@
|
|
68
68
|
|
69
69
|
, pause: function (e) {
|
70
70
|
if (!e) this.paused = true
|
71
|
+
if (this.$element.find('.next, .prev').length && $.support.transition.end) {
|
72
|
+
this.$element.trigger($.support.transition.end)
|
73
|
+
this.cycle()
|
74
|
+
}
|
71
75
|
clearInterval(this.interval)
|
72
76
|
this.interval = null
|
73
77
|
return this
|
@@ -84,13 +88,15 @@
|
|
84
88
|
}
|
85
89
|
|
86
90
|
, slide: function (type, next) {
|
87
|
-
var $active = this.$element.find('.active')
|
91
|
+
var $active = this.$element.find('.item.active')
|
88
92
|
, $next = next || $active[type]()
|
89
93
|
, isCycling = this.interval
|
90
94
|
, direction = type == 'next' ? 'left' : 'right'
|
91
95
|
, fallback = type == 'next' ? 'first' : 'last'
|
92
96
|
, that = this
|
93
|
-
, e = $.Event('slide'
|
97
|
+
, e = $.Event('slide', {
|
98
|
+
relatedTarget: $next[0]
|
99
|
+
})
|
94
100
|
|
95
101
|
this.sliding = true
|
96
102
|
|
@@ -138,9 +144,10 @@
|
|
138
144
|
var $this = $(this)
|
139
145
|
, data = $this.data('carousel')
|
140
146
|
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
|
147
|
+
, action = typeof option == 'string' ? option : options.slide
|
141
148
|
if (!data) $this.data('carousel', (data = new Carousel(this, options)))
|
142
149
|
if (typeof option == 'number') data.to(option)
|
143
|
-
else if (
|
150
|
+
else if (action) data[action]()
|
144
151
|
else if (options.interval) data.cycle()
|
145
152
|
})
|
146
153
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* =============================================================
|
2
|
-
* bootstrap-collapse.js v2.
|
2
|
+
* bootstrap-collapse.js v2.1.1
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#collapse
|
4
4
|
* =============================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -67,7 +67,7 @@
|
|
67
67
|
|
68
68
|
this.$element[dimension](0)
|
69
69
|
this.transition('addClass', $.Event('show'), 'shown')
|
70
|
-
this.$element[dimension](this.$element[0][scroll])
|
70
|
+
$.support.transition && this.$element[dimension](this.$element[0][scroll])
|
71
71
|
}
|
72
72
|
|
73
73
|
, hide: function () {
|
@@ -144,12 +144,13 @@
|
|
144
144
|
* ==================== */
|
145
145
|
|
146
146
|
$(function () {
|
147
|
-
$('body').on('click.collapse.data-api', '[data-toggle=collapse]', function (
|
147
|
+
$('body').on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
|
148
148
|
var $this = $(this), href
|
149
149
|
, target = $this.attr('data-target')
|
150
150
|
|| e.preventDefault()
|
151
151
|
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
152
152
|
, option = $(target).data('collapse') ? 'toggle' : $this.data()
|
153
|
+
$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
153
154
|
$(target).collapse(option)
|
154
155
|
})
|
155
156
|
})
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* ============================================================
|
2
|
-
* bootstrap-dropdown.js v2.
|
2
|
+
* bootstrap-dropdown.js v2.1.1
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#dropdowns
|
4
4
|
* ============================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -26,7 +26,7 @@
|
|
26
26
|
/* DROPDOWN CLASS DEFINITION
|
27
27
|
* ========================= */
|
28
28
|
|
29
|
-
var toggle = '[data-toggle=
|
29
|
+
var toggle = '[data-toggle=dropdown]'
|
30
30
|
, Dropdown = function (element) {
|
31
31
|
var $el = $(element).on('click.dropdown.data-api', this.toggle)
|
32
32
|
$('html').on('click.dropdown.data-api', function () {
|
@@ -41,34 +41,82 @@
|
|
41
41
|
, toggle: function (e) {
|
42
42
|
var $this = $(this)
|
43
43
|
, $parent
|
44
|
-
, selector
|
45
44
|
, isActive
|
46
45
|
|
47
46
|
if ($this.is('.disabled, :disabled')) return
|
48
47
|
|
49
|
-
|
48
|
+
$parent = getParent($this)
|
50
49
|
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
isActive = $parent.hasClass('open')
|
51
|
+
|
52
|
+
clearMenus()
|
53
|
+
|
54
|
+
if (!isActive) {
|
55
|
+
$parent.toggleClass('open')
|
56
|
+
$this.focus()
|
54
57
|
}
|
55
58
|
|
56
|
-
|
57
|
-
|
59
|
+
return false
|
60
|
+
}
|
61
|
+
|
62
|
+
, keydown: function (e) {
|
63
|
+
var $this
|
64
|
+
, $items
|
65
|
+
, $active
|
66
|
+
, $parent
|
67
|
+
, isActive
|
68
|
+
, index
|
69
|
+
|
70
|
+
if (!/(38|40|27)/.test(e.keyCode)) return
|
71
|
+
|
72
|
+
$this = $(this)
|
73
|
+
|
74
|
+
e.preventDefault()
|
75
|
+
e.stopPropagation()
|
76
|
+
|
77
|
+
if ($this.is('.disabled, :disabled')) return
|
78
|
+
|
79
|
+
$parent = getParent($this)
|
58
80
|
|
59
81
|
isActive = $parent.hasClass('open')
|
60
82
|
|
61
|
-
|
83
|
+
if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
|
62
84
|
|
63
|
-
|
85
|
+
$items = $('[role=menu] li:not(.divider) a', $parent)
|
64
86
|
|
65
|
-
return
|
87
|
+
if (!$items.length) return
|
88
|
+
|
89
|
+
index = $items.index($items.filter(':focus'))
|
90
|
+
|
91
|
+
if (e.keyCode == 38 && index > 0) index-- // up
|
92
|
+
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
93
|
+
if (!~index) index = 0
|
94
|
+
|
95
|
+
$items
|
96
|
+
.eq(index)
|
97
|
+
.focus()
|
66
98
|
}
|
67
99
|
|
68
100
|
}
|
69
101
|
|
70
102
|
function clearMenus() {
|
71
|
-
$(toggle)
|
103
|
+
getParent($(toggle))
|
104
|
+
.removeClass('open')
|
105
|
+
}
|
106
|
+
|
107
|
+
function getParent($this) {
|
108
|
+
var selector = $this.attr('data-target')
|
109
|
+
, $parent
|
110
|
+
|
111
|
+
if (!selector) {
|
112
|
+
selector = $this.attr('href')
|
113
|
+
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
114
|
+
}
|
115
|
+
|
116
|
+
$parent = $(selector)
|
117
|
+
$parent.length || ($parent = $this.parent())
|
118
|
+
|
119
|
+
return $parent
|
72
120
|
}
|
73
121
|
|
74
122
|
|
@@ -91,10 +139,12 @@
|
|
91
139
|
* =================================== */
|
92
140
|
|
93
141
|
$(function () {
|
94
|
-
$('html')
|
142
|
+
$('html')
|
143
|
+
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
|
95
144
|
$('body')
|
96
|
-
.on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
|
97
|
-
.on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
145
|
+
.on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
146
|
+
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
147
|
+
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
98
148
|
})
|
99
149
|
|
100
150
|
}(window.jQuery);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/* =========================================================
|
2
|
-
* bootstrap-modal.js v2.
|
2
|
+
* bootstrap-modal.js v2.1.1
|
3
3
|
* http://twitter.github.com/bootstrap/javascript.html#modals
|
4
4
|
* =========================================================
|
5
5
|
* Copyright 2012 Twitter, Inc.
|
@@ -26,10 +26,11 @@
|
|
26
26
|
/* MODAL CLASS DEFINITION
|
27
27
|
* ====================== */
|
28
28
|
|
29
|
-
var Modal = function (
|
29
|
+
var Modal = function (element, options) {
|
30
30
|
this.options = options
|
31
|
-
this.$element = $(
|
31
|
+
this.$element = $(element)
|
32
32
|
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
|
33
|
+
this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
|
33
34
|
}
|
34
35
|
|
35
36
|
Modal.prototype = {
|
@@ -52,8 +53,9 @@
|
|
52
53
|
|
53
54
|
this.isShown = true
|
54
55
|
|
55
|
-
escape
|
56
|
-
|
56
|
+
this.escape()
|
57
|
+
|
58
|
+
this.backdrop(function () {
|
57
59
|
var transition = $.support.transition && that.$element.hasClass('fade')
|
58
60
|
|
59
61
|
if (!that.$element.parent().length) {
|
@@ -67,7 +69,12 @@
|
|
67
69
|
that.$element[0].offsetWidth // force reflow
|
68
70
|
}
|
69
71
|
|
70
|
-
that.$element
|
72
|
+
that.$element
|
73
|
+
.addClass('in')
|
74
|
+
.attr('aria-hidden', false)
|
75
|
+
.focus()
|
76
|
+
|
77
|
+
that.enforceFocus()
|
71
78
|
|
72
79
|
transition ?
|
73
80
|
that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
|
@@ -91,90 +98,98 @@
|
|
91
98
|
|
92
99
|
$('body').removeClass('modal-open')
|
93
100
|
|
94
|
-
escape
|
101
|
+
this.escape()
|
102
|
+
|
103
|
+
$(document).off('focusin.modal')
|
95
104
|
|
96
|
-
this.$element
|
105
|
+
this.$element
|
106
|
+
.removeClass('in')
|
107
|
+
.attr('aria-hidden', true)
|
97
108
|
|
98
109
|
$.support.transition && this.$element.hasClass('fade') ?
|
99
|
-
hideWithTransition
|
100
|
-
hideModal
|
110
|
+
this.hideWithTransition() :
|
111
|
+
this.hideModal()
|
101
112
|
}
|
102
113
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
, timeout = setTimeout(function () {
|
112
|
-
that.$element.off($.support.transition.end)
|
113
|
-
hideModal.call(that)
|
114
|
-
}, 500)
|
114
|
+
, enforceFocus: function () {
|
115
|
+
var that = this
|
116
|
+
$(document).on('focusin.modal', function (e) {
|
117
|
+
if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
|
118
|
+
that.$element.focus()
|
119
|
+
}
|
120
|
+
})
|
121
|
+
}
|
115
122
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
123
|
+
, escape: function () {
|
124
|
+
var that = this
|
125
|
+
if (this.isShown && this.options.keyboard) {
|
126
|
+
this.$element.on('keyup.dismiss.modal', function ( e ) {
|
127
|
+
e.which == 27 && that.hide()
|
128
|
+
})
|
129
|
+
} else if (!this.isShown) {
|
130
|
+
this.$element.off('keyup.dismiss.modal')
|
131
|
+
}
|
132
|
+
}
|
121
133
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
134
|
+
, hideWithTransition: function () {
|
135
|
+
var that = this
|
136
|
+
, timeout = setTimeout(function () {
|
137
|
+
that.$element.off($.support.transition.end)
|
138
|
+
that.hideModal()
|
139
|
+
}, 500)
|
140
|
+
|
141
|
+
this.$element.one($.support.transition.end, function () {
|
142
|
+
clearTimeout(timeout)
|
143
|
+
that.hideModal()
|
144
|
+
})
|
145
|
+
}
|
126
146
|
|
127
|
-
|
128
|
-
|
147
|
+
, hideModal: function (that) {
|
148
|
+
this.$element
|
149
|
+
.hide()
|
150
|
+
.trigger('hidden')
|
129
151
|
|
130
|
-
|
131
|
-
|
132
|
-
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
152
|
+
this.backdrop()
|
153
|
+
}
|
133
154
|
|
134
|
-
|
135
|
-
|
155
|
+
, removeBackdrop: function () {
|
156
|
+
this.$backdrop.remove()
|
157
|
+
this.$backdrop = null
|
158
|
+
}
|
136
159
|
|
137
|
-
|
138
|
-
|
160
|
+
, backdrop: function (callback) {
|
161
|
+
var that = this
|
162
|
+
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
139
163
|
|
140
|
-
|
141
|
-
|
142
|
-
}
|
164
|
+
if (this.isShown && this.options.backdrop) {
|
165
|
+
var doAnimate = $.support.transition && animate
|
143
166
|
|
144
|
-
|
167
|
+
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
168
|
+
.appendTo(document.body)
|
145
169
|
|
146
|
-
|
170
|
+
if (this.options.backdrop != 'static') {
|
171
|
+
this.$backdrop.click($.proxy(this.hide, this))
|
172
|
+
}
|
147
173
|
|
148
|
-
|
149
|
-
this.$backdrop.one($.support.transition.end, callback) :
|
150
|
-
callback()
|
174
|
+
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
151
175
|
|
152
|
-
|
153
|
-
this.$backdrop.removeClass('in')
|
176
|
+
this.$backdrop.addClass('in')
|
154
177
|
|
155
|
-
|
156
|
-
|
157
|
-
|
178
|
+
doAnimate ?
|
179
|
+
this.$backdrop.one($.support.transition.end, callback) :
|
180
|
+
callback()
|
158
181
|
|
159
|
-
|
160
|
-
|
161
|
-
}
|
162
|
-
}
|
182
|
+
} else if (!this.isShown && this.$backdrop) {
|
183
|
+
this.$backdrop.removeClass('in')
|
163
184
|
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
}
|
185
|
+
$.support.transition && this.$element.hasClass('fade')?
|
186
|
+
this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
|
187
|
+
this.removeBackdrop()
|
168
188
|
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
e.which == 27 && that.hide()
|
174
|
-
})
|
175
|
-
} else if (!this.isShown) {
|
176
|
-
$(document).off('keyup.dismiss.modal')
|
177
|
-
}
|
189
|
+
} else if (callback) {
|
190
|
+
callback()
|
191
|
+
}
|
192
|
+
}
|
178
193
|
}
|
179
194
|
|
180
195
|
|
@@ -206,12 +221,18 @@
|
|
206
221
|
|
207
222
|
$(function () {
|
208
223
|
$('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
|
209
|
-
var $this = $(this)
|
210
|
-
,
|
211
|
-
,
|
224
|
+
var $this = $(this)
|
225
|
+
, href = $this.attr('href')
|
226
|
+
, $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
227
|
+
, option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
212
228
|
|
213
229
|
e.preventDefault()
|
214
|
-
|
230
|
+
|
231
|
+
$target
|
232
|
+
.modal(option)
|
233
|
+
.one('hide', function () {
|
234
|
+
$this.focus()
|
235
|
+
})
|
215
236
|
})
|
216
237
|
})
|
217
238
|
|