From 6d6a7fe36b87799af8c0e719bef7e3b6b04d11ca Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Tue, 12 Aug 2014 03:12:06 +0200 Subject: [PATCH] rake convert --- assets/javascripts/bootstrap.js | 46 +++++++++++++++------ assets/javascripts/bootstrap/alert.js | 4 +- assets/javascripts/bootstrap/carousel.js | 15 +++++-- assets/javascripts/bootstrap/collapse.js | 6 ++- assets/javascripts/bootstrap/modal.js | 11 +++-- assets/javascripts/bootstrap/tab.js | 4 +- assets/javascripts/bootstrap/tooltip.js | 6 ++- assets/stylesheets/bootstrap/_buttons.scss | 1 + assets/stylesheets/bootstrap/_carousel.scss | 24 +++++++++++ assets/stylesheets/bootstrap/_forms.scss | 15 +++++++ assets/stylesheets/bootstrap/_panels.scss | 4 +- assets/stylesheets/bootstrap/_tables.scss | 4 +- lib/bootstrap-sass/version.rb | 2 +- 13 files changed, 112 insertions(+), 30 deletions(-) diff --git a/assets/javascripts/bootstrap.js b/assets/javascripts/bootstrap.js index 7bafe37c..bd929c71 100644 --- a/assets/javascripts/bootstrap.js +++ b/assets/javascripts/bootstrap.js @@ -183,6 +183,8 @@ Alert.VERSION = '3.2.0' + Alert.TRANSITION_DURATION = 150 + Alert.prototype.close = function (e) { var $this = $(this) var selector = $this.attr('data-target') @@ -214,7 +216,7 @@ $.support.transition && $parent.hasClass('fade') ? $parent .one('bsTransitionEnd', removeElement) - .emulateTransitionEnd(150) : + .emulateTransitionEnd(Alert.TRANSITION_DURATION) : removeElement() } @@ -401,6 +403,8 @@ Carousel.VERSION = '3.2.0' + Carousel.TRANSITION_DURATION = 600 + Carousel.DEFAULTS = { interval: 5000, pause: 'hover', @@ -434,6 +438,13 @@ return this.$items.index(item || this.$active) } + Carousel.prototype.getItemForDirection = function (direction, active) { + var delta = direction == 'prev' ? -1 : 1 + var activeIndex = this.getItemIndex(active) + var itemIndex = (activeIndex + delta) % this.$items.length + return this.$items.eq(itemIndex) + } + Carousel.prototype.to = function (pos) { var that = this var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) @@ -443,7 +454,7 @@ if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" if (activeIndex == pos) return this.pause().cycle() - return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) + return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) } Carousel.prototype.pause = function (e) { @@ -471,7 +482,7 @@ Carousel.prototype.slide = function (type, next) { var $active = this.$element.find('.item.active') - var $next = next || $active[type]() + var $next = next || this.getItemForDirection(type, $active) var isCycling = this.interval var direction = type == 'next' ? 'left' : 'right' var fallback = type == 'next' ? 'first' : 'last' @@ -517,7 +528,7 @@ that.$element.trigger(slidEvent) }, 0) }) - .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000) + .emulateTransitionEnd(Carousel.TRANSITION_DURATION) } else { $active.removeClass('active') $next.addClass('active') @@ -619,6 +630,8 @@ Collapse.VERSION = '3.2.0' + Collapse.TRANSITION_DURATION = 350 + Collapse.DEFAULTS = { toggle: true } @@ -667,7 +680,7 @@ this.$element .one('bsTransitionEnd', $.proxy(complete, this)) - .emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize]) + .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) } Collapse.prototype.hide = function () { @@ -700,7 +713,7 @@ this.$element [dimension](0) .one('bsTransitionEnd', $.proxy(complete, this)) - .emulateTransitionEnd(350) + .emulateTransitionEnd(Collapse.TRANSITION_DURATION) } Collapse.prototype.toggle = function () { @@ -944,6 +957,8 @@ Tab.VERSION = '3.2.0' + Tab.TRANSITION_DURATION = 150 + Tab.prototype.show = function () { var $this = this.element var $ul = $this.closest('ul:not(.dropdown-menu)') @@ -1007,7 +1022,7 @@ $active.length && transition ? $active .one('bsTransitionEnd', next) - .emulateTransitionEnd(150) : + .emulateTransitionEnd(Tab.TRANSITION_DURATION) : next() $active.removeClass('in') @@ -1317,6 +1332,9 @@ Modal.VERSION = '3.2.0' + Modal.TRANSITION_DURATION = 300 + Modal.BACKDROP_TRANSITION_DURATION = 150 + Modal.DEFAULTS = { backdrop: true, keyboard: true, @@ -1373,7 +1391,7 @@ .one('bsTransitionEnd', function () { that.$element.trigger('focus').trigger(e) }) - .emulateTransitionEnd(300) : + .emulateTransitionEnd(Modal.TRANSITION_DURATION) : that.$element.trigger('focus').trigger(e) }) } @@ -1404,7 +1422,7 @@ $.support.transition && this.$element.hasClass('fade') ? this.$element .one('bsTransitionEnd', $.proxy(this.hideModal, this)) - .emulateTransitionEnd(300) : + .emulateTransitionEnd(Modal.TRANSITION_DURATION) : this.hideModal() } @@ -1467,7 +1485,7 @@ doAnimate ? this.$backdrop .one('bsTransitionEnd', callback) - .emulateTransitionEnd(150) : + .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : callback() } else if (!this.isShown && this.$backdrop) { @@ -1480,7 +1498,7 @@ $.support.transition && this.$element.hasClass('fade') ? this.$backdrop .one('bsTransitionEnd', callbackRemove) - .emulateTransitionEnd(150) : + .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : callbackRemove() } else if (callback) { @@ -1593,6 +1611,8 @@ Tooltip.VERSION = '3.2.0' + Tooltip.TRANSITION_DURATION = 150 + Tooltip.DEFAULTS = { animation: true, placement: 'top', @@ -1773,7 +1793,7 @@ $.support.transition && this.$tip.hasClass('fade') ? $tip .one('bsTransitionEnd', complete) - .emulateTransitionEnd(150) : + .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete() } } @@ -1861,7 +1881,7 @@ $.support.transition && this.$tip.hasClass('fade') ? $tip .one('bsTransitionEnd', complete) - .emulateTransitionEnd(150) : + .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete() this.hoverState = null diff --git a/assets/javascripts/bootstrap/alert.js b/assets/javascripts/bootstrap/alert.js index 0efd92cb..5389c32e 100644 --- a/assets/javascripts/bootstrap/alert.js +++ b/assets/javascripts/bootstrap/alert.js @@ -20,6 +20,8 @@ Alert.VERSION = '3.2.0' + Alert.TRANSITION_DURATION = 150 + Alert.prototype.close = function (e) { var $this = $(this) var selector = $this.attr('data-target') @@ -51,7 +53,7 @@ $.support.transition && $parent.hasClass('fade') ? $parent .one('bsTransitionEnd', removeElement) - .emulateTransitionEnd(150) : + .emulateTransitionEnd(Alert.TRANSITION_DURATION) : removeElement() } diff --git a/assets/javascripts/bootstrap/carousel.js b/assets/javascripts/bootstrap/carousel.js index b7da1ba5..65cc7b91 100644 --- a/assets/javascripts/bootstrap/carousel.js +++ b/assets/javascripts/bootstrap/carousel.js @@ -30,6 +30,8 @@ Carousel.VERSION = '3.2.0' + Carousel.TRANSITION_DURATION = 600 + Carousel.DEFAULTS = { interval: 5000, pause: 'hover', @@ -63,6 +65,13 @@ return this.$items.index(item || this.$active) } + Carousel.prototype.getItemForDirection = function (direction, active) { + var delta = direction == 'prev' ? -1 : 1 + var activeIndex = this.getItemIndex(active) + var itemIndex = (activeIndex + delta) % this.$items.length + return this.$items.eq(itemIndex) + } + Carousel.prototype.to = function (pos) { var that = this var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')) @@ -72,7 +81,7 @@ if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid" if (activeIndex == pos) return this.pause().cycle() - return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) + return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) } Carousel.prototype.pause = function (e) { @@ -100,7 +109,7 @@ Carousel.prototype.slide = function (type, next) { var $active = this.$element.find('.item.active') - var $next = next || $active[type]() + var $next = next || this.getItemForDirection(type, $active) var isCycling = this.interval var direction = type == 'next' ? 'left' : 'right' var fallback = type == 'next' ? 'first' : 'last' @@ -146,7 +155,7 @@ that.$element.trigger(slidEvent) }, 0) }) - .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000) + .emulateTransitionEnd(Carousel.TRANSITION_DURATION) } else { $active.removeClass('active') $next.addClass('active') diff --git a/assets/javascripts/bootstrap/collapse.js b/assets/javascripts/bootstrap/collapse.js index 5a524241..a265344f 100644 --- a/assets/javascripts/bootstrap/collapse.js +++ b/assets/javascripts/bootstrap/collapse.js @@ -24,6 +24,8 @@ Collapse.VERSION = '3.2.0' + Collapse.TRANSITION_DURATION = 350 + Collapse.DEFAULTS = { toggle: true } @@ -72,7 +74,7 @@ this.$element .one('bsTransitionEnd', $.proxy(complete, this)) - .emulateTransitionEnd(350)[dimension](this.$element[0][scrollSize]) + .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) } Collapse.prototype.hide = function () { @@ -105,7 +107,7 @@ this.$element [dimension](0) .one('bsTransitionEnd', $.proxy(complete, this)) - .emulateTransitionEnd(350) + .emulateTransitionEnd(Collapse.TRANSITION_DURATION) } Collapse.prototype.toggle = function () { diff --git a/assets/javascripts/bootstrap/modal.js b/assets/javascripts/bootstrap/modal.js index fdefdd2c..f8d53e25 100644 --- a/assets/javascripts/bootstrap/modal.js +++ b/assets/javascripts/bootstrap/modal.js @@ -32,6 +32,9 @@ Modal.VERSION = '3.2.0' + Modal.TRANSITION_DURATION = 300 + Modal.BACKDROP_TRANSITION_DURATION = 150 + Modal.DEFAULTS = { backdrop: true, keyboard: true, @@ -88,7 +91,7 @@ .one('bsTransitionEnd', function () { that.$element.trigger('focus').trigger(e) }) - .emulateTransitionEnd(300) : + .emulateTransitionEnd(Modal.TRANSITION_DURATION) : that.$element.trigger('focus').trigger(e) }) } @@ -119,7 +122,7 @@ $.support.transition && this.$element.hasClass('fade') ? this.$element .one('bsTransitionEnd', $.proxy(this.hideModal, this)) - .emulateTransitionEnd(300) : + .emulateTransitionEnd(Modal.TRANSITION_DURATION) : this.hideModal() } @@ -182,7 +185,7 @@ doAnimate ? this.$backdrop .one('bsTransitionEnd', callback) - .emulateTransitionEnd(150) : + .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : callback() } else if (!this.isShown && this.$backdrop) { @@ -195,7 +198,7 @@ $.support.transition && this.$element.hasClass('fade') ? this.$backdrop .one('bsTransitionEnd', callbackRemove) - .emulateTransitionEnd(150) : + .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : callbackRemove() } else if (callback) { diff --git a/assets/javascripts/bootstrap/tab.js b/assets/javascripts/bootstrap/tab.js index 573b369a..d7023c81 100644 --- a/assets/javascripts/bootstrap/tab.js +++ b/assets/javascripts/bootstrap/tab.js @@ -19,6 +19,8 @@ Tab.VERSION = '3.2.0' + Tab.TRANSITION_DURATION = 150 + Tab.prototype.show = function () { var $this = this.element var $ul = $this.closest('ul:not(.dropdown-menu)') @@ -82,7 +84,7 @@ $active.length && transition ? $active .one('bsTransitionEnd', next) - .emulateTransitionEnd(150) : + .emulateTransitionEnd(Tab.TRANSITION_DURATION) : next() $active.removeClass('in') diff --git a/assets/javascripts/bootstrap/tooltip.js b/assets/javascripts/bootstrap/tooltip.js index 0c3a79d0..0758b07e 100644 --- a/assets/javascripts/bootstrap/tooltip.js +++ b/assets/javascripts/bootstrap/tooltip.js @@ -27,6 +27,8 @@ Tooltip.VERSION = '3.2.0' + Tooltip.TRANSITION_DURATION = 150 + Tooltip.DEFAULTS = { animation: true, placement: 'top', @@ -207,7 +209,7 @@ $.support.transition && this.$tip.hasClass('fade') ? $tip .one('bsTransitionEnd', complete) - .emulateTransitionEnd(150) : + .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete() } } @@ -295,7 +297,7 @@ $.support.transition && this.$tip.hasClass('fade') ? $tip .one('bsTransitionEnd', complete) - .emulateTransitionEnd(150) : + .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete() this.hoverState = null diff --git a/assets/stylesheets/bootstrap/_buttons.scss b/assets/stylesheets/bootstrap/_buttons.scss index a27aa8d6..97574e48 100644 --- a/assets/stylesheets/bootstrap/_buttons.scss +++ b/assets/stylesheets/bootstrap/_buttons.scss @@ -92,6 +92,7 @@ &, &:active, + &.active, &[disabled], fieldset[disabled] & { background-color: transparent; diff --git a/assets/stylesheets/bootstrap/_carousel.scss b/assets/stylesheets/bootstrap/_carousel.scss index e9e2f7ce..fa8a8447 100644 --- a/assets/stylesheets/bootstrap/_carousel.scss +++ b/assets/stylesheets/bootstrap/_carousel.scss @@ -24,6 +24,30 @@ @include img-responsive(); line-height: 1; } + + // 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; + + &.next, + &.active.right { + transform: translate3d(100%, 0, 0); + left: 0; + } + &.prev, + &.active.left { + transform: translate3d(-100%, 0, 0); + left: 0; + } + &.next.left, + &.prev.right, + &.active { + transform: translate3d(0, 0, 0); + left: 0; + } + } } > .active, diff --git a/assets/stylesheets/bootstrap/_forms.scss b/assets/stylesheets/bootstrap/_forms.scss index 139ef528..3612a1ce 100644 --- a/assets/stylesheets/bootstrap/_forms.scss +++ b/assets/stylesheets/bootstrap/_forms.scss @@ -193,6 +193,21 @@ input[type="month"] { } } +// IE 11 hack to reverse the iOS temporal input hack. +_:-ms-fullscreen, :root input[type="date"], +_:-ms-fullscreen, :root input[type="time"], +_:-ms-fullscreen, :root input[type="datetime-local"], +_:-ms-fullscreen, :root input[type="month"] { + line-height: $line-height-base; + + &.input-sm { + line-height: $line-height-small; + } + &.input-lg { + line-height: $line-height-large; + } +} + // Form groups // diff --git a/assets/stylesheets/bootstrap/_panels.scss b/assets/stylesheets/bootstrap/_panels.scss index 6dcac463..fec08b24 100644 --- a/assets/stylesheets/bootstrap/_panels.scss +++ b/assets/stylesheets/bootstrap/_panels.scss @@ -145,7 +145,9 @@ } } > .panel-body + .table, - > .panel-body + .table-responsive { + > .panel-body + .table-responsive, + > .table + .panel-body, + > .table-responsive + .panel-body { border-top: 1px solid $table-border-color; } > .table > tbody:first-child > tr:first-child th, diff --git a/assets/stylesheets/bootstrap/_tables.scss b/assets/stylesheets/bootstrap/_tables.scss index 6d925140..8a9bee82 100644 --- a/assets/stylesheets/bootstrap/_tables.scss +++ b/assets/stylesheets/bootstrap/_tables.scss @@ -169,14 +169,14 @@ table { // will display normally. .table-responsive { + overflow-x: auto; + @media screen and (max-width: $screen-xs-max) { width: 100%; margin-bottom: ($line-height-computed * 0.75); overflow-y: hidden; - overflow-x: auto; -ms-overflow-style: -ms-autohiding-scrollbar; border: 1px solid $table-border-color; - -webkit-overflow-scrolling: touch; // Tighten up spacing > .table { diff --git a/lib/bootstrap-sass/version.rb b/lib/bootstrap-sass/version.rb index 5535cccd..9879a371 100644 --- a/lib/bootstrap-sass/version.rb +++ b/lib/bootstrap-sass/version.rb @@ -1,4 +1,4 @@ module Bootstrap VERSION = '3.2.0.1' - BOOTSTRAP_SHA = '86d698f4e4482f3f2a4cc614a3217dbf5380fa74' + BOOTSTRAP_SHA = 'a8437f0d2357368556368cbde1afecda4f0117f3' end