Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
ba506807
Commit
ba506807
authored
9 years ago
by
James Mosier
Committed by
Chris Rebert
9 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Modal docs: Added JS event handler for relatedTarget demo
Fixes
#17584
Closes #17607 by merging it
parent
06fac24b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/assets/js/src/application.js
+11
-0
docs/assets/js/src/application.js
with
11 additions
and
0 deletions
+11
-0
docs/assets/js/src/application.js
+
11
-
0
View file @
ba506807
...
...
@@ -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>
'
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets