mirror of
https://github.com/twbs/bootstrap-sass.git
synced 2022-11-09 12:27:02 -05:00
rake convert
This commit is contained in:
parent
8443f3c9e9
commit
0146e5dca0
11 changed files with 73 additions and 34 deletions
|
@ -1,4 +1,4 @@
|
|||
module Bootstrap
|
||||
VERSION = '3.0.3.0'
|
||||
BOOTSTRAP_SHA = 'dffd4ffad2b6cad7fb0bab747671d524d791054d'
|
||||
BOOTSTRAP_SHA = '50cf0b1a9d883ae3c4054dfd4071963fdf8aa812'
|
||||
end
|
||||
|
|
30
vendor/assets/javascripts/bootstrap/button.js
vendored
30
vendor/assets/javascripts/bootstrap/button.js
vendored
|
@ -13,8 +13,9 @@
|
|||
// ==============================
|
||||
|
||||
var Button = function (element, options) {
|
||||
this.$element = $(element)
|
||||
this.options = $.extend({}, Button.DEFAULTS, options)
|
||||
this.$element = $(element)
|
||||
this.options = $.extend({}, Button.DEFAULTS, options)
|
||||
this.isLoading = false
|
||||
}
|
||||
|
||||
Button.DEFAULTS = {
|
||||
|
@ -34,25 +35,26 @@
|
|||
$el[val](data[state] || this.options[state])
|
||||
|
||||
// push to event loop to allow forms to submit
|
||||
setTimeout(function () {
|
||||
state == 'loadingText' ?
|
||||
$el.addClass(d).attr(d, d) :
|
||||
$el.removeClass(d).removeAttr(d);
|
||||
}, 0)
|
||||
setTimeout($.proxy(function () {
|
||||
if (state == 'loadingText') {
|
||||
this.isLoading = true
|
||||
$el.addClass(d).attr(d, d)
|
||||
} else if (this.isLoading) {
|
||||
this.isLoading = false
|
||||
$el.removeClass(d).removeAttr(d)
|
||||
}
|
||||
}, this), 0)
|
||||
}
|
||||
|
||||
Button.prototype.toggle = function () {
|
||||
var $parent = this.$element.closest('[data-toggle="buttons"]')
|
||||
var changed = true
|
||||
var $parent = this.$element.closest('[data-toggle="buttons"]')
|
||||
|
||||
if ($parent.length) {
|
||||
var $input = this.$element.find('input')
|
||||
if ($input.prop('type') === 'radio') {
|
||||
// see if clicking on current one
|
||||
if ($input.prop('checked') && this.$element.hasClass('active'))
|
||||
changed = false
|
||||
else
|
||||
$parent.find('.active').removeClass('active')
|
||||
if ($input.prop('type') == 'radio') {
|
||||
if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
|
||||
else $parent.find('.active').removeClass('active')
|
||||
}
|
||||
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@
|
|||
$next = this.$element.find('.item')[fallback]()
|
||||
}
|
||||
|
||||
if ($next.hasClass('active')) return
|
||||
if ($next.hasClass('active')) return this.sliding = false
|
||||
|
||||
var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
|
||||
this.$element.trigger(e)
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
var complete = function () {
|
||||
this.$element
|
||||
.removeClass('collapsing')
|
||||
.addClass('in')
|
||||
.addClass('collapse in')
|
||||
[dimension]('auto')
|
||||
this.transitioning = 0
|
||||
this.$element.trigger('shown.bs.collapse')
|
||||
|
|
19
vendor/assets/javascripts/bootstrap/dropdown.js
vendored
19
vendor/assets/javascripts/bootstrap/dropdown.js
vendored
|
@ -34,13 +34,14 @@
|
|||
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
|
||||
}
|
||||
|
||||
$parent.trigger(e = $.Event('show.bs.dropdown'))
|
||||
var relatedTarget = { relatedTarget: this }
|
||||
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
|
||||
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$parent
|
||||
.toggleClass('open')
|
||||
.trigger('shown.bs.dropdown')
|
||||
.trigger('shown.bs.dropdown', relatedTarget)
|
||||
|
||||
$this.focus()
|
||||
}
|
||||
|
@ -66,7 +67,8 @@
|
|||
return $this.click()
|
||||
}
|
||||
|
||||
var $items = $('[role=menu] li:not(.divider):visible a', $parent)
|
||||
var desc = ' li:not(.divider):visible a'
|
||||
var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)
|
||||
|
||||
if (!$items.length) return
|
||||
|
||||
|
@ -79,14 +81,15 @@
|
|||
$items.eq(index).focus()
|
||||
}
|
||||
|
||||
function clearMenus() {
|
||||
function clearMenus(e) {
|
||||
$(backdrop).remove()
|
||||
$(toggle).each(function (e) {
|
||||
$(toggle).each(function () {
|
||||
var $parent = getParent($(this))
|
||||
var relatedTarget = { relatedTarget: this }
|
||||
if (!$parent.hasClass('open')) return
|
||||
$parent.trigger(e = $.Event('hide.bs.dropdown'))
|
||||
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
|
||||
if (e.isDefaultPrevented()) return
|
||||
$parent.removeClass('open').trigger('hidden.bs.dropdown')
|
||||
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -138,6 +141,6 @@
|
|||
.on('click.bs.dropdown.data-api', clearMenus)
|
||||
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
||||
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
||||
.on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]', Dropdown.prototype.keydown)
|
||||
.on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown)
|
||||
|
||||
}(jQuery);
|
||||
|
|
16
vendor/assets/javascripts/bootstrap/modal.js
vendored
16
vendor/assets/javascripts/bootstrap/modal.js
vendored
|
@ -18,7 +18,13 @@
|
|||
this.$backdrop =
|
||||
this.isShown = null
|
||||
|
||||
if (this.options.remote) this.$element.find('.modal-content').load(this.options.remote)
|
||||
if (this.options.remote) {
|
||||
this.$element
|
||||
.find('.modal-content')
|
||||
.load(this.options.remote, $.proxy(function () {
|
||||
this.$element.trigger('loaded.bs.modal')
|
||||
}, this))
|
||||
}
|
||||
}
|
||||
|
||||
Modal.DEFAULTS = {
|
||||
|
@ -52,7 +58,9 @@
|
|||
that.$element.appendTo(document.body) // don't move modals dom position
|
||||
}
|
||||
|
||||
that.$element.show()
|
||||
that.$element
|
||||
.show()
|
||||
.scrollTop(0)
|
||||
|
||||
if (transition) {
|
||||
that.$element[0].offsetWidth // force reflow
|
||||
|
@ -216,9 +224,9 @@
|
|||
var $this = $(this)
|
||||
var href = $this.attr('href')
|
||||
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
||||
var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
||||
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
||||
|
||||
e.preventDefault()
|
||||
if ($this.is('a')) e.preventDefault()
|
||||
|
||||
$target
|
||||
.modal(option, this)
|
||||
|
|
|
@ -43,7 +43,9 @@
|
|||
var content = this.getContent()
|
||||
|
||||
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
||||
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
|
||||
$tip.find('.popover-content')[ // we use append for html objects to maintain js events
|
||||
this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
|
||||
](content)
|
||||
|
||||
$tip.removeClass('fade top bottom left right in')
|
||||
|
||||
|
@ -87,6 +89,7 @@
|
|||
var data = $this.data('bs.popover')
|
||||
var options = typeof option == 'object' && option
|
||||
|
||||
if (!data && option == 'destroy') return
|
||||
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
|
||||
return ($href
|
||||
&& $href.length
|
||||
&& $href.is(':visible')
|
||||
&& [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
|
||||
})
|
||||
.sort(function (a, b) { return a[0] - b[0] })
|
||||
|
@ -73,6 +74,10 @@
|
|||
return activeTarget != (i = targets.last()[0]) && this.activate(i)
|
||||
}
|
||||
|
||||
if (activeTarget && scrollTop <= offsets[0]) {
|
||||
return activeTarget != (i = targets[0]) && this.activate(i)
|
||||
}
|
||||
|
||||
for (i = offsets.length; i--;) {
|
||||
activeTarget != targets[i]
|
||||
&& scrollTop >= offsets[i]
|
||||
|
@ -85,7 +90,7 @@
|
|||
this.activeTarget = target
|
||||
|
||||
$(this.selector)
|
||||
.parents('.active')
|
||||
.parentsUntil(this.options.target, '.active')
|
||||
.removeClass('active')
|
||||
|
||||
var selector = this.selector +
|
||||
|
|
16
vendor/assets/javascripts/bootstrap/tooltip.js
vendored
16
vendor/assets/javascripts/bootstrap/tooltip.js
vendored
|
@ -128,6 +128,7 @@
|
|||
this.$element.trigger(e)
|
||||
|
||||
if (e.isDefaultPrevented()) return
|
||||
var that = this;
|
||||
|
||||
var $tip = this.tip()
|
||||
|
||||
|
@ -178,7 +179,16 @@
|
|||
|
||||
this.applyPlacement(calculatedOffset, placement)
|
||||
this.hoverState = null
|
||||
this.$element.trigger('shown.bs.' + this.type)
|
||||
|
||||
var complete = function() {
|
||||
that.$element.trigger('shown.bs.' + that.type)
|
||||
}
|
||||
|
||||
$.support.transition && this.$tip.hasClass('fade') ?
|
||||
$tip
|
||||
.one($.support.transition.end, complete)
|
||||
.emulateTransitionEnd(150) :
|
||||
complete()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -261,6 +271,7 @@
|
|||
|
||||
function complete() {
|
||||
if (that.hoverState != 'in') $tip.detach()
|
||||
that.$element.trigger('hidden.bs.' + that.type)
|
||||
}
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
@ -276,7 +287,6 @@
|
|||
complete()
|
||||
|
||||
this.hoverState = null
|
||||
this.$element.trigger('hidden.bs.' + this.type)
|
||||
|
||||
return this
|
||||
}
|
||||
|
@ -352,6 +362,7 @@
|
|||
}
|
||||
|
||||
Tooltip.prototype.destroy = function () {
|
||||
clearTimeout(this.timeout)
|
||||
this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
|
||||
}
|
||||
|
||||
|
@ -367,6 +378,7 @@
|
|||
var data = $this.data('bs.tooltip')
|
||||
var options = typeof option == 'object' && option
|
||||
|
||||
if (!data && option == 'destroy') return
|
||||
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
|
|
|
@ -715,7 +715,7 @@
|
|||
}
|
||||
}
|
||||
@mixin make-md-column-push($columns) {
|
||||
@media (min-width: $screen-md) {
|
||||
@media (min-width: $screen-md-min) {
|
||||
left: percentage(($columns / $grid-columns));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -193,6 +193,12 @@
|
|||
border: 1px solid transparent;
|
||||
border-radius: $border-radius-base;
|
||||
|
||||
// We remove the `outline` here, but later compensate by attaching `:hover`
|
||||
// styles to `:focus`.
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
// Bars
|
||||
.icon-bar {
|
||||
display: block;
|
||||
|
|
Loading…
Add table
Reference in a new issue