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
b822b5a1
Commit
b822b5a1
authored
7 years ago
by
Johann-S
Browse files
Options
Download
Email Patches
Plain Diff
Remove placement attribute from our Dropdown plugin
parent
7983ba94
8 merge requests
!28721
Hot test
,
!27561
Adds font-weight-medium to font weight classes
,
!25494
web pack
,
!25326
Adjust examples
,
!23995
Add back cursor: pointer for .btn-link
,
!23973
aaaa
,
!23207
#22402 : modal: new autofocus & keyboardBtnNav options
,
!17021
v4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/4.0/components/dropdowns.md
+1
-9
docs/4.0/components/dropdowns.md
js/src/dropdown.js
+2
-9
js/src/dropdown.js
with
3 additions
and
18 deletions
+3
-18
docs/4.0/components/dropdowns.md
+
1
-
9
View file @
b822b5a1
...
...
@@ -574,7 +574,7 @@ Regardless of whether you call your dropdown via JavaScript or instead use the d
### Options
Options can be passed via data attributes or JavaScript. For data attributes, append the option name to
`data-`
, as in
`data-
placemen
t=""`
.
Options can be passed via data attributes or JavaScript. For data attributes, append the option name to
`data-`
, as in
`data-
offse
t=""`
.
<table
class=
"table table-bordered table-striped table-responsive"
>
<thead>
...
...
@@ -586,14 +586,6 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
</tr>
</thead>
<tbody>
<tr>
<td>
placement
</td>
<td>
string
</td>
<td>
'bottom'
</td>
<td>
<p>
How to position the popover - top | bottom.
</p>
</td>
</tr>
<tr>
<td>
offset
</td>
<td>
number | string
</td>
...
...
This diff is collapsed.
Click to expand it.
js/src/dropdown.js
+
2
-
9
View file @
b822b5a1
...
...
@@ -75,13 +75,11 @@ const Dropdown = (() => {
}
const
Default
=
{
placement
:
AttachmentMap
.
BOTTOM
,
offset
:
0
,
flip
:
true
}
const
DefaultType
=
{
placement
:
'
string
'
,
offset
:
'
(number|string)
'
,
flip
:
'
boolean
'
}
...
...
@@ -203,11 +201,6 @@ const Dropdown = (() => {
}
_getConfig
(
config
)
{
const
elementData
=
$
(
this
.
_element
).
data
()
if
(
typeof
elementData
.
placement
!==
'
undefined
'
)
{
elementData
.
placement
=
AttachmentMap
[
elementData
.
placement
.
toUpperCase
()]
}
config
=
$
.
extend
(
{},
this
.
constructor
.
Default
,
...
...
@@ -234,10 +227,10 @@ const Dropdown = (() => {
_getPlacement
()
{
const
$parentDropdown
=
$
(
this
.
_element
).
parent
()
let
placement
=
this
.
_config
.
pl
ac
e
ment
let
placement
=
Att
ac
h
ment
Map
.
BOTTOM
// Handle dropup
if
(
$parentDropdown
.
hasClass
(
ClassName
.
DROPUP
)
||
this
.
_config
.
placement
===
AttachmentMap
.
TOP
)
{
if
(
$parentDropdown
.
hasClass
(
ClassName
.
DROPUP
))
{
placement
=
AttachmentMap
.
TOP
if
(
$
(
this
.
_menu
).
hasClass
(
ClassName
.
MENURIGHT
))
{
placement
=
AttachmentMap
.
TOPEND
...
...
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