-
Notifications
You must be signed in to change notification settings - Fork 949
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
Add utility function resolveUrl on manager #1993
Conversation
This is needed to be able to resolve file URLs relative to the widget's notebook.
Thanks @vidartf. This should solve https://github.com/ellisonbg/ipyleaflet/issues/120, which is exactly what you described. |
@astrofrog I think you also needed this a while back, and I gave you a dirty hack for it, this looks much cleaner |
Thanks! |
Should this have been using |
Or rather, in addition to. |
Mainly to be future proof in case anybody adds another Drive with an overridden getDownloadUrl. |
Good question. Can you open another issue so we can discuss, and possibly target to a 7.2.1? |
This is needed to be able to resolve file URLs relative to the widget's notebook.
Example: My widget needs to load an image at the path 'img/earth.jpg'. This is implied to be relative to the path of the current notebook (I cannot see a case where this wouldn't be what the user would expect, but I'm sure someone will come along at some point). In classic notebook, this works out of the box, since the url always incorporates the location of the notebook. For jupyter lab, this is not the case. By adding a utility function on the widget manger, we add a frontend-agnostic way of resolving the URL.