Commit 59bf81f6 authored by Mark Otto's avatar Mark Otto
Browse files

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

parents 0c40a5bf 98832703
6 merge requests!28721Hot test,!27561Adds font-weight-medium to font weight classes,!25494web pack,!25326Adjust examples,!23207#22402 : modal: new autofocus & keyboardBtnNav options,!17021v4
Showing with 79 additions and 20 deletions
+79 -20
...@@ -71,5 +71,5 @@ cdn: ...@@ -71,5 +71,5 @@ cdn:
js_hash: "sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" js_hash: "sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ"
jquery: "https://code.jquery.com/jquery-3.2.1.slim.min.js" jquery: "https://code.jquery.com/jquery-3.2.1.slim.min.js"
jquery_hash: "sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" jquery_hash: "sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
popper: "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" popper: "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.6/umd/popper.min.js"
popper_hash: "sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" popper_hash: "sha384-W1IgCZfiFCplncoIxD5rld+uzdB6FlcG2vm4qjrCP5Z7uUt7vnwbztJXeqXgd26w"
This diff is collapsed.
...@@ -20,7 +20,7 @@ const plugins = [ ...@@ -20,7 +20,7 @@ const plugins = [
}) })
] ]
const globals = { const globals = {
jquery: '$', jquery: 'jQuery', // ensure we use jQuery which is always available even in noConflict mode
'popper.js': 'Popper' 'popper.js': 'Popper'
} }
......
...@@ -231,6 +231,7 @@ Dropped entirely for the new card component. ...@@ -231,6 +231,7 @@ Dropped entirely for the new card component.
### Progress ### Progress
- Replaced contextual `.progress-bar-*` classes with `.bg-*` utilities. For example, `class="progress-bar progress-bar-danger"` becomes `class="progress-bar bg-danger"`. - Replaced contextual `.progress-bar-*` classes with `.bg-*` utilities. For example, `class="progress-bar progress-bar-danger"` becomes `class="progress-bar bg-danger"`.
- Replaced `.active` for animated progress bars with `.progress-bar-animated`.
### Carousel ### Carousel
......
...@@ -9,7 +9,7 @@ import Util from './util' ...@@ -9,7 +9,7 @@ import Util from './util'
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
const Alert = (() => { const Alert = (($) => {
/** /**
......
import $ from 'jquery' import $ from 'jquery'
/** /**
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Bootstrap (v4.0.0-beta.2): button.js * Bootstrap (v4.0.0-beta.2): button.js
...@@ -6,7 +7,7 @@ import $ from 'jquery' ...@@ -6,7 +7,7 @@ import $ from 'jquery'
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
const Button = (() => { const Button = (($) => {
/** /**
......
...@@ -9,7 +9,7 @@ import Util from './util' ...@@ -9,7 +9,7 @@ import Util from './util'
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
const Carousel = (() => { const Carousel = (($) => {
/** /**
......
...@@ -9,7 +9,7 @@ import Util from './util' ...@@ -9,7 +9,7 @@ import Util from './util'
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
const Collapse = (() => { const Collapse = (($) => {
/** /**
......
...@@ -10,7 +10,7 @@ import Util from './util' ...@@ -10,7 +10,7 @@ import Util from './util'
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
const Dropdown = (() => { const Dropdown = (($) => {
/** /**
* Check for Popper dependency * Check for Popper dependency
......
...@@ -18,7 +18,7 @@ import Util from './util' ...@@ -18,7 +18,7 @@ import Util from './util'
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
(() => { (($) => {
if (typeof $ === 'undefined') { if (typeof $ === 'undefined') {
throw new Error('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.') throw new Error('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.')
} }
......
...@@ -9,7 +9,7 @@ import Util from './util' ...@@ -9,7 +9,7 @@ import Util from './util'
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
const Modal = (() => { const Modal = (($) => {
/** /**
......
...@@ -9,7 +9,7 @@ import Tooltip from './tooltip' ...@@ -9,7 +9,7 @@ import Tooltip from './tooltip'
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
const Popover = (() => { const Popover = (($) => {
/** /**
......
...@@ -9,7 +9,7 @@ import Util from './util' ...@@ -9,7 +9,7 @@ import Util from './util'
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
const ScrollSpy = (() => { const ScrollSpy = (($) => {
/** /**
......
...@@ -9,7 +9,7 @@ import Util from './util' ...@@ -9,7 +9,7 @@ import Util from './util'
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
const Tab = (() => { const Tab = (($) => {
/** /**
......
...@@ -10,7 +10,7 @@ import Util from './util' ...@@ -10,7 +10,7 @@ import Util from './util'
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
const Tooltip = (() => { const Tooltip = (($) => {
/** /**
* Check for Popper dependency * Check for Popper dependency
......
...@@ -7,7 +7,7 @@ import $ from 'jquery' ...@@ -7,7 +7,7 @@ import $ from 'jquery'
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
*/ */
const Util = (() => { const Util = (($) => {
/** /**
...@@ -22,8 +22,6 @@ const Util = (() => { ...@@ -22,8 +22,6 @@ const Util = (() => {
const TransitionEndEvent = { const TransitionEndEvent = {
WebkitTransition : 'webkitTransitionEnd', WebkitTransition : 'webkitTransitionEnd',
MozTransition : 'transitionend',
OTransition : 'oTransitionEnd otransitionend',
transition : 'transitionend' transition : 'transitionend'
} }
......
...@@ -119,6 +119,7 @@ ...@@ -119,6 +119,7 @@
<script src="unit/tab.js"></script> <script src="unit/tab.js"></script>
<script src="unit/tooltip.js"></script> <script src="unit/tooltip.js"></script>
<script src="unit/popover.js"></script> <script src="unit/popover.js"></script>
<script src="unit/util.js"></script>
</head> </head>
<body> <body>
<div id="qunit-container"> <div id="qunit-container">
......
$(function () {
'use strict'
QUnit.module('util')
QUnit.test('Util.getSelectorFromElement should return the correct element', function (assert) {
assert.expect(2)
var $el = $('<div data-target="body"></div>').appendTo($('#qunit-fixture'))
assert.strictEqual(Util.getSelectorFromElement($el[0]), 'body')
// not found element
var $el2 = $('<div data-target="#fakeDiv"></div>').appendTo($('#qunit-fixture'))
assert.strictEqual(Util.getSelectorFromElement($el2[0]), null)
})
QUnit.test('Util.typeCheckConfig should thrown an error when a bad config is passed', function (assert) {
assert.expect(1)
var namePlugin = 'collapse'
var defaultType = {
toggle : 'boolean',
parent : '(string|element)'
}
var config = {
toggle: true,
parent: 777
}
try {
Util.typeCheckConfig(namePlugin, config, defaultType)
} catch (e) {
assert.strictEqual(e.message, 'COLLAPSE: Option "parent" provided type "number" but expected type "(string|element)".')
}
})
QUnit.test('Util.isElement should check if we passed an element or not', function (assert) {
assert.expect(3)
var $div = $('<div id="test"></div>').appendTo($('#qunit-fixture'))
assert.strictEqual(Util.isElement($div), 1)
assert.strictEqual(Util.isElement($div[0]), 1)
assert.strictEqual(typeof Util.isElement({}) === 'undefined', true)
})
QUnit.test('Util.getUID should generate a new id uniq', function (assert) {
assert.expect(2)
var id = Util.getUID('test')
var id2 = Util.getUID('test')
assert.ok(id !== id2, id + ' !== ' + id2)
id = Util.getUID('test')
$('<div id="' + id + '"></div>').appendTo($('#qunit-fixture'))
id2 = Util.getUID('test')
assert.ok(id !== id2, id + ' !== ' + id2)
})
})
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<requireLicenseAcceptance>false</requireLicenseAcceptance> <requireLicenseAcceptance>false</requireLicenseAcceptance>
<dependencies> <dependencies>
<dependency id="jQuery" version="[3.0.0,4)" /> <dependency id="jQuery" version="[3.0.0,4)" />
<dependency id="popper.js" version="[1.12.3,2)" /> <dependency id="popper.js" version="[1.12.6,2)" />
</dependencies> </dependencies>
<tags>css mobile-first responsive front-end framework web</tags> <tags>css mobile-first responsive front-end framework web</tags>
</metadata> </metadata>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<requireLicenseAcceptance>false</requireLicenseAcceptance> <requireLicenseAcceptance>false</requireLicenseAcceptance>
<dependencies> <dependencies>
<dependency id="jQuery" version="[3.0.0,4)" /> <dependency id="jQuery" version="[3.0.0,4)" />
<dependency id="popper.js" version="[1.12.3,2)" /> <dependency id="popper.js" version="[1.12.6,2)" />
</dependencies> </dependencies>
<tags>css sass mobile-first responsive front-end framework web</tags> <tags>css sass mobile-first responsive front-end framework web</tags>
</metadata> </metadata>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment