Skip to content

Commit 30e0582

Browse files
committed
fix: fix the issue of title blinking when opening the same image again
Fix #609
1 parent c39b180 commit 30e0582

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## next
4+
5+
- Fix the issue of title blinking when opening the same image again (#609).
6+
37
## 1.11.4 (Jul 23, 2023)
48

59
- Fix the incorrect RegExp for Safari browser detection (#606).

src/js/others.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,6 @@ export default {
122122
this.clearEnforceFocus();
123123
}
124124

125-
this.fulled = false;
126-
this.viewed = false;
127-
this.isShown = false;
128125
this.close();
129126
this.unbind();
130127
addClass(viewer, CLASS_HIDE);
@@ -134,6 +131,9 @@ export default {
134131
viewer.setAttribute('aria-hidden', true);
135132
this.resetList();
136133
this.resetImage();
134+
this.fulled = false;
135+
this.viewed = false;
136+
this.isShown = false;
137137
this.hiding = false;
138138

139139
if (!this.destroyed) {

src/js/render.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -300,16 +300,16 @@ export default {
300300
},
301301

302302
resetImage() {
303-
// this.image only defined after viewed
304-
if (this.viewing || this.viewed) {
305-
const { image } = this;
303+
const { image } = this;
306304

305+
if (image) {
307306
if (this.viewing) {
308307
this.viewing.abort();
309308
}
310309

311310
image.parentNode.removeChild(image);
312311
this.image = null;
312+
this.title.innerHTML = '';
313313
}
314314
},
315315
};

0 commit comments

Comments
 (0)