Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap-rubygem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorGleb Mazovetskiy <glex.spb@gmail.com>2014-11-12 18:29:47 +0300
committerGleb Mazovetskiy <glex.spb@gmail.com>2014-11-12 18:29:47 +0300
commitf0fc412cf352ccace36012c0ef72f176ba16c8a2 (patch)
treed13a551e442d4264d785dac2318454d5550ab36c /assets
parent5f1800ab526266469217ed7bcfd05bdce6eb0c92 (diff)
rake convert
Diffstat (limited to 'assets')
-rw-r--r--assets/javascripts/bootstrap.js54
-rw-r--r--assets/javascripts/bootstrap/button.js2
-rw-r--r--assets/javascripts/bootstrap/carousel.js1
-rw-r--r--assets/javascripts/bootstrap/dropdown.js2
-rw-r--r--assets/javascripts/bootstrap/modal.js49
-rw-r--r--assets/stylesheets/bootstrap/_badges.scss8
-rw-r--r--assets/stylesheets/bootstrap/_button-groups.scss4
-rw-r--r--assets/stylesheets/bootstrap/_forms.scss51
-rw-r--r--assets/stylesheets/bootstrap/_jumbotron.scss3
-rw-r--r--assets/stylesheets/bootstrap/_list-group.scss8
-rw-r--r--assets/stylesheets/bootstrap/_modals.scss3
-rw-r--r--assets/stylesheets/bootstrap/_navbar.scss1
-rw-r--r--assets/stylesheets/bootstrap/_popovers.scss1
-rw-r--r--assets/stylesheets/bootstrap/_theme.scss12
-rw-r--r--assets/stylesheets/bootstrap/_tooltip.scss16
-rw-r--r--assets/stylesheets/bootstrap/_variables.scss2
16 files changed, 154 insertions, 63 deletions
diff --git a/assets/javascripts/bootstrap.js b/assets/javascripts/bootstrap.js
index eac0ba4..5553c12 100644
--- a/assets/javascripts/bootstrap.js
+++ b/assets/javascripts/bootstrap.js
@@ -368,7 +368,7 @@
e.preventDefault()
})
.on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
- $(e.target).closest('.btn').toggleClass('focus', e.type == 'focus')
+ $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
})
}(jQuery);
@@ -417,6 +417,7 @@
}
Carousel.prototype.keydown = function (e) {
+ if (/input|textarea/i.test(e.target.tagName)) return
switch (e.which) {
case 37: this.prev(); break
case 39: this.next(); break
@@ -882,7 +883,7 @@
}
Dropdown.prototype.keydown = function (e) {
- if (!/(38|40|27|32)/.test(e.which)) return
+ if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
var $this = $(this)
@@ -1435,10 +1436,11 @@
this.isShown = true
this.checkScrollbar()
+ this.setScrollbar()
this.$body.addClass('modal-open')
- this.setScrollbar()
this.escape()
+ this.resize()
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
@@ -1453,6 +1455,9 @@
.show()
.scrollTop(0)
+ if (that.options.backdrop) that.adjustBackdrop()
+ that.adjustDialog()
+
if (transition) {
that.$element[0].offsetWidth // force reflow
}
@@ -1487,6 +1492,7 @@
this.isShown = false
this.escape()
+ this.resize()
$(document).off('focusin.bs.modal')
@@ -1522,11 +1528,20 @@
}
}
+ Modal.prototype.resize = function () {
+ if (this.isShown) {
+ $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
+ } else {
+ $(window).off('resize.bs.modal')
+ }
+ }
+
Modal.prototype.hideModal = function () {
var that = this
this.$element.hide()
this.backdrop(function () {
that.$body.removeClass('modal-open')
+ that.resetAdjustments()
that.resetScrollbar()
that.$element.trigger('hidden.bs.modal')
})
@@ -1583,13 +1598,43 @@
}
}
+ // these following methods are used to handle overflowing modals
+
+ Modal.prototype.handleUpdate = function () {
+ if (this.options.backdrop) this.adjustBackdrop()
+ this.adjustDialog()
+ }
+
+ Modal.prototype.adjustBackdrop = function () {
+ this.$backdrop
+ .css('height', 0)
+ .css('height', this.$element[0].scrollHeight)
+ }
+
+ Modal.prototype.adjustDialog = function () {
+ var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
+
+ this.$element.css({
+ paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
+ paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
+ })
+ }
+
+ Modal.prototype.resetAdjustments = function () {
+ this.$element.css({
+ paddingLeft: '',
+ paddingRight: ''
+ })
+ }
+
Modal.prototype.checkScrollbar = function () {
+ this.bodyIsOverflowing = document.body.scrollHeight > document.documentElement.clientHeight
this.scrollbarWidth = this.measureScrollbar()
}
Modal.prototype.setScrollbar = function () {
var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
- if (this.scrollbarWidth) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
+ if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
}
Modal.prototype.resetScrollbar = function () {
@@ -1597,7 +1642,6 @@
}
Modal.prototype.measureScrollbar = function () { // thx walsh
- if (document.body.clientWidth >= window.innerWidth) return 0
var scrollDiv = document.createElement('div')
scrollDiv.className = 'modal-scrollbar-measure'
this.$body.append(scrollDiv)
diff --git a/assets/javascripts/bootstrap/button.js b/assets/javascripts/bootstrap/button.js
index 2be0234..4038294 100644
--- a/assets/javascripts/bootstrap/button.js
+++ b/assets/javascripts/bootstrap/button.js
@@ -110,7 +110,7 @@
e.preventDefault()
})
.on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
- $(e.target).closest('.btn').toggleClass('focus', e.type == 'focus')
+ $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
})
}(jQuery);
diff --git a/assets/javascripts/bootstrap/carousel.js b/assets/javascripts/bootstrap/carousel.js
index 4e4e477..82106d2 100644
--- a/assets/javascripts/bootstrap/carousel.js
+++ b/assets/javascripts/bootstrap/carousel.js
@@ -42,6 +42,7 @@
}
Carousel.prototype.keydown = function (e) {
+ if (/input|textarea/i.test(e.target.tagName)) return
switch (e.which) {
case 37: this.prev(); break
case 39: this.next(); break
diff --git a/assets/javascripts/bootstrap/dropdown.js b/assets/javascripts/bootstrap/dropdown.js
index ae192e5..64ec34d 100644
--- a/assets/javascripts/bootstrap/dropdown.js
+++ b/assets/javascripts/bootstrap/dropdown.js
@@ -55,7 +55,7 @@
}
Dropdown.prototype.keydown = function (e) {
- if (!/(38|40|27|32)/.test(e.which)) return
+ if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
var $this = $(this)
diff --git a/assets/javascripts/bootstrap/modal.js b/assets/javascripts/bootstrap/modal.js
index 8b0e269..ed3f029 100644
--- a/assets/javascripts/bootstrap/modal.js
+++ b/assets/javascripts/bootstrap/modal.js
@@ -56,10 +56,11 @@
this.isShown = true
this.checkScrollbar()
+ this.setScrollbar()
this.$body.addClass('modal-open')
- this.setScrollbar()
this.escape()
+ this.resize()
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
@@ -74,6 +75,9 @@
.show()
.scrollTop(0)
+ if (that.options.backdrop) that.adjustBackdrop()
+ that.adjustDialog()
+
if (transition) {
that.$element[0].offsetWidth // force reflow
}
@@ -108,6 +112,7 @@
this.isShown = false
this.escape()
+ this.resize()
$(document).off('focusin.bs.modal')
@@ -143,11 +148,20 @@
}
}
+ Modal.prototype.resize = function () {
+ if (this.isShown) {
+ $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
+ } else {
+ $(window).off('resize.bs.modal')
+ }
+ }
+
Modal.prototype.hideModal = function () {
var that = this
this.$element.hide()
this.backdrop(function () {
that.$body.removeClass('modal-open')
+ that.resetAdjustments()
that.resetScrollbar()
that.$element.trigger('hidden.bs.modal')
})
@@ -204,13 +218,43 @@
}
}
+ // these following methods are used to handle overflowing modals
+
+ Modal.prototype.handleUpdate = function () {
+ if (this.options.backdrop) this.adjustBackdrop()
+ this.adjustDialog()
+ }
+
+ Modal.prototype.adjustBackdrop = function () {
+ this.$backdrop
+ .css('height', 0)
+ .css('height', this.$element[0].scrollHeight)
+ }
+
+ Modal.prototype.adjustDialog = function () {
+ var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight
+
+ this.$element.css({
+ paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
+ paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
+ })
+ }
+
+ Modal.prototype.resetAdjustments = function () {
+ this.$element.css({
+ paddingLeft: '',
+ paddingRight: ''
+ })
+ }
+
Modal.prototype.checkScrollbar = function () {
+ this.bodyIsOverflowing = document.body.scrollHeight > document.documentElement.clientHeight
this.scrollbarWidth = this.measureScrollbar()
}
Modal.prototype.setScrollbar = function () {
var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
- if (this.scrollbarWidth) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
+ if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
}
Modal.prototype.resetScrollbar = function () {
@@ -218,7 +262,6 @@
}
Modal.prototype.measureScrollbar = function () { // thx walsh
- if (document.body.clientWidth >= window.innerWidth) return 0
var scrollDiv = document.createElement('div')
scrollDiv.className = 'modal-scrollbar-measure'
this.$body.append(scrollDiv)
diff --git a/assets/stylesheets/bootstrap/_badges.scss b/assets/stylesheets/bootstrap/_badges.scss
index 02394ae..c913f14 100644
--- a/assets/stylesheets/bootstrap/_badges.scss
+++ b/assets/stylesheets/bootstrap/_badges.scss
@@ -36,11 +36,17 @@
// [converter] extracted a& to a.badge
// Account for badges in navs
- a.list-group-item.active > &,
+ .list-group-item.active > &,
.nav-pills > .active > a > & {
color: $badge-active-color;
background-color: $badge-active-bg;
}
+ .list-group-item > & {
+ float: right;
+ }
+ .list-group-item > & + & {
+ margin-right: 5px;
+ }
.nav-pills > li > a > & {
margin-left: 3px;
}
diff --git a/assets/stylesheets/bootstrap/_button-groups.scss b/assets/stylesheets/bootstrap/_button-groups.scss
index 9bfa085..e761daa 100644
--- a/assets/stylesheets/bootstrap/_button-groups.scss
+++ b/assets/stylesheets/bootstrap/_button-groups.scss
@@ -18,10 +18,6 @@
&.active {
z-index: 2;
}
- &:focus {
- // Remove focus outline when dropdown JS adds it after closing the menu
- outline: 0;
- }
}
}
diff --git a/assets/stylesheets/bootstrap/_forms.scss b/assets/stylesheets/bootstrap/_forms.scss
index 4e694b3..439657c 100644
--- a/assets/stylesheets/bootstrap/_forms.scss
+++ b/assets/stylesheets/bootstrap/_forms.scss
@@ -170,41 +170,28 @@ input[type="search"] {
// Special styles for iOS temporal inputs
//
// In Mobile Safari, setting `display: block` on temporal inputs causes the
-// text within the input to become vertically misaligned.
-// As a workaround, we set a pixel line-height that matches the
-// given height of the input. Since this fucks up everything else, we have to
-// appropriately reset it for Internet Explorer and the size variations.
-
-input[type="date"],
-input[type="time"],
-input[type="datetime-local"],
-input[type="month"] {
- line-height: $input-height-base;
- // IE8+ misaligns the text within date inputs, so we reset
- line-height: $line-height-base #{\0};
-
- &.input-sm {
+// text within the input to become vertically misaligned. As a workaround, we
+// set a pixel line-height that matches the given height of the input, but only
+// for Safari.
+
+@media screen and (-webkit-min-device-pixel-ratio: 0) {
+ input[type="date"],
+ input[type="time"],
+ input[type="datetime-local"],
+ input[type="month"] {
+ line-height: $input-height-base;
+ }
+ input[type="date"].input-sm,
+ input[type="time"].input-sm,
+ input[type="datetime-local"].input-sm,
+ input[type="month"].input-sm {
line-height: $input-height-small;
- line-height: $line-height-small #{\0};
}
- &.input-lg {
+ input[type="date"].input-lg,
+ input[type="time"].input-lg,
+ input[type="datetime-local"].input-lg,
+ input[type="month"].input-lg {
line-height: $input-height-large;
- line-height: $line-height-large #{\0};
- }
-}
-
-// 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;
}
}
diff --git a/assets/stylesheets/bootstrap/_jumbotron.scss b/assets/stylesheets/bootstrap/_jumbotron.scss
index f386213..ed4c6c9 100644
--- a/assets/stylesheets/bootstrap/_jumbotron.scss
+++ b/assets/stylesheets/bootstrap/_jumbotron.scss
@@ -35,7 +35,8 @@
@media screen and (min-width: $screen-sm-min) {
padding: ($jumbotron-padding * 1.6) 0;
- .container & {
+ .container &,
+ .container-fluid & {
padding-left: ($jumbotron-padding * 2);
padding-right: ($jumbotron-padding * 2);
}
diff --git a/assets/stylesheets/bootstrap/_list-group.scss b/assets/stylesheets/bootstrap/_list-group.scss
index 14912b1..26b23ff 100644
--- a/assets/stylesheets/bootstrap/_list-group.scss
+++ b/assets/stylesheets/bootstrap/_list-group.scss
@@ -35,14 +35,6 @@
margin-bottom: 0;
@include border-bottom-radius($list-group-border-radius);
}
-
- // Align badges within list items
- > .badge {
- float: right;
- }
- > .badge + .badge {
- margin-right: 5px;
- }
}
diff --git a/assets/stylesheets/bootstrap/_modals.scss b/assets/stylesheets/bootstrap/_modals.scss
index fea4f36..2fd097c 100644
--- a/assets/stylesheets/bootstrap/_modals.scss
+++ b/assets/stylesheets/bootstrap/_modals.scss
@@ -62,10 +62,9 @@
// Modal background
.modal-backdrop {
- position: fixed;
+ position: absolute;
top: 0;
right: 0;
- bottom: 0;
left: 0;
background-color: $modal-backdrop-bg;
// Fade for backdrop
diff --git a/assets/stylesheets/bootstrap/_navbar.scss b/assets/stylesheets/bootstrap/_navbar.scss
index 8737ad3..73b8587 100644
--- a/assets/stylesheets/bootstrap/_navbar.scss
+++ b/assets/stylesheets/bootstrap/_navbar.scss
@@ -331,6 +331,7 @@
}
// Menu position and menu caret support for dropups via extra dropup class
.navbar-fixed-bottom .navbar-nav > li > .dropdown-menu {
+ @include border-top-radius($navbar-border-radius);
@include border-bottom-radius(0);
}
diff --git a/assets/stylesheets/bootstrap/_popovers.scss b/assets/stylesheets/bootstrap/_popovers.scss
index 9e28c3c..46c45f5 100644
--- a/assets/stylesheets/bootstrap/_popovers.scss
+++ b/assets/stylesheets/bootstrap/_popovers.scss
@@ -12,6 +12,7 @@
max-width: $popover-max-width;
padding: 1px;
// Reset font and text propertes given new insertion method
+ font-family: $font-family-base;
font-size: $font-size-base;
font-weight: normal;
line-height: $line-height-base;
diff --git a/assets/stylesheets/bootstrap/_theme.scss b/assets/stylesheets/bootstrap/_theme.scss
index 05eb32a..51534fe 100644
--- a/assets/stylesheets/bootstrap/_theme.scss
+++ b/assets/stylesheets/bootstrap/_theme.scss
@@ -151,6 +151,18 @@
border-radius: 0;
}
+// Fix active state of dropdown items in collapsed mode
+@media (max-width: $grid-float-breakpoint-max) {
+ .navbar .navbar-nav .open .dropdown-menu > .active > a {
+ &,
+ &:hover,
+ &:focus {
+ color: #fff;
+ @include gradient-vertical($start-color: $dropdown-link-active-bg, $end-color: darken($dropdown-link-active-bg, 5%));
+ }
+ }
+}
+
//
// Alerts
diff --git a/assets/stylesheets/bootstrap/_tooltip.scss b/assets/stylesheets/bootstrap/_tooltip.scss
index dec674c..c6e4328 100644
--- a/assets/stylesheets/bootstrap/_tooltip.scss
+++ b/assets/stylesheets/bootstrap/_tooltip.scss
@@ -9,7 +9,10 @@
z-index: $zindex-tooltip;
display: block;
visibility: visible;
+ // Reset font and text propertes given new insertion method
+ font-family: $font-family-base;
font-size: $font-size-small;
+ font-weight: normal;
line-height: 1.4;
@include opacity(0);
@@ -39,6 +42,7 @@
border-color: transparent;
border-style: solid;
}
+// Note: Deprecated .top-left, .top-right, .bottom-left, and .bottom-right as of v3.3.1
.tooltip {
&.top .tooltip-arrow {
bottom: 0;
@@ -49,13 +53,15 @@
}
&.top-left .tooltip-arrow {
bottom: 0;
- left: $tooltip-arrow-width;
+ right: $tooltip-arrow-width;
+ margin-bottom: -$tooltip-arrow-width;
border-width: $tooltip-arrow-width $tooltip-arrow-width 0;
border-top-color: $tooltip-arrow-color;
}
&.top-right .tooltip-arrow {
bottom: 0;
- right: $tooltip-arrow-width;
+ left: $tooltip-arrow-width;
+ margin-bottom: -$tooltip-arrow-width;
border-width: $tooltip-arrow-width $tooltip-arrow-width 0;
border-top-color: $tooltip-arrow-color;
}
@@ -82,13 +88,15 @@
}
&.bottom-left .tooltip-arrow {
top: 0;
- left: $tooltip-arrow-width;
+ right: $tooltip-arrow-width;
+ margin-top: -$tooltip-arrow-width;
border-width: 0 $tooltip-arrow-width $tooltip-arrow-width;
border-bottom-color: $tooltip-arrow-color;
}
&.bottom-right .tooltip-arrow {
top: 0;
- right: $tooltip-arrow-width;
+ left: $tooltip-arrow-width;
+ margin-top: -$tooltip-arrow-width;
border-width: 0 $tooltip-arrow-width $tooltip-arrow-width;
border-bottom-color: $tooltip-arrow-color;
}
diff --git a/assets/stylesheets/bootstrap/_variables.scss b/assets/stylesheets/bootstrap/_variables.scss
index b4fba43..7d190f2 100644
--- a/assets/stylesheets/bootstrap/_variables.scss
+++ b/assets/stylesheets/bootstrap/_variables.scss
@@ -19,7 +19,7 @@ $gray: lighten($gray-base, 33.5%) !default; // #555
$gray-light: lighten($gray-base, 46.7%) !default; // #777
$gray-lighter: lighten($gray-base, 93.5%) !default; // #eee
-$brand-primary: #428bca !default;
+$brand-primary: darken(#428bca, 6.5%) !default;
$brand-success: #5cb85c !default;
$brand-info: #5bc0de !default;
$brand-warning: #f0ad4e !default;