nzbin / photoviewer

🖼️ A JS plugin to view images just like in Windows.
https://nzbin.github.io/photoviewer/
MIT License
356 stars 55 forks source link

[Bug] Could not close window while loading image. #1

Closed kuoruan closed 5 years ago

kuoruan commented 6 years ago

I can't click the close button when the image is loading.

nzbin commented 6 years ago

@kuoruan It's not a bug, there has a layer div on top of modal when image is loading, you can customize the layer size as you like.

.photoviewer-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  text-align: center;
  color: #333;
}
kuoruan commented 6 years ago

Another: Can not drag the window after close => reopen the same PhotoViwer instance.

nzbin commented 6 years ago

@kuoruan I can't quite understand your issue. Can you describe more details?

kuoruan commented 6 years ago

Code

showData (data, index) {
    if (!this.viewer) {
        this.viewer = new PhotoViewer(data, {
          index: index > -1 ? index : 0
        })
      } else {
        this.viewer.groupData = data
        this.viewer.open()
        this.viewer.jumpTo(index > -1 ? index : 0)
      }
}

When this.viewer is undefined, create one, but when the viewer is exist, reset the groupData and reopen the view jumpTo index, I can't drag the view window.

nzbin commented 6 years ago

@kuoruan Can you give me a demo online?