Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
723b2ab4
Commit
723b2ab4
authored
Jan 21, 2017
by
Leopoldthecoder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dialog: add modalAppendToBody
parent
20fabc7b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
1 deletion
+12
-1
examples/docs/en-US/dialog.md
examples/docs/en-US/dialog.md
+1
-0
examples/docs/zh-CN/dialog.md
examples/docs/zh-CN/dialog.md
+1
-0
packages/dialog/src/component.vue
packages/dialog/src/component.vue
+5
-0
src/utils/popup/index.js
src/utils/popup/index.js
+5
-1
No files found.
examples/docs/en-US/dialog.md
View file @
723b2ab4
...
...
@@ -164,6 +164,7 @@ The content of Dialog can be anything, even a table or a form. This example show
| size | size of Dialog | string | tiny/small/large/full | small |
| top | value for
`top`
of Dialog CSS, works when
`size`
is not
`full`
| string | — | 15% |
| modal | whether a mask is displayed | boolean | — | true |
| modalAppendToBody | whether to append modal to body element. If false, the modal will be appended to Dialog's parent element | boolean | — | true |
| lock-scroll | whether scroll of body is disabled while Dialog is displayed | boolean | — | true |
| custom-class | custom class names for Dialog | string | — | — |
| close-on-click-modal | whether the Dialog can be closed by clicking the mask | boolean | — | true |
...
...
examples/docs/zh-CN/dialog.md
View file @
723b2ab4
...
...
@@ -183,6 +183,7 @@ Dialog 组件的内容可以是任意的,甚至可以是表格或表单,下
| size | Dialog 的大小 | string | tiny/small/large/full | small |
| top | Dialog CSS 中的 top 值(仅在 size 不为 full 时有效) | string | — | 15% |
| modal | 是否需要遮罩层 | boolean | — | true |
| modalAppendToBody | 遮罩层是否插入至 body 元素上,若为 false,则遮罩层会插入至 Dialog 的父元素上 | boolean | — | true |
| lock-scroll | 是否在 Dialog 出现时将 body 滚动锁定 | boolean | — | true |
| custom-class | Dialog 的自定义类名 | string | — | — |
| close-on-click-modal | 是否可以通过点击 modal 关闭 Dialog | boolean | — | true |
...
...
packages/dialog/src/component.vue
View file @
723b2ab4
...
...
@@ -39,6 +39,11 @@
type
:
Boolean
,
default
:
true
},
modalAppendToBody
:
{
type
:
Boolean
,
default
:
true
},
lockScroll
:
{
type
:
Boolean
,
...
...
src/utils/popup/index.js
View file @
723b2ab4
...
...
@@ -93,6 +93,10 @@ export default {
},
modalClass
:
{
},
modalAppendToBody
:
{
type
:
Boolean
,
default
:
false
},
lockScroll
:
{
type
:
Boolean
,
default
:
true
...
...
@@ -208,7 +212,7 @@ export default {
PopupManager
.
closeModal
(
this
.
_popupId
);
this
.
_closing
=
false
;
}
PopupManager
.
openModal
(
this
.
_popupId
,
PopupManager
.
nextZIndex
(),
dom
,
props
.
modalClass
,
props
.
modalFade
);
PopupManager
.
openModal
(
this
.
_popupId
,
PopupManager
.
nextZIndex
(),
this
.
modalAppendToBody
?
undefined
:
dom
,
props
.
modalClass
,
props
.
modalFade
);
if
(
props
.
lockScroll
)
{
if
(
!
this
.
bodyOverflow
)
{
this
.
bodyPaddingRight
=
document
.
body
.
style
.
paddingRight
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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