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

Add utility function resolveUrl on manager #1993

Merged
merged 1 commit into from
Mar 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/base/src/manager-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,16 @@ abstract class ManagerBase<T> {
this._models[i].then(model => { model.comm_live = false; });
});
}

/**
* Resolve a URL relative to the current notebook location.
*
* The default implementation just returns the original url.
*/
resolveUrl(url: string): Promise<string> {
return Promise.resolve(url);
}

/**
* The comm target name to register
*/
Expand Down
7 changes: 7 additions & 0 deletions packages/jupyterlab-manager/src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,13 @@ class WidgetManager extends ManagerBase<Widget> implements IDisposable {
this._context = null;
}

/**
* Resolve a URL relative to the current notebook location.
*/
resolveUrl(url: string): Promise<string> {
return this.context.resolveUrl(url);
}

/**
* Load a class and return a promise to the loaded object.
*/
Expand Down