mirror of https://github.com/ElemeFE/element
Message: fix close instace offsetHeight(#17564) (#17852)
parent
a78f4b9e5a
commit
7f4d7b0c8d
|
@ -58,8 +58,10 @@ const Message = function(options) {
|
|||
Message.close = function(id, userOnClose) {
|
||||
let len = instances.length;
|
||||
let index = -1;
|
||||
let removedHeight;
|
||||
for (let i = 0; i < len; i++) {
|
||||
if (id === instances[i].id) {
|
||||
removedHeight = instances[i].$el.offsetHeight;
|
||||
index = i;
|
||||
if (typeof userOnClose === 'function') {
|
||||
userOnClose(instances[i]);
|
||||
|
@ -69,7 +71,6 @@ Message.close = function(id, userOnClose) {
|
|||
}
|
||||
}
|
||||
if (len <= 1 || index === -1 || index > instances.length - 1) return;
|
||||
const removedHeight = instances[index].$el.offsetHeight;
|
||||
for (let i = index; i < len - 1 ; i++) {
|
||||
let dom = instances[i].$el;
|
||||
dom.style['top'] =
|
||||
|
|
Loading…
Reference in New Issue