From 386bf387ccabd3aec63745ec58fb828c5cd28f80 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Mon, 17 Nov 2014 22:35:24 +0100 Subject: rake convert --- assets/javascripts/bootstrap.js | 13 +++++-------- assets/javascripts/bootstrap/carousel.js | 11 ++++------- assets/javascripts/bootstrap/collapse.js | 2 +- assets/stylesheets/bootstrap/_carousel.scss | 12 ++++++------ lib/bootstrap-sass/version.rb | 2 +- 5 files changed, 17 insertions(+), 23 deletions(-) diff --git a/assets/javascripts/bootstrap.js b/assets/javascripts/bootstrap.js index b6ac8d9..50a4c3c 100644 --- a/assets/javascripts/bootstrap.js +++ b/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') diff --git a/assets/javascripts/bootstrap/carousel.js b/assets/javascripts/bootstrap/carousel.js index 282d618..99a077c 100644 --- a/assets/javascripts/bootstrap/carousel.js +++ b/assets/javascripts/bootstrap/carousel.js @@ -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] diff --git a/assets/javascripts/bootstrap/collapse.js b/assets/javascripts/bootstrap/collapse.js index b2cc125..a2ede59 100644 --- a/assets/javascripts/bootstrap/collapse.js +++ b/assets/javascripts/bootstrap/collapse.js @@ -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') diff --git a/assets/stylesheets/bootstrap/_carousel.scss b/assets/stylesheets/bootstrap/_carousel.scss index 49db83f..3a9853b 100644 --- a/assets/stylesheets/bootstrap/_carousel.scss +++ b/assets/stylesheets/bootstrap/_carousel.scss @@ -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; } } diff --git a/lib/bootstrap-sass/version.rb b/lib/bootstrap-sass/version.rb index eb8464f..ab1eaaa 100644 --- a/lib/bootstrap-sass/version.rb +++ b/lib/bootstrap-sass/version.rb @@ -1,4 +1,4 @@ module Bootstrap VERSION = '3.3.1.0' - BOOTSTRAP_SHA = '9a7e365c2c4360335d25246dac11afb1f577210a' + BOOTSTRAP_SHA = 'c2abfc0a4427237e288eee06a364662345fbbf9d' end -- cgit v1.2.3