This commit is contained in:
Gleb Mazovetskiy 2014-11-17 22:35:24 +01:00 коммит произвёл Gleb Mazovetskiy
Родитель 847887b0ac
Коммит 386bf387cc
5 изменённых файлов: 17 добавлений и 23 удалений

13
assets/javascripts/bootstrap.js поставляемый
Просмотреть файл

@ -359,8 +359,11 @@ if (typeof jQuery === 'undefined') {
}
Carousel.prototype.getItemForDirection = function (direction, active) {
var delta = direction == 'prev' ? -1 : 1
var activeIndex = this.getItemIndex(active)
var willWrap = (direction == 'prev' && activeIndex === 0)
|| (direction == 'next' && activeIndex == (this.$items.length - 1))
if (willWrap && !this.options.wrap) return active
var delta = direction == 'prev' ? -1 : 1
var itemIndex = (activeIndex + delta) % this.$items.length
return this.$items.eq(itemIndex)
}
@ -405,14 +408,8 @@ if (typeof jQuery === 'undefined') {
var $next = next || this.getItemForDirection(type, $active)
var isCycling = this.interval
var direction = type == 'next' ? 'left' : 'right'
var fallback = type == 'next' ? 'first' : 'last'
var that = this
if (!$next.length) {
if (!this.options.wrap) return
$next = this.$element.find('.item')[fallback]()
}
if ($next.hasClass('active')) return (this.sliding = false)
var relatedTarget = $next[0]
@ -576,7 +573,7 @@ if (typeof jQuery === 'undefined') {
if (this.transitioning || this.$element.hasClass('in')) return
var activesData
var actives = this.$parent && this.$parent.find('> .panel').children('.in, .collapsing')
var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
if (actives && actives.length) {
activesData = actives.data('bs.collapse')

Просмотреть файл

@ -70,8 +70,11 @@
}
Carousel.prototype.getItemForDirection = function (direction, active) {
var delta = direction == 'prev' ? -1 : 1
var activeIndex = this.getItemIndex(active)
var willWrap = (direction == 'prev' && activeIndex === 0)
|| (direction == 'next' && activeIndex == (this.$items.length - 1))
if (willWrap && !this.options.wrap) return active
var delta = direction == 'prev' ? -1 : 1
var itemIndex = (activeIndex + delta) % this.$items.length
return this.$items.eq(itemIndex)
}
@ -116,14 +119,8 @@
var $next = next || this.getItemForDirection(type, $active)
var isCycling = this.interval
var direction = type == 'next' ? 'left' : 'right'
var fallback = type == 'next' ? 'first' : 'last'
var that = this
if (!$next.length) {
if (!this.options.wrap) return
$next = this.$element.find('.item')[fallback]()
}
if ($next.hasClass('active')) return (this.sliding = false)
var relatedTarget = $next[0]

Просмотреть файл

@ -46,7 +46,7 @@
if (this.transitioning || this.$element.hasClass('in')) return
var activesData
var actives = this.$parent && this.$parent.find('> .panel').children('.in, .collapsing')
var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')
if (actives && actives.length) {
activesData = actives.data('bs.collapse')

Просмотреть файл

@ -27,24 +27,24 @@
// WebKit CSS3 transforms for supported devices
@media all and (transform-3d), (-webkit-transform-3d) {
transition: transform .6s ease-in-out;
backface-visibility: hidden;
perspective: 1000;
@include transition-transform(~'0.6s ease-in-out');
@include backface-visibility(~'hidden');
@include perspective(1000);
&.next,
&.active.right {
transform: translate3d(100%, 0, 0);
@include translate3d(100%, 0, 0);
left: 0;
}
&.prev,
&.active.left {
transform: translate3d(-100%, 0, 0);
@include translate3d(-100%, 0, 0);
left: 0;
}
&.next.left,
&.prev.right,
&.active {
transform: translate3d(0, 0, 0);
@include translate3d(0, 0, 0);
left: 0;
}
}

Просмотреть файл

@ -1,4 +1,4 @@
module Bootstrap
VERSION = '3.3.1.0'
BOOTSTRAP_SHA = '9a7e365c2c4360335d25246dac11afb1f577210a'
BOOTSTRAP_SHA = 'c2abfc0a4427237e288eee06a364662345fbbf9d'
end