DigitalSlideArchive / girder_volview

Other
2 stars 2 forks source link

Console error on some pages #30

Closed manthey closed 3 months ago

manthey commented 3 months ago

If you open the hierarchy widget to select a folder, this code https://github.com/DigitalSlideArchive/girder_volview/blob/main/girder_volview/web_client/views/itemPage.js#L9 can cause a console error, because there is no element with the open-in-volview class. Perhaps if should check if (buttons.length) before binding the onclick handler.

PaulHax commented 3 months ago

Thanks for finding this! Unfortunately I cannot =) What steps are you taking to "open the hierarchy widget to select a folder"? I'm just:

  1. Clicking on Collections
  2. Clicking HistomicsTK Tests collection
  3. Clicking images folder.
  4. Clicking into an item.

Is there another way to pop up the hierarchy widget to "select a folder"?

Happy to toss a buttons.length check in there, but wondering if the button should actualy be there and I should change my selector?

If its is the hierarchy widget Open Folder button causing problems, would fix here: https://github.com/DigitalSlideArchive/girder_volview/blob/main/girder_volview/web_client/views/HierarchyWidget.js#L43-L46

manthey commented 3 months ago

Specifically, I was doing an assetstore import and selected on the "Destination ID" folder icon. I don't think the special open buttons should ever be in a hierarchy widget. In other code I guard against adding buttons inside dialogs like so: if (!this.$el.closest('.modal-dialog').length) {