aboutsummaryrefslogtreecommitdiff
path: root/docs/assets/js/src
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2016-05-11 11:07:06 -0700
committerMark Otto <[email protected]>2016-05-11 11:07:06 -0700
commitb280e36b788e4b42bbb359f0a13db410adf7dd8c (patch)
treebc8115b9b11cb78767655917a482c25c9f711526 /docs/assets/js/src
parentef50b7839cb2ca9171eec12c2bf22fc38ad9d7ae (diff)
parent9d6b41c1276af04d5e81043059035660add82b8d (diff)
downloadbootstrap-b280e36b788e4b42bbb359f0a13db410adf7dd8c.tar.xz
bootstrap-b280e36b788e4b42bbb359f0a13db410adf7dd8c.zip
Merge branch 'v4-dev' into v4-split-buttons
Diffstat (limited to 'docs/assets/js/src')
-rw-r--r--docs/assets/js/src/application.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/assets/js/src/application.js b/docs/assets/js/src/application.js
index c522b1399..69520e947 100644
--- a/docs/assets/js/src/application.js
+++ b/docs/assets/js/src/application.js
@@ -36,6 +36,17 @@
e.preventDefault()
})
+ // Modal relatedTarget demo
+ $('#exampleModal').on('show.bs.modal', function (event) {
+ var $button = $(event.relatedTarget) // Button that triggered the modal
+ var recipient = $button.data('whatever') // Extract info from data-* attributes
+ // If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
+ // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
+ var $modal = $(this)
+ $modal.find('.modal-title').text('New message to ' + recipient)
+ $modal.find('.modal-body input').val(recipient)
+ })
+
// Insert copy to clipboard button before .highlight
$('.highlight').each(function () {
var btnHtml = '<div class="bd-clipboard"><span class="btn-clipboard" title="Copy to clipboard">Copy</span></div>'