Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2020-05-19 08:33:12 +0300
committerGitHub <noreply@github.com>2020-05-19 08:33:12 +0300
commite271d016062b0628024a7b3fd1a494e8240c9673 (patch)
tree847b857af5b875ceec433367be6d4b56c2ba4e2c /site/assets
parent62626db320ee982a5576fa9c71f5bd7530056009 (diff)
Streamline application.js exampleModal code (#30819)
* use `textContent` since we only need to add text * move comments
Diffstat (limited to 'site/assets')
-rw-r--r--site/assets/js/application.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/site/assets/js/application.js b/site/assets/js/application.js
index 9d0c684b72..51dc20d42d 100644
--- a/site/assets/js/application.js
+++ b/site/assets/js/application.js
@@ -66,14 +66,16 @@
var exampleModal = document.getElementById('exampleModal')
if (exampleModal) {
exampleModal.addEventListener('show.bs.modal', function (event) {
- var button = event.relatedTarget // Button that triggered the modal
- var recipient = button.getAttribute('data-whatever') // Extract info from data-* attributes
+ // Button that triggered the modal
+ var button = event.relatedTarget
+ // Extract info from data-* attributes
+ var recipient = button.getAttribute('data-whatever')
// Update the modal's content.
var modalTitle = exampleModal.querySelector('.modal-title')
var modalBodyInput = exampleModal.querySelector('.modal-body input')
- modalTitle.innerHTML = 'New message to ' + recipient
+ modalTitle.textContent = 'New message to ' + recipient
modalBodyInput.value = recipient
})
}