From 8e56145e45e9d58e23c5f339b6cac50e751e36a7 Mon Sep 17 00:00:00 2001 From: Andres Galante Date: Mon, 11 Sep 2017 00:53:40 -0300 Subject: [PATCH 01/66] changes active state color --- scss/mixins/_buttons.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scss/mixins/_buttons.scss b/scss/mixins/_buttons.scss index 44ce4f72e2..03305de65b 100644 --- a/scss/mixins/_buttons.scss +++ b/scss/mixins/_buttons.scss @@ -3,16 +3,16 @@ // Easily pump out default styles, as well as :hover, :focus, :active, // and disabled options for all buttons -@mixin button-variant($background, $border, $active-background: darken($background, 7.5%), $active-border: darken($border, 10%)) { +@mixin button-variant($background, $border, $hover-background: darken($background, 7.5%), $hover-border: darken($border, 10%), $active-background: darken($background, 12.5%), $active-border: darken($border, 15%)) { @include color-yiq($background); background-color: $background; border-color: $border; @include box-shadow($btn-box-shadow); @include hover { - @include color-yiq($active-background); - background-color: $active-background; - border-color: $active-border; + @include color-yiq($hover-background); + background-color: $hover-background; + border-color: $hover-border; } &:focus, From cc092272eefa0e89bebfc716c8df8214d2804c77 Mon Sep 17 00:00:00 2001 From: gijsbotje Date: Wed, 13 Sep 2017 17:32:44 +0200 Subject: [PATCH 02/66] modified the yiq to to an actual function function only returns a value, not the attribute itself updated every use of the former mixin to use the new function --- assets/scss/_colors.scss | 6 +++--- scss/_functions.scss | 6 +++--- scss/mixins/_badge.scss | 4 ++-- scss/mixins/_buttons.scss | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/assets/scss/_colors.scss b/assets/scss/_colors.scss index d09d3a2c57..8d2825c570 100644 --- a/assets/scss/_colors.scss +++ b/assets/scss/_colors.scss @@ -4,21 +4,21 @@ @each $color, $value in $colors { .swatch-#{$color} { + color: color-yiq($value); background-color: #{$value}; - @include color-yiq($value); } } @each $color, $value in $theme-colors { .swatch-#{$color} { + color: color-yiq($value); background-color: #{$value}; - @include color-yiq($value); } } @each $color, $value in $grays { .swatch-#{$color} { + color: color-yiq($value); background-color: #{$value}; - @include color-yiq($value); } } diff --git a/scss/_functions.scss b/scss/_functions.scss index a63680aa5c..bbb015d07e 100644 --- a/scss/_functions.scss +++ b/scss/_functions.scss @@ -49,7 +49,7 @@ } // Color contrast -@mixin color-yiq($color) { +@function color-yiq($color) { $r: red($color); $g: green($color); $b: blue($color); @@ -57,9 +57,9 @@ $yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000; @if ($yiq >= 150) { - color: #111; + @return #111; } @else { - color: #fff; + @return #fff; } } diff --git a/scss/mixins/_badge.scss b/scss/mixins/_badge.scss index 257a6abb7d..c1caafe487 100644 --- a/scss/mixins/_badge.scss +++ b/scss/mixins/_badge.scss @@ -1,11 +1,11 @@ @mixin badge-variant($bg) { - @include color-yiq($bg); + color: color-yiq($bg); background-color: $bg; &[href] { @include hover-focus { - @include color-yiq($bg); text-decoration: none; + color: color-yiq($bg); background-color: darken($bg, 10%); } } diff --git a/scss/mixins/_buttons.scss b/scss/mixins/_buttons.scss index 44ce4f72e2..ef623ccd55 100644 --- a/scss/mixins/_buttons.scss +++ b/scss/mixins/_buttons.scss @@ -4,13 +4,13 @@ // and disabled options for all buttons @mixin button-variant($background, $border, $active-background: darken($background, 7.5%), $active-border: darken($border, 10%)) { - @include color-yiq($background); + color: color-yiq($background); background-color: $background; border-color: $border; @include box-shadow($btn-box-shadow); @include hover { - @include color-yiq($active-background); + color: color-yiq($active-background); background-color: $active-background; border-color: $active-border; } From a77c13c403fdb6a5c2552f44c089cbb10fc279a6 Mon Sep 17 00:00:00 2001 From: Gijs Boddeus Date: Wed, 4 Oct 2017 08:51:24 +0200 Subject: [PATCH 03/66] change order off properties in _colors.scss --- assets/scss/_colors.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/scss/_colors.scss b/assets/scss/_colors.scss index 8d2825c570..5b6f5f52b4 100644 --- a/assets/scss/_colors.scss +++ b/assets/scss/_colors.scss @@ -4,21 +4,21 @@ @each $color, $value in $colors { .swatch-#{$color} { - color: color-yiq($value); background-color: #{$value}; + color: color-yiq($value); } } @each $color, $value in $theme-colors { .swatch-#{$color} { - color: color-yiq($value); background-color: #{$value}; + color: color-yiq($value); } } @each $color, $value in $grays { .swatch-#{$color} { - color: color-yiq($value); background-color: #{$value}; + color: color-yiq($value); } } From 1db5082c3ff9fad8ab9d154f2244fb3d592f382d Mon Sep 17 00:00:00 2001 From: Gijs Boddeus Date: Wed, 4 Oct 2017 08:52:48 +0200 Subject: [PATCH 04/66] rearrange properties in _borders.scss mixins --- scss/mixins/_buttons.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scss/mixins/_buttons.scss b/scss/mixins/_buttons.scss index ef623ccd55..49d8d18be9 100644 --- a/scss/mixins/_buttons.scss +++ b/scss/mixins/_buttons.scss @@ -4,15 +4,15 @@ // and disabled options for all buttons @mixin button-variant($background, $border, $active-background: darken($background, 7.5%), $active-border: darken($border, 10%)) { - color: color-yiq($background); background-color: $background; border-color: $border; + color: color-yiq($background); @include box-shadow($btn-box-shadow); @include hover { - color: color-yiq($active-background); background-color: $active-background; border-color: $active-border; + color: color-yiq($active-background); } &:focus, From 48676f0e2b481b99cebc8ec35bd8d4943db5601a Mon Sep 17 00:00:00 2001 From: Gijs Boddeus Date: Wed, 4 Oct 2017 10:55:48 +0200 Subject: [PATCH 05/66] revert a77c13c --- assets/scss/_colors.scss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/scss/_colors.scss b/assets/scss/_colors.scss index 5b6f5f52b4..8d2825c570 100644 --- a/assets/scss/_colors.scss +++ b/assets/scss/_colors.scss @@ -4,21 +4,21 @@ @each $color, $value in $colors { .swatch-#{$color} { - background-color: #{$value}; color: color-yiq($value); + background-color: #{$value}; } } @each $color, $value in $theme-colors { .swatch-#{$color} { - background-color: #{$value}; color: color-yiq($value); + background-color: #{$value}; } } @each $color, $value in $grays { .swatch-#{$color} { - background-color: #{$value}; color: color-yiq($value); + background-color: #{$value}; } } From df6a8f7d813a5327f999ebcbed7c7015ad4dd80a Mon Sep 17 00:00:00 2001 From: Gijs Boddeus Date: Wed, 4 Oct 2017 10:57:02 +0200 Subject: [PATCH 06/66] revert 1db5082 --- scss/mixins/_buttons.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scss/mixins/_buttons.scss b/scss/mixins/_buttons.scss index 49d8d18be9..ef623ccd55 100644 --- a/scss/mixins/_buttons.scss +++ b/scss/mixins/_buttons.scss @@ -4,15 +4,15 @@ // and disabled options for all buttons @mixin button-variant($background, $border, $active-background: darken($background, 7.5%), $active-border: darken($border, 10%)) { + color: color-yiq($background); background-color: $background; border-color: $border; - color: color-yiq($background); @include box-shadow($btn-box-shadow); @include hover { + color: color-yiq($active-background); background-color: $active-background; border-color: $active-border; - color: color-yiq($active-background); } &:focus, From cefc68d464ab173b42f5c09c968ac49dfed08aa1 Mon Sep 17 00:00:00 2001 From: Gijs Boddeus Date: Wed, 4 Oct 2017 11:29:38 +0200 Subject: [PATCH 07/66] fix travis error --- scss/mixins/_badge.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scss/mixins/_badge.scss b/scss/mixins/_badge.scss index c1caafe487..eeca0b40de 100644 --- a/scss/mixins/_badge.scss +++ b/scss/mixins/_badge.scss @@ -4,8 +4,8 @@ &[href] { @include hover-focus { - text-decoration: none; color: color-yiq($bg); + text-decoration: none; background-color: darken($bg, 10%); } } From 99eece13929cf69515927a04a176cc3e578c4194 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Mon, 16 Oct 2017 16:51:42 +0200 Subject: [PATCH 08/66] Add dispose methods in our documentation (#24396) * Add dispose methods in our documentation * Update buttons.md --- docs/4.0/components/alerts.md | 1 + docs/4.0/components/buttons.md | 3 ++- docs/4.0/components/carousel.md | 4 ++++ docs/4.0/components/collapse.md | 4 ++++ docs/4.0/components/dropdowns.md | 1 + docs/4.0/components/modal.md | 4 ++++ docs/4.0/components/navs.md | 4 ++++ docs/4.0/components/scrollspy.md | 3 +++ 8 files changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/4.0/components/alerts.md b/docs/4.0/components/alerts.md index b8bb0c2168..4fdaed41b2 100644 --- a/docs/4.0/components/alerts.md +++ b/docs/4.0/components/alerts.md @@ -92,6 +92,7 @@ Note that closing an alert will remove it from the DOM. | --- | --- | | `$().alert()` | Makes an alert listen for click events on descendant elements which have the `data-dismiss="alert"` attribute. (Not necessary when using the data-api's auto-initialization.) | | `$().alert('close')` | Closes an alert by removing it from the DOM. If the `.fade` and `.show` classes are present on the element, the alert will fade out before it is removed. | +| `$().alert('dispose')` | Destroys an element's alert. | {% highlight js %}$(".alert").alert('close'){% endhighlight %} diff --git a/docs/4.0/components/buttons.md b/docs/4.0/components/buttons.md index fac603e7e1..41ca9cef07 100644 --- a/docs/4.0/components/buttons.md +++ b/docs/4.0/components/buttons.md @@ -154,4 +154,5 @@ Note that pre-checked buttons require you to manually add the `.active` class to | Method | Description | | --- | --- | -| `$().button('toggle')` |Toggles push state. Gives the button the appearance that it has been activated. | +| `$().button('toggle')` | Toggles push state. Gives the button the appearance that it has been activated. | +| `$().button('dispose')` | Destroys an element's button. | diff --git a/docs/4.0/components/carousel.md b/docs/4.0/components/carousel.md index 4919e1ac28..ac6299f6f8 100644 --- a/docs/4.0/components/carousel.md +++ b/docs/4.0/components/carousel.md @@ -263,6 +263,10 @@ Cycles to the previous item. **Returns to the caller before the previous item ha Cycles to the next item. **Returns to the caller before the next item has been shown** (i.e. before the `slid.bs.carousel` event occurs). +### `.carousel('dispose')` + +Destroys an element's carousel. + ### Events Bootstrap's carousel class exposes two events for hooking into carousel functionality. Both events have the following additional properties: diff --git a/docs/4.0/components/collapse.md b/docs/4.0/components/collapse.md index a34ffeb7ba..cd0a7d4e5f 100644 --- a/docs/4.0/components/collapse.md +++ b/docs/4.0/components/collapse.md @@ -226,6 +226,10 @@ Shows a collapsible element. **Returns to the caller before the collapsible elem Hides a collapsible element. **Returns to the caller before the collapsible element has actually been hidden** (i.e. before the `hidden.bs.collapse` event occurs). +### `.collapse('dispose')` + +Destroys an element's collapse. + ### Events Bootstrap's collapse class exposes a few events for hooking into collapse functionality. diff --git a/docs/4.0/components/dropdowns.md b/docs/4.0/components/dropdowns.md index d38b410c78..2c467166e5 100644 --- a/docs/4.0/components/dropdowns.md +++ b/docs/4.0/components/dropdowns.md @@ -607,6 +607,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap | --- | --- | | `$().dropdown('toggle')` | Toggles the dropdown menu of a given navbar or tabbed navigation. | | `$().dropdown('update')` | Updates the position of an element's dropdown. | +| `$().dropdown('dispose')` | Destroys an element's dropdown. | ### Events diff --git a/docs/4.0/components/modal.md b/docs/4.0/components/modal.md index 491bd3fb8f..3586f461ca 100644 --- a/docs/4.0/components/modal.md +++ b/docs/4.0/components/modal.md @@ -575,6 +575,10 @@ Manually readjust the modal's position if the height of a modal changes while it {% highlight js %}$('#myModal').modal('handleUpdate'){% endhighlight %} +### `.modal('dispose')` + +Destroys an element's modal. + ### Events Bootstrap's modal class exposes a few events for hooking into modal functionality. All modal events are fired at the modal itself (i.e. at the `