0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-03-15 15:29:22 +01:00

Remove DOMContentLoaded. (#28337)

There's no reason for us to wait here.
This commit is contained in:
XhmikosR 2019-02-24 15:42:18 +02:00 committed by GitHub
parent 5328d0db0d
commit 5ad2121819
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 232 additions and 242 deletions

View File

@ -54,8 +54,8 @@
<script src="../../dist/util.js"></script> <script src="../../dist/util.js"></script>
<script src="../../dist/carousel.js"></script> <script src="../../dist/carousel.js"></script>
<script> <script>
document.addEventListener('DOMContentLoaded', function () { var t0
var t0, t1; var t1
var carousel = document.getElementById('carousel-example-generic') var carousel = document.getElementById('carousel-example-generic')
// Test to show that the carousel doesn't slide when the current tab isn't visible // Test to show that the carousel doesn't slide when the current tab isn't visible
@ -67,7 +67,6 @@
carousel.addEventListener('slide.bs.carousel', function () { carousel.addEventListener('slide.bs.carousel', function () {
t0 = performance.now() t0 = performance.now()
}) })
})
</script> </script>
</body> </body>
</html> </html>

View File

@ -217,15 +217,12 @@
<script src="../../dist/tooltip.js"></script> <script src="../../dist/tooltip.js"></script>
<script src="../../dist/popover.js"></script> <script src="../../dist/popover.js"></script>
<script> <script>
var firefoxTestDone = false
document.addEventListener('DOMContentLoaded', function () {
var ffBugTestResult = document.getElementById('ff-bug-test-result') var ffBugTestResult = document.getElementById('ff-bug-test-result')
var firefoxTestDone = false
function reportFirefoxTestResult(result) { function reportFirefoxTestResult(result) {
if (!firefoxTestDone) { if (!firefoxTestDone) {
ffBugTestResult.classList ffBugTestResult.classList.add(result ? 'text-success' : 'text-danger')
.add(result ? 'text-success' : 'text-danger')
ffBugTestResult.innerHTML = result ? 'PASS' : 'FAIL' ffBugTestResult.innerHTML = result ? 'PASS' : 'FAIL'
} }
} }
@ -286,7 +283,8 @@
}) })
// Test transition duration // Test transition duration
var t0, t1; var t0
var t1
var slowModal = document.getElementById('slowModal') var slowModal = document.getElementById('slowModal')
slowModal.addEventListener('shown.bs.modal', function () { slowModal.addEventListener('shown.bs.modal', function () {
@ -297,7 +295,6 @@
slowModal.addEventListener('show.bs.modal', function () { slowModal.addEventListener('show.bs.modal', function () {
t0 = performance.now() t0 = performance.now()
}) })
})
</script> </script>
</body> </body>
</html> </html>

View File

@ -41,12 +41,10 @@
<script src="../../dist/tooltip.js"></script> <script src="../../dist/tooltip.js"></script>
<script src="../../dist/popover.js"></script> <script src="../../dist/popover.js"></script>
<script> <script>
document.addEventListener('DOMContentLoaded', function () {
[].slice.call(document.querySelectorAll('[data-toggle="popover"]')) [].slice.call(document.querySelectorAll('[data-toggle="popover"]'))
.forEach(function (popover) { .forEach(function (popover) {
new Popover(popover) new Popover(popover)
}) })
})
</script> </script>
</body> </body>
</html> </html>

View File

@ -80,7 +80,6 @@
<script src="../../dist/dom/selectorEngine.js"></script> <script src="../../dist/dom/selectorEngine.js"></script>
<script src="../../dist/tooltip.js"></script> <script src="../../dist/tooltip.js"></script>
<script> <script>
document.addEventListener('DOMContentLoaded', function () {
if (typeof document.body.attachShadow === 'function') { if (typeof document.body.attachShadow === 'function') {
var shadowRoot = document.getElementById('shadow').attachShadow({ mode: 'open' }) var shadowRoot = document.getElementById('shadow').attachShadow({ mode: 'open' })
shadowRoot.innerHTML = shadowRoot.innerHTML =
@ -113,7 +112,6 @@
trigger : 'manual' trigger : 'manual'
}) })
targetTooltip.show() targetTooltip.show()
})
</script> </script>
</body> </body>
</html> </html>

View File

@ -15,7 +15,6 @@
(function () { (function () {
'use strict' 'use strict'
document.addEventListener('DOMContentLoaded', function () {
// Tooltip and popover demos // Tooltip and popover demos
bootstrap.Util.makeArray(document.querySelectorAll('.tooltip-demo')) bootstrap.Util.makeArray(document.querySelectorAll('.tooltip-demo'))
.forEach(function (tooltip) { .forEach(function (tooltip) {
@ -153,5 +152,4 @@
}) })
bsCustomFileInput.init() bsCustomFileInput.init()
})
}()) }())