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
2dd085b4
Commit
2dd085b4
authored
Jan 13, 2017
by
Leopoldthecoder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
retire transitionend
parent
813de473
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
14 deletions
+15
-14
packages/loading/src/directive.js
packages/loading/src/directive.js
+2
-4
packages/loading/src/index.js
packages/loading/src/index.js
+6
-9
packages/loading/src/loading.vue
packages/loading/src/loading.vue
+7
-1
No files found.
packages/loading/src/directive.js
View file @
2dd085b4
...
...
@@ -36,8 +36,7 @@ exports.install = Vue => {
});
}
else
{
if
(
el
.
domVisible
)
{
const
destroyElement
=
function
()
{
el
.
mask
.
removeEventListener
(
'
transitionend
'
,
destroyElement
);
el
.
instance
.
$on
(
'
after-leave
'
,
_
=>
{
el
.
domVisible
=
false
;
if
(
binding
.
modifiers
.
fullscreen
&&
el
.
originalOverflow
!==
'
hidden
'
)
{
document
.
body
.
style
.
overflow
=
el
.
originalOverflow
;
...
...
@@ -47,8 +46,7 @@ exports.install = Vue => {
}
else
{
el
.
style
.
position
=
el
.
originalPosition
;
}
};
el
.
mask
.
addEventListener
(
'
transitionend
'
,
destroyElement
);
});
el
.
instance
.
visible
=
false
;
}
}
...
...
packages/loading/src/index.js
View file @
2dd085b4
...
...
@@ -17,14 +17,6 @@ let fullscreenLoading;
LoadingConstructor
.
prototype
.
originalPosition
=
''
;
LoadingConstructor
.
prototype
.
originalOverflow
=
''
;
const
destroyElement
=
function
()
{
this
.
$el
.
removeEventListener
(
'
transitionend
'
,
destroyElement
);
this
.
$el
&&
this
.
$el
.
parentNode
&&
this
.
$el
.
parentNode
.
removeChild
(
this
.
$el
);
this
.
$destroy
();
};
LoadingConstructor
.
prototype
.
close
=
function
()
{
if
(
this
.
fullscreen
&&
this
.
originalOverflow
!==
'
hidden
'
)
{
document
.
body
.
style
.
overflow
=
this
.
originalOverflow
;
...
...
@@ -37,7 +29,12 @@ LoadingConstructor.prototype.close = function() {
if
(
this
.
fullscreen
)
{
fullscreenLoading
=
undefined
;
}
this
.
$el
.
addEventListener
(
'
transitionend
'
,
destroyElement
.
bind
(
this
));
this
.
$on
(
'
after-leave
'
,
_
=>
{
this
.
$el
&&
this
.
$el
.
parentNode
&&
this
.
$el
.
parentNode
.
removeChild
(
this
.
$el
);
this
.
$destroy
();
});
this
.
visible
=
false
;
};
...
...
packages/loading/src/loading.vue
View file @
2dd085b4
<
template
>
<transition
name=
"el-loading-fade"
>
<transition
name=
"el-loading-fade"
@
after-leave=
"handleAfterLeave"
>
<div
v-show=
"visible"
class=
"el-loading-mask"
...
...
@@ -23,6 +23,12 @@
visible
:
false
,
customClass
:
''
};
},
methods
:
{
handleAfterLeave
()
{
this
.
$emit
(
'
after-leave
'
);
}
}
};
</
script
>
\ No newline at end of file
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