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
68e6de42
Commit
68e6de42
authored
6 years ago
by
XhmikosR
Browse files
Options
Download
Email Patches
Plain Diff
Use `Util.makeArray()`.
parent
9fda96e1
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
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
js/src/carousel.js
+2
-2
js/src/carousel.js
js/src/dom/polyfill.js
+2
-2
js/src/dom/polyfill.js
js/src/dropdown.js
+1
-1
js/src/dropdown.js
js/src/index.js
+7
-7
js/src/index.js
js/src/tools/sanitizer.js
+4
-2
js/src/tools/sanitizer.js
with
16 additions
and
14 deletions
+16
-14
js/src/carousel.js
+
2
-
2
View file @
68e6de42
...
...
@@ -320,7 +320,7 @@ class Carousel {
}
}
[].
slice
.
call
(
SelectorEngine
.
find
(
Selector
.
ITEM_IMG
,
this
.
_element
)).
forEach
((
itemImg
)
=>
{
Util
.
makeArray
(
SelectorEngine
.
find
(
Selector
.
ITEM_IMG
,
this
.
_element
)).
forEach
((
itemImg
)
=>
{
EventHandler
.
on
(
itemImg
,
Event
.
DRAG_START
,
(
e
)
=>
e
.
preventDefault
())
})
...
...
@@ -356,7 +356,7 @@ class Carousel {
_getItemIndex
(
element
)
{
this
.
_items
=
element
&&
element
.
parentNode
?
[].
slice
.
call
(
SelectorEngine
.
find
(
Selector
.
ITEM
,
element
.
parentNode
))
?
Util
.
makeArray
(
SelectorEngine
.
find
(
Selector
.
ITEM
,
element
.
parentNode
))
:
[]
return
this
.
_items
.
indexOf
(
element
)
...
...
This diff is collapsed.
Click to expand it.
js/src/dom/polyfill.js
+
2
-
2
View file @
68e6de42
import
Util
from
'
../util
'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.3.1): dom/polyfill.js
...
...
@@ -7,6 +5,8 @@ import Util from '../util'
* --------------------------------------------------------------------------
*/
import
Util
from
'
../util
'
/* istanbul ignore next */
const
Polyfill
=
(()
=>
{
// MSEdge resets defaultPrevented flag upon dispatchEvent call if at least one listener is attached
...
...
This diff is collapsed.
Click to expand it.
js/src/dropdown.js
+
1
-
1
View file @
68e6de42
...
...
@@ -482,7 +482,7 @@ class Dropdown {
return
}
const
items
=
[].
slice
.
call
(
parent
.
querySelectorAll
(
Selector
.
VISIBLE_ITEMS
))
const
items
=
Util
.
makeArray
(
parent
.
querySelectorAll
(
Selector
.
VISIBLE_ITEMS
))
if
(
!
items
.
length
)
{
return
...
...
This diff is collapsed.
Click to expand it.
js/src/index.js
+
7
-
7
View file @
68e6de42
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.3.1): index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
import
Alert
from
'
./alert
'
import
Button
from
'
./button
'
import
Carousel
from
'
./carousel
'
...
...
@@ -11,13 +18,6 @@ import Toast from './toast'
import
Tooltip
from
'
./tooltip
'
import
Util
from
'
./util
'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.3.1): index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
export
{
Util
,
Alert
,
...
...
This diff is collapsed.
Click to expand it.
js/src/tools/sanitizer.js
+
4
-
2
View file @
68e6de42
...
...
@@ -5,6 +5,8 @@
* --------------------------------------------------------------------------
*/
import
Util
from
'
../util
'
const
uriAttrs
=
[
'
background
'
,
'
cite
'
,
...
...
@@ -101,7 +103,7 @@ export function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
const
domParser
=
new
window
.
DOMParser
()
const
createdDocument
=
domParser
.
parseFromString
(
unsafeHtml
,
'
text/html
'
)
const
whitelistKeys
=
Object
.
keys
(
whiteList
)
const
elements
=
[].
slice
.
call
(
createdDocument
.
body
.
querySelectorAll
(
'
*
'
))
const
elements
=
Util
.
makeArray
(
createdDocument
.
body
.
querySelectorAll
(
'
*
'
))
for
(
let
i
=
0
,
len
=
elements
.
length
;
i
<
len
;
i
++
)
{
const
el
=
elements
[
i
]
...
...
@@ -113,7 +115,7 @@ export function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
continue
}
const
attributeList
=
[].
slice
.
call
(
el
.
attributes
)
const
attributeList
=
Util
.
makeArray
(
el
.
attributes
)
const
whitelistedAttributes
=
[].
concat
(
whiteList
[
'
*
'
]
||
[],
whiteList
[
elName
]
||
[])
attributeList
.
forEach
((
attr
)
=>
{
...
...
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