Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drag and drop to open image #233

Merged
merged 6 commits into from
Feb 19, 2019

Conversation

will-moore
Copy link
Member

@will-moore will-moore commented Feb 6, 2019

Drag and drop a thumbnail onto centre panel to open image.

To test:

  • Drag a thumbnail into the centre panel of iviewer to perform same behaviour as double-clicking the thumbnail. You will enter multi-viewer mode (if you are not already in it)
  • If you are in multi-viewer mode, you can drag onto an existing viewer to replace the image there OR drag over the outer frame to open a new image viewer. See demo in https://twitter.com/will_j_moore/status/1093349075720626177

NB: Found some potential issues with current double-click behaviour (need to review in another PR):
If you have unsaved ROIs and you double-click or drag to open a different image to the one currently open, you will get a "Save ROIs" dialog etc. But, if you double-click or drag to open the same image that is currently open then you don't get a dialog until after the image has opened, so you have 2 viewers of the same image: the original one with unsaved ROIs and the new one with saved ROIs. This seems wrong to me, but the code and use-cases are quite convoluted so I don't want to start tackling that in this PR. Need to define supported workflows.

@will-moore will-moore changed the title Basic drag and drop to open image drag and drop to open image Feb 6, 2019
@jburel
Copy link
Member

jburel commented Feb 6, 2019

Nice feature. This will improve the discoverability of the multiview option

src/app/context.js Outdated Show resolved Hide resolved
@jburel
Copy link
Member

jburel commented Feb 7, 2019

  • I like the ability to replace the image in an existing viewer
  • Dragging an image to a desired location is not completely solved.

@pwalczysko
Copy link
Member

Really nice on Mac OS X FF.
Will give it a go on Win 7 tomorrow.

@snoopycrimecop
Copy link
Member

snoopycrimecop commented Feb 13, 2019

Conflicting PR. Removed from build iviewer-merge#953. See the console output for more details.
Possible conflicts:

--conflicts Conflict resolved in build iviewer-merge#954. See the console output for more details.

@pwalczysko
Copy link
Member

pwalczysko commented Feb 13, 2019

Unfortunately
Win 7, FF:

  • D & D works only when dropping into an existing window. This means, it will never open a new window as a result of a D&D, unlike on Mac.

Edit
on IE:

  • D & D has no effect on anything whatsoever

Edit2
on Chrome win 7

  • D & D has no effect, similar to IE

@pwalczysko
Copy link
Member

But, I have the same experience now on Mac -> D&D does not work - this was not the case - but something of this PR seems still to be there, as the pagination is still present - what is going on ?

@will-moore
Copy link
Member Author

Apologies @pwalczysko I think that this PR might have been excluded because of a merge conflict yesterday (hopefully resolved now).

@pwalczysko
Copy link
Member

So, after this PR is in the mix.

Win 7

  • Chrome works as expected (and fast)
  • Firefox works as expected (little bit slower than chrome)
  • IE does not work with D&D at all, no reaction

@pwalczysko
Copy link
Member

Interestingly, I have noticed on windwos, that in multi-view mode, you can interact (zoom, pan) with a window which is not active. The click into the window does not make the window active (which is highlighted by the color of the top bar of the window). Only the click on the bar itself is changing the color of the bar (darker blue for an active window).

It seems like unexpected behaviour. Do we have a card for this @will-moore ?

@will-moore
Copy link
Member Author

@pwalczysko The zoom on a non-active window has always been possible I think, but the click on the image should activate that viewer window. It's not Windows-specific (I see it on Mac + Chrome) and it's not from this PR. Probably a bug from the Openlayers update. I'll have a look when I get a chance.

@will-moore
Copy link
Member Author

Sorry, I should have mentioned that this is not expected to work in IE: https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem#Browser_compatibility
But since this feature is a short-cut rather than an essential workflow I think this is OK, and IE is only about 5% of browser market now.

@jburel
Copy link
Member

jburel commented Feb 18, 2019

The fact that it does not work onIE will have to be clearly stated in the announcement and changelog

@will-moore
Copy link
Member Author

Added it to the changelog in #238

@jburel jburel merged commit 899d2ed into ome:master Feb 19, 2019
@jburel jburel added this to the 0.7.0 milestone Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants