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
30861cbc
Commit
30861cbc
authored
6 years ago
by
XhmikosR
Browse files
Options
Download
Email Patches
Plain Diff
Simplify checks.
parent
4b7c058a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
js/src/dom/eventHandler.js
+3
-4
js/src/dom/eventHandler.js
js/src/dom/manipulator.js
+1
-1
js/src/dom/manipulator.js
js/src/util.js
+2
-2
js/src/util.js
with
6 additions
and
7 deletions
+6
-7
js/src/dom/eventHandler.js
+
3
-
4
View file @
30861cbc
...
@@ -132,7 +132,7 @@ function normalizeParams(originalTypeEvent, handler, delegationFn) {
...
@@ -132,7 +132,7 @@ function normalizeParams(originalTypeEvent, handler, delegationFn) {
}
}
function
addHandler
(
element
,
originalTypeEvent
,
handler
,
delegationFn
,
oneOff
)
{
function
addHandler
(
element
,
originalTypeEvent
,
handler
,
delegationFn
,
oneOff
)
{
if
(
typeof
originalTypeEvent
!==
'
string
'
||
(
typeof
element
===
'
undefined
'
||
element
===
null
)
)
{
if
(
typeof
originalTypeEvent
!==
'
string
'
||
!
element
)
{
return
return
}
}
...
@@ -198,7 +198,7 @@ const EventHandler = {
...
@@ -198,7 +198,7 @@ const EventHandler = {
},
},
off
(
element
,
originalTypeEvent
,
handler
,
delegationFn
)
{
off
(
element
,
originalTypeEvent
,
handler
,
delegationFn
)
{
if
(
typeof
originalTypeEvent
!==
'
string
'
||
(
typeof
element
===
'
undefined
'
||
element
===
null
)
)
{
if
(
typeof
originalTypeEvent
!==
'
string
'
||
!
element
)
{
return
return
}
}
...
@@ -243,8 +243,7 @@ const EventHandler = {
...
@@ -243,8 +243,7 @@ const EventHandler = {
},
},
trigger
(
element
,
event
,
args
)
{
trigger
(
element
,
event
,
args
)
{
if
(
typeof
event
!==
'
string
'
||
if
(
typeof
event
!==
'
string
'
||
!
element
)
{
(
typeof
element
===
'
undefined
'
||
element
===
null
))
{
return
null
return
null
}
}
...
...
This diff is collapsed.
Click to expand it.
js/src/dom/manipulator.js
+
1
-
1
View file @
30861cbc
...
@@ -76,7 +76,7 @@ const Manipulator = {
...
@@ -76,7 +76,7 @@ const Manipulator = {
},
},
toggleClass
(
element
,
className
)
{
toggleClass
(
element
,
className
)
{
if
(
typeof
element
===
'
undefined
'
||
element
===
null
)
{
if
(
!
element
)
{
return
return
}
}
...
...
This diff is collapsed.
Click to expand it.
js/src/util.js
+
2
-
2
View file @
30861cbc
...
@@ -123,7 +123,7 @@ const Util = {
...
@@ -123,7 +123,7 @@ const Util = {
},
},
makeArray
(
nodeList
)
{
makeArray
(
nodeList
)
{
if
(
typeof
nodeList
===
'
undefined
'
||
nodeList
===
null
)
{
if
(
!
nodeList
)
{
return
[]
return
[]
}
}
...
@@ -131,7 +131,7 @@ const Util = {
...
@@ -131,7 +131,7 @@ const Util = {
},
},
isVisible
(
element
)
{
isVisible
(
element
)
{
if
(
typeof
element
===
'
undefined
'
||
element
===
null
)
{
if
(
!
element
)
{
return
false
return
false
}
}
...
...
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