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
6b585021
Commit
6b585021
authored
7 years ago
by
Johann-S
Committed by
XhmikosR
6 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Second element of find and findOne should be optional, not the first one
parent
b69fa9db
5 merge requests
!31948
Examples/Floating-labels: fix bad behavior with autofill
,
!30064
test
,
!29779
Responsive sizing
,
!28882
fix custom-select-indicator in IE10
,
!28721
Hot test
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
js/src/alert.js
+1
-1
js/src/alert.js
js/src/dom/selectorEngine.js
+3
-3
js/src/dom/selectorEngine.js
with
4 additions
and
4 deletions
+4
-4
js/src/alert.js
+
1
-
1
View file @
6b585021
...
@@ -84,7 +84,7 @@ class Alert {
...
@@ -84,7 +84,7 @@ class Alert {
let
parent
=
false
let
parent
=
false
if
(
selector
)
{
if
(
selector
)
{
parent
=
SelectorEngine
.
find
(
selector
)
[
0
]
parent
=
SelectorEngine
.
find
One
(
selector
)
}
}
if
(
!
parent
)
{
if
(
!
parent
)
{
...
...
This diff is collapsed.
Click to expand it.
js/src/dom/selectorEngine.js
+
3
-
3
View file @
6b585021
...
@@ -46,19 +46,19 @@ const SelectorEngine = {
...
@@ -46,19 +46,19 @@ const SelectorEngine = {
return
fnMatches
.
call
(
element
,
selector
)
return
fnMatches
.
call
(
element
,
selector
)
},
},
find
(
element
=
document
,
selector
)
{
find
(
selector
,
element
=
document
)
{
if
(
typeof
selector
!==
'
string
'
)
{
if
(
typeof
selector
!==
'
string
'
)
{
return
null
return
null
}
}
if
(
selector
.
indexOf
(
'
#
'
)
===
0
)
{
if
(
selector
.
indexOf
(
'
#
'
)
===
0
)
{
return
SelectorEngine
.
findOne
(
ele
ment
,
s
ele
ctor
)
return
SelectorEngine
.
findOne
(
s
ele
ctor
,
ele
ment
)
}
}
return
element
.
querySelectorAll
(
selector
)
return
element
.
querySelectorAll
(
selector
)
},
},
findOne
(
element
=
document
,
selector
)
{
findOne
(
selector
,
element
=
document
)
{
if
(
typeof
selector
!==
'
string
'
)
{
if
(
typeof
selector
!==
'
string
'
)
{
return
null
return
null
}
}
...
...
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