Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/components/modal/modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import { on, off } from '../../utils/dom';
import { findComponentsDownward } from '../../utils/assist';

import { transferIndex as modalIndex, transferIncrease as modalIncrease } from '../../utils/transfer-queue';
import { transferIndex as modalIndex, transferIncrease as modalIncrease, lastVisibleIndex, lastVisibleIncrease } from '../../utils/transfer-queue';

const prefixCls = 'ivu-modal';

Expand Down Expand Up @@ -343,6 +343,10 @@
},
handleClickModal () {
if (this.draggable) {
if (lastVisibleIndex !== this.lastVisibleIndex){
this.lastVisibleIndex = lastVisibleIndex;
return;
}
this.modalIndex = this.handleGetModalIndex();
}
}
Expand Down Expand Up @@ -379,7 +383,10 @@
this.removeScrollEffect();
}, 300);
} else {
this.modalIndex = this.handleGetModalIndex();
if (this.lastVisible !== val) {
this.modalIndex = this.handleGetModalIndex();
lastVisibleIncrease();
}

if (this.timer) clearTimeout(this.timer);
this.wrapShow = true;
Expand All @@ -390,6 +397,8 @@
this.broadcast('Table', 'on-visible-change', val);
this.broadcast('Slider', 'on-visible-change', val); // #2852
this.$emit('on-visible-change', val);
this.lastVisible = val;
this.lastVisibleIndex = lastVisibleIndex;
},
loading (val) {
if (!val) {
Expand Down
7 changes: 6 additions & 1 deletion src/utils/transfer-queue.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
let transferIndex = 0;
let lastVisibleIndex = 0;

function transferIncrease() {
transferIndex++;
}

export {transferIndex, transferIncrease};
function lastVisibleIncrease() {
lastVisibleIndex++;
}

export { transferIndex, transferIncrease, lastVisibleIndex, lastVisibleIncrease };