mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-05-27 14:46:01 +03:00
Lint docs js too and use `strict consistently. (#24160)
This commit is contained in:
@@ -739,18 +739,19 @@ When attempting to submit, you'll see the `:invalid` and `:valid` styles applied
|
||||
<script>
|
||||
// Example starter JavaScript for disabling form submissions if there are invalid fields
|
||||
(function() {
|
||||
"use strict";
|
||||
window.addEventListener("load", function() {
|
||||
var form = document.getElementById("needs-validation");
|
||||
form.addEventListener("submit", function(event) {
|
||||
if (form.checkValidity() == false) {
|
||||
'use strict';
|
||||
|
||||
window.addEventListener('load', function() {
|
||||
var form = document.getElementById('needs-validation');
|
||||
form.addEventListener('submit', function(event) {
|
||||
if (form.checkValidity() === false) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
form.classList.add("was-validated");
|
||||
form.classList.add('was-validated');
|
||||
}, false);
|
||||
}, false);
|
||||
}());
|
||||
})();
|
||||
</script>
|
||||
{% endexample %}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
$(document).ready(function () {
|
||||
$(function () {
|
||||
'use strict'
|
||||
|
||||
$('[data-toggle="offcanvas"]').on('click', function () {
|
||||
$('.row-offcanvas').toggleClass('active')
|
||||
});
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,18 +1,32 @@
|
||||
$(document).ready(function () {
|
||||
$(function () {
|
||||
'use strict'
|
||||
|
||||
$('.tooltip-right').tooltip({
|
||||
placement: 'right',
|
||||
viewport: {selector: 'body', padding: 2}
|
||||
viewport: {
|
||||
selector: 'body',
|
||||
padding: 2
|
||||
}
|
||||
})
|
||||
$('.tooltip-bottom').tooltip({
|
||||
placement: 'bottom',
|
||||
viewport: {selector: 'body', padding: 2}
|
||||
viewport: {
|
||||
selector: 'body',
|
||||
padding: 2
|
||||
}
|
||||
})
|
||||
$('.tooltip-viewport-right').tooltip({
|
||||
placement: 'right',
|
||||
viewport: {selector: '.container-viewport', padding: 2}
|
||||
viewport: {
|
||||
selector: '.container-viewport',
|
||||
padding: 2
|
||||
}
|
||||
})
|
||||
$('.tooltip-viewport-bottom').tooltip({
|
||||
placement: 'bottom',
|
||||
viewport: {selector: '.container-viewport', padding: 2}
|
||||
viewport: {
|
||||
selector: '.container-viewport',
|
||||
padding: 2
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user