2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-20 20:00:36 +03:00

Merge branch 'v4-dev' of https://github.com/twbs/bootstrap into v4-dev

This commit is contained in:
Mark Otto
2017-06-17 19:03:25 -07:00
39 changed files with 335 additions and 304 deletions
+1
View File
@@ -153,6 +153,7 @@ linters:
- align-items - align-items
- align-self - align-self
- justify-content - justify-content
- order
- float - float
- width - width
- min-width - min-width
+4 -4
View File
@@ -1,5 +1,5 @@
<header class="navbar navbar-inverse navbar-expand-md flex-column flex-md-row bd-navbar"> <header class="navbar navbar-inverse navbar-expand-md flex-column flex-md-row bd-navbar">
<a class="navbar-brand mr-0 mr-md-2" href="{{ site.baseurl }}/"> <a class="navbar-brand mr-0 mr-md-2" href="{{ site.baseurl }}/" aria-label="Bootstrap">
{% include icons/bootstrap.svg width="36" height="36" class="d-block" %} {% include icons/bootstrap.svg width="36" height="36" class="d-block" %}
</a> </a>
@@ -43,17 +43,17 @@
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link p-2" href="{{ site.repo }}" target="_blank"> <a class="nav-link p-2" href="{{ site.repo }}" target="_blank" aria-label="GitHub">
{% include icons/github.svg class="navbar-nav-svg" %} {% include icons/github.svg class="navbar-nav-svg" %}
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link p-2" href="https://twitter.com/{{ site.twitter }}" target="_blank"> <a class="nav-link p-2" href="https://twitter.com/{{ site.twitter }}" target="_blank" aria-label="Twitter">
{% include icons/twitter.svg class="navbar-nav-svg" %} {% include icons/twitter.svg class="navbar-nav-svg" %}
</a> </a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link p-2" href="{{ site.slack }}" target="_blank"> <a class="nav-link p-2" href="{{ site.slack }}" target="_blank" aria-label="Slack">
{% include icons/slack.svg class="navbar-nav-svg" %} {% include icons/slack.svg class="navbar-nav-svg" %}
</a> </a>
</li> </li>
+1 -1
View File
@@ -1 +1 @@
<svg {% if include.class %} class="{{ include.class }}"{% endif %}{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %} viewbox="0 0 612 612" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor" d="M510 8a94.3 94.3 0 0 1 94 94v408a94.3 94.3 0 0 1-94 94H102a94.3 94.3 0 0 1-94-94V102a94.3 94.3 0 0 1 94-94h408m0-8H102C45.9 0 0 45.9 0 102v408c0 56.1 45.9 102 102 102h408c56.1 0 102-45.9 102-102V102C612 45.9 566.1 0 510 0z"/><path fill="currentColor" d="M196.77 471.5V154.43h124.15c54.27 0 91 31.64 91 79.1 0 33-24.17 63.72-54.71 69.21v1.76c43.07 5.49 70.75 35.82 70.75 78 0 55.81-40 89-107.45 89zm39.55-180.4h63.28c46.8 0 72.29-18.68 72.29-53 0-31.42-21.53-48.78-60-48.78h-75.57zm78.22 145.46c47.68 0 72.73-19.34 72.73-56s-25.93-55.37-76.46-55.37h-74.49v111.4z"/></svg> <svg {% if include.class %} class="{{ include.class }}"{% endif %}{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %} viewbox="0 0 612 612" xmlns="http://www.w3.org/2000/svg" focusable="false"><title>Bootstrap</title><path fill="currentColor" d="M510 8a94.3 94.3 0 0 1 94 94v408a94.3 94.3 0 0 1-94 94H102a94.3 94.3 0 0 1-94-94V102a94.3 94.3 0 0 1 94-94h408m0-8H102C45.9 0 0 45.9 0 102v408c0 56.1 45.9 102 102 102h408c56.1 0 102-45.9 102-102V102C612 45.9 566.1 0 510 0z"/><path fill="currentColor" d="M196.77 471.5V154.43h124.15c54.27 0 91 31.64 91 79.1 0 33-24.17 63.72-54.71 69.21v1.76c43.07 5.49 70.75 35.82 70.75 78 0 55.81-40 89-107.45 89zm39.55-180.4h63.28c46.8 0 72.29-18.68 72.29-53 0-31.42-21.53-48.78-60-48.78h-75.57zm78.22 145.46c47.68 0 72.73-19.34 72.73-56s-25.93-55.37-76.46-55.37h-74.49v111.4z"/></svg>

Before

Width:  |  Height:  |  Size: 849 B

After

Width:  |  Height:  |  Size: 891 B

+1 -1
View File
@@ -1 +1 @@
<svg{% if include.class %} class="{{ include.class }}"{% endif %} xmlns="http://www.w3.org/2000/svg" viewbox="0 0 512 499.36"{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %}><title>GitHub</title><path d="M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z" fill="currentColor" fill-rule="evenodd"/></svg> <svg{% if include.class %} class="{{ include.class }}"{% endif %} xmlns="http://www.w3.org/2000/svg" viewbox="0 0 512 499.36"{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %} focusable="false"><title>GitHub</title><path d="M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z" fill="currentColor" fill-rule="evenodd"/></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

+1 -1
View File
@@ -1 +1 @@
<svg{% if include.class %} class="{{ include.class }}"{% endif %} xmlns="http://www.w3.org/2000/svg" viewbox="0 0 30 30"{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %}><path stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" d="M4 7h22M4 15h22M4 23h22"/></svg> <svg{% if include.class %} class="{{ include.class }}"{% endif %} xmlns="http://www.w3.org/2000/svg" viewbox="0 0 30 30"{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %} focusable="false"><title>Menu</title><path stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" d="M4 7h22M4 15h22M4 23h22"/></svg>

Before

Width:  |  Height:  |  Size: 373 B

After

Width:  |  Height:  |  Size: 410 B

+1 -1
View File
@@ -1 +1 @@
<svg{% if include.class %} class="{{ include.class }}"{% endif %} xmlns="http://www.w3.org/2000/svg" viewbox="0 0 512 512"{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %}><title>Slack</title><path fill="currentColor" d="M210.787 234.832l68.31-22.883 22.1 65.977-68.309 22.882z"/><path d="M490.54 185.6C437.7 9.59 361.6-31.34 185.6 21.46S-31.3 150.4 21.46 326.4 150.4 543.3 326.4 490.54 543.34 361.6 490.54 185.6zM401.7 299.8l-33.15 11.05 11.46 34.38c4.5 13.92-2.87 29.06-16.78 33.56-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18l-11.46-34.38-68.36 22.92 11.46 34.38c4.5 13.92-2.87 29.06-16.78 33.56-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18l-11.46-34.43-33.15 11.05c-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18c-4.5-13.92 2.87-29.06 16.78-33.56l33.12-11.03-22.1-65.9-33.15 11.05c-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18c-4.48-13.93 2.89-29.07 16.81-33.58l33.15-11.05-11.46-34.38c-4.5-13.92 2.87-29.06 16.78-33.56s29.06 2.87 33.56 16.78l11.46 34.38 68.36-22.92-11.46-34.38c-4.5-13.92 2.87-29.06 16.78-33.56s29.06 2.87 33.56 16.78l11.47 34.42 33.15-11.05c13.92-4.5 29.06 2.87 33.56 16.78s-2.87 29.06-16.78 33.56L329.7 194.6l22.1 65.9 33.15-11.05c13.92-4.5 29.06 2.87 33.56 16.78s-2.88 29.07-16.81 33.57z" fill="currentColor"/></svg> <svg{% if include.class %} class="{{ include.class }}"{% endif %} xmlns="http://www.w3.org/2000/svg" viewbox="0 0 512 512"{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %} focusable="false"><title>Slack</title><path fill="currentColor" d="M210.787 234.832l68.31-22.883 22.1 65.977-68.309 22.882z"/><path d="M490.54 185.6C437.7 9.59 361.6-31.34 185.6 21.46S-31.3 150.4 21.46 326.4 150.4 543.3 326.4 490.54 543.34 361.6 490.54 185.6zM401.7 299.8l-33.15 11.05 11.46 34.38c4.5 13.92-2.87 29.06-16.78 33.56-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18l-11.46-34.38-68.36 22.92 11.46 34.38c4.5 13.92-2.87 29.06-16.78 33.56-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18l-11.46-34.43-33.15 11.05c-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18c-4.5-13.92 2.87-29.06 16.78-33.56l33.12-11.03-22.1-65.9-33.15 11.05c-2.87.82-6.14 1.64-9 1.23a27.32 27.32 0 0 1-24.56-18c-4.48-13.93 2.89-29.07 16.81-33.58l33.15-11.05-11.46-34.38c-4.5-13.92 2.87-29.06 16.78-33.56s29.06 2.87 33.56 16.78l11.46 34.38 68.36-22.92-11.46-34.38c-4.5-13.92 2.87-29.06 16.78-33.56s29.06 2.87 33.56 16.78l11.47 34.42 33.15-11.05c13.92-4.5 29.06 2.87 33.56 16.78s-2.87 29.06-16.78 33.56L329.7 194.6l22.1 65.9 33.15-11.05c13.92-4.5 29.06 2.87 33.56 16.78s-2.88 29.07-16.81 33.57z" fill="currentColor"/></svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

+1 -1
View File
@@ -1 +1 @@
<svg{% if include.class %} class="{{ include.class }}"{% endif %} xmlns="http://www.w3.org/2000/svg" viewbox="0 0 512 416.32"{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %}><title>Twitter</title><path d="M160.83 416.32c193.2 0 298.92-160.22 298.92-298.92 0-4.51 0-9-.2-13.52A214 214 0 0 0 512 49.38a212.93 212.93 0 0 1-60.44 16.6 105.7 105.7 0 0 0 46.3-58.19 209 209 0 0 1-66.79 25.37 105.09 105.09 0 0 0-181.73 71.91 116.12 116.12 0 0 0 2.66 24c-87.28-4.3-164.73-46.3-216.56-109.82A105.48 105.48 0 0 0 68 159.6a106.27 106.27 0 0 1-47.53-13.11v1.43a105.28 105.28 0 0 0 84.21 103.06 105.67 105.67 0 0 1-47.33 1.84 105.06 105.06 0 0 0 98.14 72.94A210.72 210.72 0 0 1 25 370.84a202.17 202.17 0 0 1-25-1.43 298.85 298.85 0 0 0 160.83 46.92" fill="currentColor"/></svg> <svg{% if include.class %} class="{{ include.class }}"{% endif %} xmlns="http://www.w3.org/2000/svg" viewbox="0 0 512 416.32"{% if include.width %} width="{{ include.width }}"{% endif %}{% if include.height %} height="{{ include.height }}"{% endif %} focusable="false"><title>Twitter</title><path d="M160.83 416.32c193.2 0 298.92-160.22 298.92-298.92 0-4.51 0-9-.2-13.52A214 214 0 0 0 512 49.38a212.93 212.93 0 0 1-60.44 16.6 105.7 105.7 0 0 0 46.3-58.19 209 209 0 0 1-66.79 25.37 105.09 105.09 0 0 0-181.73 71.91 116.12 116.12 0 0 0 2.66 24c-87.28-4.3-164.73-46.3-216.56-109.82A105.48 105.48 0 0 0 68 159.6a106.27 106.27 0 0 1-47.53-13.11v1.43a105.28 105.28 0 0 0 84.21 103.06 105.67 105.67 0 0 1-47.33 1.84 105.06 105.06 0 0 0 98.14 72.94A210.72 210.72 0 0 1 25 370.84a202.17 202.17 0 0 1-25-1.43 298.85 298.85 0 0 0 160.83 46.92" fill="currentColor"/></svg>

Before

Width:  |  Height:  |  Size: 843 B

After

Width:  |  Height:  |  Size: 861 B

+7 -6
View File
@@ -17,18 +17,19 @@
<div class="col-12 col-md-3 col-xl-2 bd-sidebar"> <div class="col-12 col-md-3 col-xl-2 bd-sidebar">
{% include docs-sidebar.html %} {% include docs-sidebar.html %}
</div> </div>
<main class="col-12 col-md-9 col-xl-8 py-md-3 pl-md-5 bd-content" role="main">
<h1 class="bd-title" id="content">{{ page.title }}</h1>
<p class="bd-lead">{{ page.description }}</p>
{% include ads.html %}
{{ content }}
</main>
{% if page.toc %} {% if page.toc %}
<div class="d-none d-xl-block col-xl-2 bd-toc"> <div class="d-none d-xl-block col-xl-2 bd-toc">
{{ content | toc_only }} {{ content | toc_only }}
</div> </div>
{% endif %} {% endif %}
<main class="col-12 col-md-9 col-xl-8 py-md-3 pl-md-5 bd-content" role="main">
<h1 class="bd-title" id="content">{{ page.title }}</h1>
<p class="bd-lead">{{ page.description }}</p>
{% include ads.html %}
{{ content }}
</main>
</div> </div>
</div> </div>
+2
View File
@@ -5,6 +5,8 @@
// //
.bd-content { .bd-content {
order: 1;
// Hack the sticky header // Hack the sticky header
> h2[id], > h2[id],
> h3[id], > h3[id],
+5 -6
View File
@@ -1,5 +1,3 @@
// scss-lint:disable VendorPrefix
// //
// Main navbar // Main navbar
// //
@@ -30,10 +28,11 @@
} }
@include media-breakpoint-up(md) { @include media-breakpoint-up(md) {
position: -webkit-sticky; @supports (position: sticky) {
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 1071; // over everything in bootstrap z-index: 1071; // over everything in bootstrap
}
} }
.navbar-nav { .navbar-nav {
+2
View File
@@ -10,6 +10,7 @@
top: 4rem; top: 4rem;
max-height: calc(100vh - 4rem); max-height: calc(100vh - 4rem);
} }
order: 2;
padding-top: 1.5rem; padding-top: 1.5rem;
padding-bottom: 1.5rem; padding-bottom: 1.5rem;
overflow-x: visible; overflow-x: visible;
@@ -49,6 +50,7 @@
// //
.bd-sidebar { .bd-sidebar {
order: 0;
background-color: #f5f2f9; background-color: #f5f2f9;
border-bottom: 1px solid rgba(0,0,0,.1); border-bottom: 1px solid rgba(0,0,0,.1);
+133 -134
View File
@@ -50,10 +50,9 @@ var Util = function ($) {
MozTransition: 'transitionend', MozTransition: 'transitionend',
OTransition: 'oTransitionEnd otransitionend', OTransition: 'oTransitionEnd otransitionend',
transition: 'transitionend' transition: 'transitionend'
};
// shoutout AngusCroll (https://goo.gl/pxwQGp) // shoutout AngusCroll (https://goo.gl/pxwQGp)
function toType(obj) { };function toType(obj) {
return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase(); return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
} }
@@ -67,7 +66,8 @@ var Util = function ($) {
delegateType: transition.end, delegateType: transition.end,
handle: function handle(event) { handle: function handle(event) {
if ($(event.target).is(this)) { if ($(event.target).is(this)) {
return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params return event.handleObj.handler.apply(this, arguments // eslint-disable-line prefer-rest-params
);
} }
return undefined; return undefined;
} }
@@ -177,7 +177,7 @@ var Util = function ($) {
setTransitionEndSupport(); setTransitionEndSupport();
return Util; return Util;
}(jQuery); }(jQuery
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
@@ -186,7 +186,7 @@ var Util = function ($) {
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
var Alert = function ($) { );var Alert = function ($) {
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -216,14 +216,14 @@ var Alert = function ($) {
ALERT: 'alert', ALERT: 'alert',
FADE: 'fade', FADE: 'fade',
SHOW: 'show' SHOW: 'show'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Alert = function () { var Alert = function () {
function Alert(element) { function Alert(element) {
_classCallCheck(this, Alert); _classCallCheck(this, Alert);
@@ -340,7 +340,7 @@ var Alert = function ($) {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert())); $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert())
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -348,7 +348,7 @@ var Alert = function ($) {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$.fn[NAME] = Alert._jQueryInterface; );$.fn[NAME] = Alert._jQueryInterface;
$.fn[NAME].Constructor = Alert; $.fn[NAME].Constructor = Alert;
$.fn[NAME].noConflict = function () { $.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT; $.fn[NAME] = JQUERY_NO_CONFLICT;
@@ -356,7 +356,7 @@ var Alert = function ($) {
}; };
return Alert; return Alert;
}(jQuery); }(jQuery
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
@@ -365,7 +365,7 @@ var Alert = function ($) {
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
var Button = function ($) { );var Button = function ($) {
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -397,14 +397,14 @@ var Button = function ($) {
var Event = { var Event = {
CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY, CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
FOCUS_BLUR_DATA_API: 'focus' + EVENT_KEY + DATA_API_KEY + ' ' + ('blur' + EVENT_KEY + DATA_API_KEY) FOCUS_BLUR_DATA_API: 'focus' + EVENT_KEY + DATA_API_KEY + ' ' + ('blur' + EVENT_KEY + DATA_API_KEY)
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Button = function () { var Button = function () {
function Button(element) { function Button(element) {
_classCallCheck(this, Button); _classCallCheck(this, Button);
@@ -510,7 +510,7 @@ var Button = function ($) {
}).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) { }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
var button = $(event.target).closest(Selector.BUTTON)[0]; var button = $(event.target).closest(Selector.BUTTON)[0];
$(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type)); $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
}); }
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -518,7 +518,7 @@ var Button = function ($) {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$.fn[NAME] = Button._jQueryInterface; );$.fn[NAME] = Button._jQueryInterface;
$.fn[NAME].Constructor = Button; $.fn[NAME].Constructor = Button;
$.fn[NAME].noConflict = function () { $.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT; $.fn[NAME] = JQUERY_NO_CONFLICT;
@@ -526,7 +526,7 @@ var Button = function ($) {
}; };
return Button; return Button;
}(jQuery); }(jQuery
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
@@ -535,7 +535,7 @@ var Button = function ($) {
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
var Carousel = function ($) { );var Carousel = function ($) {
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -607,14 +607,14 @@ var Carousel = function ($) {
INDICATORS: '.carousel-indicators', INDICATORS: '.carousel-indicators',
DATA_SLIDE: '[data-slide], [data-slide-to]', DATA_SLIDE: '[data-slide], [data-slide-to]',
DATA_RIDE: '[data-ride="carousel"]' DATA_RIDE: '[data-ride="carousel"]'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Carousel = function () { var Carousel = function () {
function Carousel(element, config) { function Carousel(element, config) {
_classCallCheck(this, Carousel); _classCallCheck(this, Carousel);
@@ -1017,7 +1017,7 @@ var Carousel = function ($) {
var $carousel = $(this); var $carousel = $(this);
Carousel._jQueryInterface.call($carousel, $carousel.data()); Carousel._jQueryInterface.call($carousel, $carousel.data());
}); });
}); }
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -1025,7 +1025,7 @@ var Carousel = function ($) {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$.fn[NAME] = Carousel._jQueryInterface; );$.fn[NAME] = Carousel._jQueryInterface;
$.fn[NAME].Constructor = Carousel; $.fn[NAME].Constructor = Carousel;
$.fn[NAME].noConflict = function () { $.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT; $.fn[NAME] = JQUERY_NO_CONFLICT;
@@ -1033,7 +1033,7 @@ var Carousel = function ($) {
}; };
return Carousel; return Carousel;
}(jQuery); }(jQuery
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
@@ -1042,7 +1042,7 @@ var Carousel = function ($) {
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
var Collapse = function ($) { );var Collapse = function ($) {
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -1091,14 +1091,14 @@ var Collapse = function ($) {
var Selector = { var Selector = {
ACTIVES: '.show, .collapsing', ACTIVES: '.show, .collapsing',
DATA_TOGGLE: '[data-toggle="collapse"]' DATA_TOGGLE: '[data-toggle="collapse"]'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Collapse = function () { var Collapse = function () {
function Collapse(element, config) { function Collapse(element, config) {
_classCallCheck(this, Collapse); _classCallCheck(this, Collapse);
@@ -1280,8 +1280,8 @@ var Collapse = function ($) {
Collapse.prototype._getConfig = function _getConfig(config) { Collapse.prototype._getConfig = function _getConfig(config) {
config = $.extend({}, Default, config); config = $.extend({}, Default, config);
config.toggle = Boolean(config.toggle); // coerce string values config.toggle = Boolean(config.toggle // coerce string values
Util.typeCheckConfig(NAME, config, DefaultType); );Util.typeCheckConfig(NAME, config, DefaultType);
return config; return config;
}; };
@@ -1378,7 +1378,7 @@ var Collapse = function ($) {
var config = data ? 'toggle' : $trigger.data(); var config = data ? 'toggle' : $trigger.data();
Collapse._jQueryInterface.call($target, config); Collapse._jQueryInterface.call($target, config);
}); });
}); }
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -1386,7 +1386,7 @@ var Collapse = function ($) {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$.fn[NAME] = Collapse._jQueryInterface; );$.fn[NAME] = Collapse._jQueryInterface;
$.fn[NAME].Constructor = Collapse; $.fn[NAME].Constructor = Collapse;
$.fn[NAME].noConflict = function () { $.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT; $.fn[NAME] = JQUERY_NO_CONFLICT;
@@ -1394,7 +1394,7 @@ var Collapse = function ($) {
}; };
return Collapse; return Collapse;
}(jQuery); }(jQuery
/* global Popper */ /* global Popper */
@@ -1405,7 +1405,7 @@ var Collapse = function ($) {
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
var Dropdown = function ($) { );var Dropdown = function ($) {
/** /**
* Check for Popper dependency * Check for Popper dependency
@@ -1479,14 +1479,14 @@ var Dropdown = function ($) {
placement: 'string', placement: 'string',
offset: '(number|string)', offset: '(number|string)',
flip: 'boolean' flip: 'boolean'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Dropdown = function () { var Dropdown = function () {
function Dropdown(element, config) { function Dropdown(element, config) {
_classCallCheck(this, Dropdown); _classCallCheck(this, Dropdown);
@@ -1622,11 +1622,10 @@ var Dropdown = function ($) {
if ($(this._menu).hasClass(ClassName.MENURIGHT)) { if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
placement = AttachmentMap.TOPEND; placement = AttachmentMap.TOPEND;
} }
} else { } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
if ($(this._menu).hasClass(ClassName.MENURIGHT)) { placement = AttachmentMap.BOTTOMEND;
placement = AttachmentMap.BOTTOMEND;
}
} }
return placement; return placement;
}; };
@@ -1790,7 +1789,7 @@ var Dropdown = function ($) {
Dropdown._jQueryInterface.call($(this), 'toggle'); Dropdown._jQueryInterface.call($(this), 'toggle');
}).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) { }).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
e.stopPropagation(); e.stopPropagation();
}); }
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -1798,7 +1797,7 @@ var Dropdown = function ($) {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$.fn[NAME] = Dropdown._jQueryInterface; );$.fn[NAME] = Dropdown._jQueryInterface;
$.fn[NAME].Constructor = Dropdown; $.fn[NAME].Constructor = Dropdown;
$.fn[NAME].noConflict = function () { $.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT; $.fn[NAME] = JQUERY_NO_CONFLICT;
@@ -1806,7 +1805,7 @@ var Dropdown = function ($) {
}; };
return Dropdown; return Dropdown;
}(jQuery); }(jQuery
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
@@ -1815,7 +1814,7 @@ var Dropdown = function ($) {
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
var Modal = function ($) { );var Modal = function ($) {
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -1875,14 +1874,14 @@ var Modal = function ($) {
DATA_DISMISS: '[data-dismiss="modal"]', DATA_DISMISS: '[data-dismiss="modal"]',
FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top', FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
NAVBAR_TOGGLER: '.navbar-toggler' NAVBAR_TOGGLER: '.navbar-toggler'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Modal = function () { var Modal = function () {
function Modal(element, config) { function Modal(element, config) {
_classCallCheck(this, Modal); _classCallCheck(this, Modal);
@@ -2074,8 +2073,8 @@ var Modal = function ($) {
Modal.prototype._enforceFocus = function _enforceFocus() { Modal.prototype._enforceFocus = function _enforceFocus() {
var _this13 = this; var _this13 = this;
$(document).off(Event.FOCUSIN) // guard against infinite focus loop $(document).off(Event.FOCUSIN // guard against infinite focus loop
.on(Event.FOCUSIN, function (event) { ).on(Event.FOCUSIN, function (event) {
if (document !== event.target && _this13._element !== event.target && !$(_this13._element).has(event.target).length) { if (document !== event.target && _this13._element !== event.target && !$(_this13._element).has(event.target).length) {
_this13._element.focus(); _this13._element.focus();
} }
@@ -2237,17 +2236,17 @@ var Modal = function ($) {
var actualPadding = $(element)[0].style.paddingRight; var actualPadding = $(element)[0].style.paddingRight;
var calculatedPadding = $(element).css('padding-right'); var calculatedPadding = $(element).css('padding-right');
$(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this18._scrollbarWidth + 'px'); $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this18._scrollbarWidth + 'px');
}); }
// Adjust navbar-toggler margin // Adjust navbar-toggler margin
$(Selector.NAVBAR_TOGGLER).each(function (index, element) { );$(Selector.NAVBAR_TOGGLER).each(function (index, element) {
var actualMargin = $(element)[0].style.marginRight; var actualMargin = $(element)[0].style.marginRight;
var calculatedMargin = $(element).css('margin-right'); var calculatedMargin = $(element).css('margin-right');
$(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) + _this18._scrollbarWidth + 'px'); $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) + _this18._scrollbarWidth + 'px');
}); }
// Adjust body padding // Adjust body padding
var actualPadding = document.body.style.paddingRight; );var actualPadding = document.body.style.paddingRight;
var calculatedPadding = $('body').css('padding-right'); var calculatedPadding = $('body').css('padding-right');
$('body').data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + 'px'); $('body').data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + 'px');
} }
@@ -2260,18 +2259,18 @@ var Modal = function ($) {
if (typeof padding !== 'undefined') { if (typeof padding !== 'undefined') {
$(element).css('padding-right', padding).removeData('padding-right'); $(element).css('padding-right', padding).removeData('padding-right');
} }
}); }
// Restore navbar-toggler margin // Restore navbar-toggler margin
$(Selector.NAVBAR_TOGGLER).each(function (index, element) { );$(Selector.NAVBAR_TOGGLER).each(function (index, element) {
var margin = $(element).data('margin-right'); var margin = $(element).data('margin-right');
if (typeof margin !== 'undefined') { if (typeof margin !== 'undefined') {
$(element).css('margin-right', margin).removeData('margin-right'); $(element).css('margin-right', margin).removeData('margin-right');
} }
}); }
// Restore body padding // Restore body padding
var padding = $('body').data('padding-right'); );var padding = $('body').data('padding-right');
if (typeof padding !== 'undefined') { if (typeof padding !== 'undefined') {
$('body').css('padding-right', padding).removeData('padding-right'); $('body').css('padding-right', padding).removeData('padding-right');
} }
@@ -2361,7 +2360,7 @@ var Modal = function ($) {
}); });
Modal._jQueryInterface.call($(target), config, this); Modal._jQueryInterface.call($(target), config, this);
}); }
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -2369,7 +2368,7 @@ var Modal = function ($) {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$.fn[NAME] = Modal._jQueryInterface; );$.fn[NAME] = Modal._jQueryInterface;
$.fn[NAME].Constructor = Modal; $.fn[NAME].Constructor = Modal;
$.fn[NAME].noConflict = function () { $.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT; $.fn[NAME] = JQUERY_NO_CONFLICT;
@@ -2377,7 +2376,7 @@ var Modal = function ($) {
}; };
return Modal; return Modal;
}(jQuery); }(jQuery
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
@@ -2386,7 +2385,7 @@ var Modal = function ($) {
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
var ScrollSpy = function ($) { );var ScrollSpy = function ($) {
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -2439,14 +2438,14 @@ var ScrollSpy = function ($) {
var OffsetMethod = { var OffsetMethod = {
OFFSET: 'offset', OFFSET: 'offset',
POSITION: 'position' POSITION: 'position'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var ScrollSpy = function () { var ScrollSpy = function () {
function ScrollSpy(element, config) { function ScrollSpy(element, config) {
var _this20 = this; var _this20 = this;
@@ -2611,10 +2610,10 @@ var ScrollSpy = function ($) {
$link.addClass(ClassName.ACTIVE); $link.addClass(ClassName.ACTIVE);
} else { } else {
// Set triggered link as active // Set triggered link as active
$link.addClass(ClassName.ACTIVE); $link.addClass(ClassName.ACTIVE
// Set triggered links parents as active // Set triggered links parents as active
// With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
$link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_LINKS + ', ' + Selector.LIST_ITEMS).addClass(ClassName.ACTIVE); );$link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_LINKS + ', ' + Selector.LIST_ITEMS).addClass(ClassName.ACTIVE);
} }
$(this._scrollElement).trigger(Event.ACTIVATE, { $(this._scrollElement).trigger(Event.ACTIVATE, {
@@ -2675,7 +2674,7 @@ var ScrollSpy = function ($) {
var $spy = $(scrollSpys[i]); var $spy = $(scrollSpys[i]);
ScrollSpy._jQueryInterface.call($spy, $spy.data()); ScrollSpy._jQueryInterface.call($spy, $spy.data());
} }
}); }
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -2683,7 +2682,7 @@ var ScrollSpy = function ($) {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$.fn[NAME] = ScrollSpy._jQueryInterface; );$.fn[NAME] = ScrollSpy._jQueryInterface;
$.fn[NAME].Constructor = ScrollSpy; $.fn[NAME].Constructor = ScrollSpy;
$.fn[NAME].noConflict = function () { $.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT; $.fn[NAME] = JQUERY_NO_CONFLICT;
@@ -2691,7 +2690,7 @@ var ScrollSpy = function ($) {
}; };
return ScrollSpy; return ScrollSpy;
}(jQuery); }(jQuery
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
@@ -2700,7 +2699,7 @@ var ScrollSpy = function ($) {
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
var Tab = function ($) { );var Tab = function ($) {
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -2739,14 +2738,14 @@ var Tab = function ($) {
DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]', DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
DROPDOWN_TOGGLE: '.dropdown-toggle', DROPDOWN_TOGGLE: '.dropdown-toggle',
DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active' DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Tab = function () { var Tab = function () {
function Tab(element) { function Tab(element) {
_classCallCheck(this, Tab); _classCallCheck(this, Tab);
@@ -2925,7 +2924,7 @@ var Tab = function ($) {
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
event.preventDefault(); event.preventDefault();
Tab._jQueryInterface.call($(this), 'show'); Tab._jQueryInterface.call($(this), 'show');
}); }
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -2933,7 +2932,7 @@ var Tab = function ($) {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$.fn[NAME] = Tab._jQueryInterface; );$.fn[NAME] = Tab._jQueryInterface;
$.fn[NAME].Constructor = Tab; $.fn[NAME].Constructor = Tab;
$.fn[NAME].noConflict = function () { $.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT; $.fn[NAME] = JQUERY_NO_CONFLICT;
@@ -2941,7 +2940,7 @@ var Tab = function ($) {
}; };
return Tab; return Tab;
}(jQuery); }(jQuery
/* global Popper */ /* global Popper */
@@ -2952,7 +2951,7 @@ var Tab = function ($) {
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
var Tooltip = function ($) { );var Tooltip = function ($) {
/** /**
* Check for Popper dependency * Check for Popper dependency
@@ -3047,14 +3046,14 @@ var Tooltip = function ($) {
FOCUS: 'focus', FOCUS: 'focus',
CLICK: 'click', CLICK: 'click',
MANUAL: 'manual' MANUAL: 'manual'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Tooltip = function () { var Tooltip = function () {
function Tooltip(element, config) { function Tooltip(element, config) {
_classCallCheck(this, Tooltip); _classCallCheck(this, Tooltip);
@@ -3211,13 +3210,13 @@ var Tooltip = function ($) {
} }
}); });
$(tip).addClass(ClassName.SHOW); $(tip).addClass(ClassName.SHOW
// if this is a touch-enabled device we add extra // if this is a touch-enabled device we add extra
// empty mouseover listeners to the body's immediate children; // empty mouseover listeners to the body's immediate children;
// only needed because of broken event delegation on iOS // only needed because of broken event delegation on iOS
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
if ('ontouchstart' in document.documentElement) { );if ('ontouchstart' in document.documentElement) {
$('body').children().on('mouseover', null, $.noop); $('body').children().on('mouseover', null, $.noop);
} }
@@ -3271,11 +3270,11 @@ var Tooltip = function ($) {
return; return;
} }
$(tip).removeClass(ClassName.SHOW); $(tip).removeClass(ClassName.SHOW
// if this is a touch-enabled device we remove the extra // if this is a touch-enabled device we remove the extra
// empty mouseover listeners we added for iOS support // empty mouseover listeners we added for iOS support
if ('ontouchstart' in document.documentElement) { );if ('ontouchstart' in document.documentElement) {
$('body').children().off('mouseover', null, $.noop); $('body').children().off('mouseover', null, $.noop);
} }
@@ -3616,7 +3615,7 @@ var Tooltip = function ($) {
}; };
return Tooltip; return Tooltip;
}(jQuery); }(jQuery
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
@@ -3625,7 +3624,7 @@ var Tooltip = function ($) {
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
var Popover = function ($) { );var Popover = function ($) {
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -3673,14 +3672,14 @@ var Popover = function ($) {
FOCUSOUT: 'focusout' + EVENT_KEY, FOCUSOUT: 'focusout' + EVENT_KEY,
MOUSEENTER: 'mouseenter' + EVENT_KEY, MOUSEENTER: 'mouseenter' + EVENT_KEY,
MOUSELEAVE: 'mouseleave' + EVENT_KEY MOUSELEAVE: 'mouseleave' + EVENT_KEY
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Popover = function (_Tooltip) { var Popover = function (_Tooltip) {
_inherits(Popover, _Tooltip); _inherits(Popover, _Tooltip);
@@ -3705,10 +3704,10 @@ var Popover = function ($) {
}; };
Popover.prototype.setContent = function setContent() { Popover.prototype.setContent = function setContent() {
var $tip = $(this.getTipElement()); var $tip = $(this.getTipElement()
// we use append for html objects to maintain js events // we use append for html objects to maintain js events
this.setElementContent($tip.find(Selector.TITLE), this.getTitle()); );this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
this.setElementContent($tip.find(Selector.CONTENT), this._getContent()); this.setElementContent($tip.find(Selector.CONTENT), this._getContent());
$tip.removeClass(ClassName.FADE + ' ' + ClassName.SHOW); $tip.removeClass(ClassName.FADE + ' ' + ClassName.SHOW);
+1 -1
View File
File diff suppressed because one or more lines are too long
+2
View File
@@ -26,6 +26,8 @@ Position an element at the bottom of the viewport, from edge to edge. Be sure yo
Position an element at the top of the viewport, from edge to edge, but only after you scroll past it. The `.sticky-top` utility uses CSS's `position: sticky`, which isn't fully supported in all browsers. Position an element at the top of the viewport, from edge to edge, but only after you scroll past it. The `.sticky-top` utility uses CSS's `position: sticky`, which isn't fully supported in all browsers.
**Microsoft Edge and IE11 will render `position: sticky` as `position: relative`.** As such, we wrap the styles in a `@supports` query, limiting the stickiness to only browsers that properly can render it.
{% highlight html %} {% highlight html %}
<div class="sticky-top">...</div> <div class="sticky-top">...</div>
{% endhighlight %} {% endhighlight %}
+9 -9
View File
@@ -39,14 +39,14 @@ var Alert = function ($) {
ALERT: 'alert', ALERT: 'alert',
FADE: 'fade', FADE: 'fade',
SHOW: 'show' SHOW: 'show'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Alert = function () { var Alert = function () {
function Alert(element) { function Alert(element) {
_classCallCheck(this, Alert); _classCallCheck(this, Alert);
@@ -163,7 +163,7 @@ var Alert = function ($) {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert())); $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert())
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -171,7 +171,7 @@ var Alert = function ($) {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$.fn[NAME] = Alert._jQueryInterface; );$.fn[NAME] = Alert._jQueryInterface;
$.fn[NAME].Constructor = Alert; $.fn[NAME].Constructor = Alert;
$.fn[NAME].noConflict = function () { $.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT; $.fn[NAME] = JQUERY_NO_CONFLICT;
+1 -1
View File
File diff suppressed because one or more lines are too long
+9 -9
View File
@@ -41,14 +41,14 @@ var Button = function ($) {
var Event = { var Event = {
CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY, CLICK_DATA_API: 'click' + EVENT_KEY + DATA_API_KEY,
FOCUS_BLUR_DATA_API: 'focus' + EVENT_KEY + DATA_API_KEY + ' ' + ('blur' + EVENT_KEY + DATA_API_KEY) FOCUS_BLUR_DATA_API: 'focus' + EVENT_KEY + DATA_API_KEY + ' ' + ('blur' + EVENT_KEY + DATA_API_KEY)
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Button = function () { var Button = function () {
function Button(element) { function Button(element) {
_classCallCheck(this, Button); _classCallCheck(this, Button);
@@ -154,7 +154,7 @@ var Button = function ($) {
}).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) { }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
var button = $(event.target).closest(Selector.BUTTON)[0]; var button = $(event.target).closest(Selector.BUTTON)[0];
$(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type)); $(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
}); }
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -162,7 +162,7 @@ var Button = function ($) {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$.fn[NAME] = Button._jQueryInterface; );$.fn[NAME] = Button._jQueryInterface;
$.fn[NAME].Constructor = Button; $.fn[NAME].Constructor = Button;
$.fn[NAME].noConflict = function () { $.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT; $.fn[NAME] = JQUERY_NO_CONFLICT;
+1 -1
View File
File diff suppressed because one or more lines are too long
+9 -9
View File
@@ -83,14 +83,14 @@ var Carousel = function ($) {
INDICATORS: '.carousel-indicators', INDICATORS: '.carousel-indicators',
DATA_SLIDE: '[data-slide], [data-slide-to]', DATA_SLIDE: '[data-slide], [data-slide-to]',
DATA_RIDE: '[data-ride="carousel"]' DATA_RIDE: '[data-ride="carousel"]'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Carousel = function () { var Carousel = function () {
function Carousel(element, config) { function Carousel(element, config) {
_classCallCheck(this, Carousel); _classCallCheck(this, Carousel);
@@ -493,7 +493,7 @@ var Carousel = function ($) {
var $carousel = $(this); var $carousel = $(this);
Carousel._jQueryInterface.call($carousel, $carousel.data()); Carousel._jQueryInterface.call($carousel, $carousel.data());
}); });
}); }
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -501,7 +501,7 @@ var Carousel = function ($) {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$.fn[NAME] = Carousel._jQueryInterface; );$.fn[NAME] = Carousel._jQueryInterface;
$.fn[NAME].Constructor = Carousel; $.fn[NAME].Constructor = Carousel;
$.fn[NAME].noConflict = function () { $.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT; $.fn[NAME] = JQUERY_NO_CONFLICT;
+1 -1
View File
File diff suppressed because one or more lines are too long
+11 -11
View File
@@ -60,14 +60,14 @@ var Collapse = function ($) {
var Selector = { var Selector = {
ACTIVES: '.show, .collapsing', ACTIVES: '.show, .collapsing',
DATA_TOGGLE: '[data-toggle="collapse"]' DATA_TOGGLE: '[data-toggle="collapse"]'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Collapse = function () { var Collapse = function () {
function Collapse(element, config) { function Collapse(element, config) {
_classCallCheck(this, Collapse); _classCallCheck(this, Collapse);
@@ -249,8 +249,8 @@ var Collapse = function ($) {
Collapse.prototype._getConfig = function _getConfig(config) { Collapse.prototype._getConfig = function _getConfig(config) {
config = $.extend({}, Default, config); config = $.extend({}, Default, config);
config.toggle = Boolean(config.toggle); // coerce string values config.toggle = Boolean(config.toggle // coerce string values
Util.typeCheckConfig(NAME, config, DefaultType); );Util.typeCheckConfig(NAME, config, DefaultType);
return config; return config;
}; };
@@ -347,7 +347,7 @@ var Collapse = function ($) {
var config = data ? 'toggle' : $trigger.data(); var config = data ? 'toggle' : $trigger.data();
Collapse._jQueryInterface.call($target, config); Collapse._jQueryInterface.call($target, config);
}); });
}); }
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -355,7 +355,7 @@ var Collapse = function ($) {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$.fn[NAME] = Collapse._jQueryInterface; );$.fn[NAME] = Collapse._jQueryInterface;
$.fn[NAME].Constructor = Collapse; $.fn[NAME].Constructor = Collapse;
$.fn[NAME].noConflict = function () { $.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT; $.fn[NAME] = JQUERY_NO_CONFLICT;
+1 -1
View File
File diff suppressed because one or more lines are too long
+12 -13
View File
@@ -85,14 +85,14 @@ var Dropdown = function ($) {
placement: 'string', placement: 'string',
offset: '(number|string)', offset: '(number|string)',
flip: 'boolean' flip: 'boolean'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Dropdown = function () { var Dropdown = function () {
function Dropdown(element, config) { function Dropdown(element, config) {
_classCallCheck(this, Dropdown); _classCallCheck(this, Dropdown);
@@ -228,11 +228,10 @@ var Dropdown = function ($) {
if ($(this._menu).hasClass(ClassName.MENURIGHT)) { if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
placement = AttachmentMap.TOPEND; placement = AttachmentMap.TOPEND;
} }
} else { } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
if ($(this._menu).hasClass(ClassName.MENURIGHT)) { placement = AttachmentMap.BOTTOMEND;
placement = AttachmentMap.BOTTOMEND;
}
} }
return placement; return placement;
}; };
@@ -396,7 +395,7 @@ var Dropdown = function ($) {
Dropdown._jQueryInterface.call($(this), 'toggle'); Dropdown._jQueryInterface.call($(this), 'toggle');
}).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) { }).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
e.stopPropagation(); e.stopPropagation();
}); }
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -404,7 +403,7 @@ var Dropdown = function ($) {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$.fn[NAME] = Dropdown._jQueryInterface; );$.fn[NAME] = Dropdown._jQueryInterface;
$.fn[NAME].Constructor = Dropdown; $.fn[NAME].Constructor = Dropdown;
$.fn[NAME].noConflict = function () { $.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT; $.fn[NAME] = JQUERY_NO_CONFLICT;
+1 -1
View File
File diff suppressed because one or more lines are too long
+19 -19
View File
@@ -71,14 +71,14 @@ var Modal = function ($) {
DATA_DISMISS: '[data-dismiss="modal"]', DATA_DISMISS: '[data-dismiss="modal"]',
FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top', FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
NAVBAR_TOGGLER: '.navbar-toggler' NAVBAR_TOGGLER: '.navbar-toggler'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Modal = function () { var Modal = function () {
function Modal(element, config) { function Modal(element, config) {
_classCallCheck(this, Modal); _classCallCheck(this, Modal);
@@ -270,8 +270,8 @@ var Modal = function ($) {
Modal.prototype._enforceFocus = function _enforceFocus() { Modal.prototype._enforceFocus = function _enforceFocus() {
var _this4 = this; var _this4 = this;
$(document).off(Event.FOCUSIN) // guard against infinite focus loop $(document).off(Event.FOCUSIN // guard against infinite focus loop
.on(Event.FOCUSIN, function (event) { ).on(Event.FOCUSIN, function (event) {
if (document !== event.target && _this4._element !== event.target && !$(_this4._element).has(event.target).length) { if (document !== event.target && _this4._element !== event.target && !$(_this4._element).has(event.target).length) {
_this4._element.focus(); _this4._element.focus();
} }
@@ -433,17 +433,17 @@ var Modal = function ($) {
var actualPadding = $(element)[0].style.paddingRight; var actualPadding = $(element)[0].style.paddingRight;
var calculatedPadding = $(element).css('padding-right'); var calculatedPadding = $(element).css('padding-right');
$(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + 'px'); $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + 'px');
}); }
// Adjust navbar-toggler margin // Adjust navbar-toggler margin
$(Selector.NAVBAR_TOGGLER).each(function (index, element) { );$(Selector.NAVBAR_TOGGLER).each(function (index, element) {
var actualMargin = $(element)[0].style.marginRight; var actualMargin = $(element)[0].style.marginRight;
var calculatedMargin = $(element).css('margin-right'); var calculatedMargin = $(element).css('margin-right');
$(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) + _this9._scrollbarWidth + 'px'); $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) + _this9._scrollbarWidth + 'px');
}); }
// Adjust body padding // Adjust body padding
var actualPadding = document.body.style.paddingRight; );var actualPadding = document.body.style.paddingRight;
var calculatedPadding = $('body').css('padding-right'); var calculatedPadding = $('body').css('padding-right');
$('body').data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + 'px'); $('body').data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + 'px');
} }
@@ -456,18 +456,18 @@ var Modal = function ($) {
if (typeof padding !== 'undefined') { if (typeof padding !== 'undefined') {
$(element).css('padding-right', padding).removeData('padding-right'); $(element).css('padding-right', padding).removeData('padding-right');
} }
}); }
// Restore navbar-toggler margin // Restore navbar-toggler margin
$(Selector.NAVBAR_TOGGLER).each(function (index, element) { );$(Selector.NAVBAR_TOGGLER).each(function (index, element) {
var margin = $(element).data('margin-right'); var margin = $(element).data('margin-right');
if (typeof margin !== 'undefined') { if (typeof margin !== 'undefined') {
$(element).css('margin-right', margin).removeData('margin-right'); $(element).css('margin-right', margin).removeData('margin-right');
} }
}); }
// Restore body padding // Restore body padding
var padding = $('body').data('padding-right'); );var padding = $('body').data('padding-right');
if (typeof padding !== 'undefined') { if (typeof padding !== 'undefined') {
$('body').css('padding-right', padding).removeData('padding-right'); $('body').css('padding-right', padding).removeData('padding-right');
} }
@@ -557,7 +557,7 @@ var Modal = function ($) {
}); });
Modal._jQueryInterface.call($(target), config, this); Modal._jQueryInterface.call($(target), config, this);
}); }
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -565,7 +565,7 @@ var Modal = function ($) {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$.fn[NAME] = Modal._jQueryInterface; );$.fn[NAME] = Modal._jQueryInterface;
$.fn[NAME].Constructor = Modal; $.fn[NAME].Constructor = Modal;
$.fn[NAME].noConflict = function () { $.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT; $.fn[NAME] = JQUERY_NO_CONFLICT;
+1 -1
View File
File diff suppressed because one or more lines are too long
+9 -9
View File
@@ -63,14 +63,14 @@ var Popover = function ($) {
FOCUSOUT: 'focusout' + EVENT_KEY, FOCUSOUT: 'focusout' + EVENT_KEY,
MOUSEENTER: 'mouseenter' + EVENT_KEY, MOUSEENTER: 'mouseenter' + EVENT_KEY,
MOUSELEAVE: 'mouseleave' + EVENT_KEY MOUSELEAVE: 'mouseleave' + EVENT_KEY
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Popover = function (_Tooltip) { var Popover = function (_Tooltip) {
_inherits(Popover, _Tooltip); _inherits(Popover, _Tooltip);
@@ -95,10 +95,10 @@ var Popover = function ($) {
}; };
Popover.prototype.setContent = function setContent() { Popover.prototype.setContent = function setContent() {
var $tip = $(this.getTipElement()); var $tip = $(this.getTipElement()
// we use append for html objects to maintain js events // we use append for html objects to maintain js events
this.setElementContent($tip.find(Selector.TITLE), this.getTitle()); );this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
this.setElementContent($tip.find(Selector.CONTENT), this._getContent()); this.setElementContent($tip.find(Selector.CONTENT), this._getContent());
$tip.removeClass(ClassName.FADE + ' ' + ClassName.SHOW); $tip.removeClass(ClassName.FADE + ' ' + ClassName.SHOW);
+1 -1
View File
File diff suppressed because one or more lines are too long
+11 -11
View File
@@ -64,14 +64,14 @@ var ScrollSpy = function ($) {
var OffsetMethod = { var OffsetMethod = {
OFFSET: 'offset', OFFSET: 'offset',
POSITION: 'position' POSITION: 'position'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var ScrollSpy = function () { var ScrollSpy = function () {
function ScrollSpy(element, config) { function ScrollSpy(element, config) {
var _this = this; var _this = this;
@@ -236,10 +236,10 @@ var ScrollSpy = function ($) {
$link.addClass(ClassName.ACTIVE); $link.addClass(ClassName.ACTIVE);
} else { } else {
// Set triggered link as active // Set triggered link as active
$link.addClass(ClassName.ACTIVE); $link.addClass(ClassName.ACTIVE
// Set triggered links parents as active // Set triggered links parents as active
// With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
$link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_LINKS + ', ' + Selector.LIST_ITEMS).addClass(ClassName.ACTIVE); );$link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_LINKS + ', ' + Selector.LIST_ITEMS).addClass(ClassName.ACTIVE);
} }
$(this._scrollElement).trigger(Event.ACTIVATE, { $(this._scrollElement).trigger(Event.ACTIVATE, {
@@ -300,7 +300,7 @@ var ScrollSpy = function ($) {
var $spy = $(scrollSpys[i]); var $spy = $(scrollSpys[i]);
ScrollSpy._jQueryInterface.call($spy, $spy.data()); ScrollSpy._jQueryInterface.call($spy, $spy.data());
} }
}); }
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -308,7 +308,7 @@ var ScrollSpy = function ($) {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$.fn[NAME] = ScrollSpy._jQueryInterface; );$.fn[NAME] = ScrollSpy._jQueryInterface;
$.fn[NAME].Constructor = ScrollSpy; $.fn[NAME].Constructor = ScrollSpy;
$.fn[NAME].noConflict = function () { $.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT; $.fn[NAME] = JQUERY_NO_CONFLICT;
+1 -1
View File
File diff suppressed because one or more lines are too long
+9 -9
View File
@@ -48,14 +48,14 @@ var Tab = function ($) {
DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]', DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
DROPDOWN_TOGGLE: '.dropdown-toggle', DROPDOWN_TOGGLE: '.dropdown-toggle',
DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active' DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Tab = function () { var Tab = function () {
function Tab(element) { function Tab(element) {
_classCallCheck(this, Tab); _classCallCheck(this, Tab);
@@ -234,7 +234,7 @@ var Tab = function ($) {
$(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) { $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
event.preventDefault(); event.preventDefault();
Tab._jQueryInterface.call($(this), 'show'); Tab._jQueryInterface.call($(this), 'show');
}); }
/** /**
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
@@ -242,7 +242,7 @@ var Tab = function ($) {
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
*/ */
$.fn[NAME] = Tab._jQueryInterface; );$.fn[NAME] = Tab._jQueryInterface;
$.fn[NAME].Constructor = Tab; $.fn[NAME].Constructor = Tab;
$.fn[NAME].noConflict = function () { $.fn[NAME].noConflict = function () {
$.fn[NAME] = JQUERY_NO_CONFLICT; $.fn[NAME] = JQUERY_NO_CONFLICT;
+1 -1
View File
File diff suppressed because one or more lines are too long
+11 -11
View File
@@ -106,14 +106,14 @@ var Tooltip = function ($) {
FOCUS: 'focus', FOCUS: 'focus',
CLICK: 'click', CLICK: 'click',
MANUAL: 'manual' MANUAL: 'manual'
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
}; };
/**
* ------------------------------------------------------------------------
* Class Definition
* ------------------------------------------------------------------------
*/
var Tooltip = function () { var Tooltip = function () {
function Tooltip(element, config) { function Tooltip(element, config) {
_classCallCheck(this, Tooltip); _classCallCheck(this, Tooltip);
@@ -270,13 +270,13 @@ var Tooltip = function ($) {
} }
}); });
$(tip).addClass(ClassName.SHOW); $(tip).addClass(ClassName.SHOW
// if this is a touch-enabled device we add extra // if this is a touch-enabled device we add extra
// empty mouseover listeners to the body's immediate children; // empty mouseover listeners to the body's immediate children;
// only needed because of broken event delegation on iOS // only needed because of broken event delegation on iOS
// https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
if ('ontouchstart' in document.documentElement) { );if ('ontouchstart' in document.documentElement) {
$('body').children().on('mouseover', null, $.noop); $('body').children().on('mouseover', null, $.noop);
} }
@@ -330,11 +330,11 @@ var Tooltip = function ($) {
return; return;
} }
$(tip).removeClass(ClassName.SHOW); $(tip).removeClass(ClassName.SHOW
// if this is a touch-enabled device we remove the extra // if this is a touch-enabled device we remove the extra
// empty mouseover listeners we added for iOS support // empty mouseover listeners we added for iOS support
if ('ontouchstart' in document.documentElement) { );if ('ontouchstart' in document.documentElement) {
$('body').children().off('mouseover', null, $.noop); $('body').children().off('mouseover', null, $.noop);
} }
+1 -1
View File
File diff suppressed because one or more lines are too long
+4 -4
View File
@@ -22,10 +22,9 @@ var Util = function ($) {
MozTransition: 'transitionend', MozTransition: 'transitionend',
OTransition: 'oTransitionEnd otransitionend', OTransition: 'oTransitionEnd otransitionend',
transition: 'transitionend' transition: 'transitionend'
};
// shoutout AngusCroll (https://goo.gl/pxwQGp) // shoutout AngusCroll (https://goo.gl/pxwQGp)
function toType(obj) { };function toType(obj) {
return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase(); return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
} }
@@ -39,7 +38,8 @@ var Util = function ($) {
delegateType: transition.end, delegateType: transition.end,
handle: function handle(event) { handle: function handle(event) {
if ($(event.target).is(this)) { if ($(event.target).is(this)) {
return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params return event.handleObj.handler.apply(this, arguments // eslint-disable-line prefer-rest-params
);
} }
return undefined; return undefined;
} }
+1 -1
View File
File diff suppressed because one or more lines are too long
+37 -16
View File
@@ -96,10 +96,11 @@ const Dropdown = (($) => {
class Dropdown { class Dropdown {
constructor(element, config) { constructor(element, config) {
this._element = element this._element = element
this._popper = null this._popper = null
this._config = this._getConfig(config) this._config = this._getConfig(config)
this._menu = this._getMenuElement() this._menu = this._getMenuElement()
this._inNavbar = this._detectNavbar()
this._addEventListeners() this._addEventListeners()
} }
@@ -153,17 +154,7 @@ const Dropdown = (($) => {
element = parent element = parent
} }
} }
this._popper = new Popper(element, this._menu, { this._popper = new Popper(element, this._menu, this._getPopperConfig())
placement : this._getPlacement(),
modifiers : {
offset : {
offset : this._config.offset
},
flip : {
enabled : this._config.flip
}
}
})
// if this is a touch-enabled device we add extra // if this is a touch-enabled device we add extra
// empty mouseover listeners to the body's immediate children; // empty mouseover listeners to the body's immediate children;
@@ -195,6 +186,7 @@ const Dropdown = (($) => {
} }
update() { update() {
this._inNavbar = this._detectNavbar()
if (this._popper !== null) { if (this._popper !== null) {
this._popper.scheduleUpdate() this._popper.scheduleUpdate()
} }
@@ -253,10 +245,39 @@ const Dropdown = (($) => {
} else if ($(this._menu).hasClass(ClassName.MENURIGHT)) { } else if ($(this._menu).hasClass(ClassName.MENURIGHT)) {
placement = AttachmentMap.BOTTOMEND placement = AttachmentMap.BOTTOMEND
} }
return placement return placement
} }
_detectNavbar() {
return $(this._element).closest('.navbar').length > 0
}
_getPopperConfig() {
const popperConfig = {
placement : this._getPlacement(),
modifiers : {
offset : {
offset : this._config.offset
},
flip : {
enabled : this._config.flip
}
}
}
if (this._inNavbar) {
popperConfig.modifiers.AfterApplyStyle = {
enabled: true,
order: 901, // ApplyStyle order + 1
fn: () => {
// reset Popper styles
$(this._menu).attr('style', '')
}
}
}
return popperConfig
}
// static // static
static _jQueryInterface(config) { static _jQueryInterface(config) {
+7 -4
View File
@@ -77,9 +77,8 @@
} }
.dropdown-menu { .dropdown-menu {
position: static !important; position: static;
float: none; float: none;
transform: unset !important;
} }
} }
@@ -158,8 +157,12 @@
flex-direction: row; flex-direction: row;
.dropdown-menu { .dropdown-menu {
position: absolute !important; position: absolute;
top: 100% !important; }
.dropdown-menu-right {
right: 0;
left: auto; // Reset the default from `.dropdown-menu`
} }
.nav-link { .nav-link {
+5 -3
View File
@@ -17,7 +17,9 @@
} }
.sticky-top { .sticky-top {
position: sticky; @supports (position: sticky) {
top: 0; position: sticky;
z-index: $zindex-sticky; top: 0;
z-index: $zindex-sticky;
}
} }