Skip to content
GitLab
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
541a75f9
Commit
541a75f9
authored
10 years ago
by
Jacob
Browse files
Options
Download
Plain Diff
Merge pull request #14160 from hnrch02/simplify-button-focus-logic
Follow-up to #13907: simplify JS logic for focus shim
parents
dd22f599
cc7fab89
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js/button.js
+2
-14
js/button.js
with
2 additions
and
14 deletions
+2
-14
js/button.js
+
2
-
14
View file @
541a75f9
...
@@ -97,15 +97,6 @@
...
@@ -97,15 +97,6 @@
}
}
// FOCUS SHIM (FOR BUTTON GROUPS)
// ==============================
function
getBtnTarget
(
target
)
{
var
$target
=
$
(
target
)
return
$target
.
hasClass
(
'
btn
'
)
?
$target
:
$target
.
parent
(
'
.btn
'
)
}
// BUTTON DATA-API
// BUTTON DATA-API
// ===============
// ===============
...
@@ -116,11 +107,8 @@
...
@@ -116,11 +107,8 @@
Plugin
.
call
(
$btn
,
'
toggle
'
)
Plugin
.
call
(
$btn
,
'
toggle
'
)
e
.
preventDefault
()
e
.
preventDefault
()
})
})
.
on
(
'
focus.bs.button.data-api
'
,
'
[data-toggle^="button"]
'
,
function
(
e
)
{
.
on
(
'
focus.bs.button.data-api blur.bs.button.data-api
'
,
'
[data-toggle^="button"]
'
,
function
(
e
)
{
getBtnTarget
(
e
.
target
).
addClass
(
'
focus
'
)
$
(
e
.
target
).
closest
(
'
.btn
'
).
toggleClass
(
'
focus
'
,
e
.
type
==
'
focus
'
)
})
.
on
(
'
blur.bs.button.data-api
'
,
'
[data-toggle^="button"]
'
,
function
(
e
)
{
getBtnTarget
(
e
.
target
).
removeClass
(
'
focus
'
)
})
})
}(
jQuery
);
}(
jQuery
);
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