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
94a5d87e
Commit
94a5d87e
authored
4 years ago
by
XhmikosR
Browse files
Options
Download
Email Patches
Plain Diff
Unbreak short lines
parent
9f9e4d04
1 merge request
!31948
Examples/Floating-labels: fix bad behavior with autofill
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
js/src/alert.js
+1
-2
js/src/alert.js
js/src/dom/event-handler.js
+23
-27
js/src/dom/event-handler.js
js/src/dropdown.js
+1
-5
js/src/dropdown.js
js/src/toast.js
+1
-5
js/src/toast.js
js/src/tooltip.js
+1
-5
js/src/tooltip.js
js/src/util/index.js
+14
-15
js/src/util/index.js
with
41 additions
and
59 deletions
+41
-59
js/src/alert.js
+
1
-
2
View file @
94a5d87e
...
...
@@ -100,8 +100,7 @@ class Alert {
const
transitionDuration
=
getTransitionDurationFromElement
(
element
)
EventHandler
.
one
(
element
,
TRANSITION_END
,
()
=>
this
.
_destroyElement
(
element
))
EventHandler
.
one
(
element
,
TRANSITION_END
,
()
=>
this
.
_destroyElement
(
element
))
emulateTransitionEnd
(
element
,
transitionDuration
)
}
...
...
This diff is collapsed.
Click to expand it.
js/src/dom/event-handler.js
+
23
-
27
View file @
94a5d87e
...
...
@@ -207,14 +207,13 @@ function removeHandler(element, events, typeEvent, handler, delegationSelector)
function
removeNamespacedHandlers
(
element
,
events
,
typeEvent
,
namespace
)
{
const
storeElementEvent
=
events
[
typeEvent
]
||
{}
Object
.
keys
(
storeElementEvent
)
.
forEach
(
handlerKey
=>
{
if
(
handlerKey
.
indexOf
(
namespace
)
>
-
1
)
{
const
event
=
storeElementEvent
[
handlerKey
]
Object
.
keys
(
storeElementEvent
).
forEach
(
handlerKey
=>
{
if
(
handlerKey
.
indexOf
(
namespace
)
>
-
1
)
{
const
event
=
storeElementEvent
[
handlerKey
]
removeHandler
(
element
,
events
,
typeEvent
,
event
.
originalHandler
,
event
.
delegationSelector
)
}
})
removeHandler
(
element
,
events
,
typeEvent
,
event
.
originalHandler
,
event
.
delegationSelector
)
}
})
}
const
EventHandler
=
{
...
...
@@ -247,23 +246,21 @@ const EventHandler = {
}
if
(
isNamespace
)
{
Object
.
keys
(
events
)
.
forEach
(
elementEvent
=>
{
removeNamespacedHandlers
(
element
,
events
,
elementEvent
,
originalTypeEvent
.
slice
(
1
))
})
Object
.
keys
(
events
).
forEach
(
elementEvent
=>
{
removeNamespacedHandlers
(
element
,
events
,
elementEvent
,
originalTypeEvent
.
slice
(
1
))
})
}
const
storeElementEvent
=
events
[
typeEvent
]
||
{}
Object
.
keys
(
storeElementEvent
)
.
forEach
(
keyHandlers
=>
{
const
handlerKey
=
keyHandlers
.
replace
(
stripUidRegex
,
''
)
Object
.
keys
(
storeElementEvent
).
forEach
(
keyHandlers
=>
{
const
handlerKey
=
keyHandlers
.
replace
(
stripUidRegex
,
''
)
if
(
!
inNamespace
||
originalTypeEvent
.
indexOf
(
handlerKey
)
>
-
1
)
{
const
event
=
storeElementEvent
[
keyHandlers
]
if
(
!
inNamespace
||
originalTypeEvent
.
indexOf
(
handlerKey
)
>
-
1
)
{
const
event
=
storeElementEvent
[
keyHandlers
]
removeHandler
(
element
,
events
,
typeEvent
,
event
.
originalHandler
,
event
.
delegationSelector
)
}
})
removeHandler
(
element
,
events
,
typeEvent
,
event
.
originalHandler
,
event
.
delegationSelector
)
}
})
},
trigger
(
element
,
event
,
args
)
{
...
...
@@ -300,16 +297,15 @@ const EventHandler = {
})
}
// merge custom information
s
in our event
// merge custom information in our event
if
(
typeof
args
!==
'
undefined
'
)
{
Object
.
keys
(
args
)
.
forEach
(
key
=>
{
Object
.
defineProperty
(
evt
,
key
,
{
get
()
{
return
args
[
key
]
}
})
Object
.
keys
(
args
).
forEach
(
key
=>
{
Object
.
defineProperty
(
evt
,
key
,
{
get
()
{
return
args
[
key
]
}
})
})
}
if
(
defaultPrevented
)
{
...
...
This diff is collapsed.
Click to expand it.
js/src/dropdown.js
+
1
-
5
View file @
94a5d87e
...
...
@@ -262,11 +262,7 @@ class Dropdown {
...
config
}
typeCheckConfig
(
NAME
,
config
,
this
.
constructor
.
DefaultType
)
typeCheckConfig
(
NAME
,
config
,
this
.
constructor
.
DefaultType
)
return
config
}
...
...
This diff is collapsed.
Click to expand it.
js/src/toast.js
+
1
-
5
View file @
94a5d87e
...
...
@@ -172,11 +172,7 @@ class Toast {
...
typeof
config
===
'
object
'
&&
config
?
config
:
{}
}
typeCheckConfig
(
NAME
,
config
,
this
.
constructor
.
DefaultType
)
typeCheckConfig
(
NAME
,
config
,
this
.
constructor
.
DefaultType
)
return
config
}
...
...
This diff is collapsed.
Click to expand it.
js/src/tooltip.js
+
1
-
5
View file @
94a5d87e
...
...
@@ -708,11 +708,7 @@ class Tooltip {
config
.
content
=
config
.
content
.
toString
()
}
typeCheckConfig
(
NAME
,
config
,
this
.
constructor
.
DefaultType
)
typeCheckConfig
(
NAME
,
config
,
this
.
constructor
.
DefaultType
)
if
(
config
.
sanitize
)
{
config
.
template
=
sanitizeHtml
(
config
.
template
,
config
.
whiteList
,
config
.
sanitizeFn
)
...
...
This diff is collapsed.
Click to expand it.
js/src/util/index.js
+
14
-
15
View file @
94a5d87e
...
...
@@ -110,21 +110,20 @@ const emulateTransitionEnd = (element, duration) => {
}
const
typeCheckConfig
=
(
componentName
,
config
,
configTypes
)
=>
{
Object
.
keys
(
configTypes
)
.
forEach
(
property
=>
{
const
expectedTypes
=
configTypes
[
property
]
const
value
=
config
[
property
]
const
valueType
=
value
&&
isElement
(
value
)
?
'
element
'
:
toType
(
value
)
if
(
!
new
RegExp
(
expectedTypes
).
test
(
valueType
))
{
throw
new
Error
(
`
${
componentName
.
toUpperCase
()}
: `
+
`Option "
${
property
}
" provided type "
${
valueType
}
" `
+
`but expected type "
${
expectedTypes
}
".`
)
}
})
Object
.
keys
(
configTypes
).
forEach
(
property
=>
{
const
expectedTypes
=
configTypes
[
property
]
const
value
=
config
[
property
]
const
valueType
=
value
&&
isElement
(
value
)
?
'
element
'
:
toType
(
value
)
if
(
!
new
RegExp
(
expectedTypes
).
test
(
valueType
))
{
throw
new
Error
(
`
${
componentName
.
toUpperCase
()}
: `
+
`Option "
${
property
}
" provided type "
${
valueType
}
" `
+
`but expected type "
${
expectedTypes
}
".`
)
}
})
}
const
isVisible
=
element
=>
{
...
...
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