mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Fix modified clicking of dirs, crumbs
All the default browser behavior when the user is holding any modifier key while clicking on a folder or breadcrumb in the fileview.
This commit is contained in:
parent
3de5e501f3
commit
611762b255
@ -365,6 +365,10 @@ define([
|
||||
breadcrumb.empty();
|
||||
var list_item = $('<li/>');
|
||||
var root = $('<li/>').append('<a href="/tree"><i class="fa fa-folder"></i></a>').click(function(e) {
|
||||
// Allow the default browser action when the user holds a modifier (e.g., Ctrl-Click)
|
||||
if(e.altKey || e.metaKey || e.shiftKey) {
|
||||
return true;
|
||||
}
|
||||
var path = '';
|
||||
window.history.pushState({
|
||||
path: path
|
||||
@ -383,6 +387,10 @@ define([
|
||||
utils.encode_uri_components(path)
|
||||
);
|
||||
var crumb = $('<li/>').append('<a href="' + url + '">' + path_part + '</a>').click(function(e) {
|
||||
// Allow the default browser action when the user holds a modifier (e.g., Ctrl-Click)
|
||||
if(e.altKey || e.metaKey || e.shiftKey) {
|
||||
return true;
|
||||
}
|
||||
window.history.pushState({
|
||||
path: path
|
||||
}, path, url);
|
||||
@ -810,8 +818,12 @@ define([
|
||||
link.attr('target', IPython._target);
|
||||
} else {
|
||||
// Replace with a click handler that will use the History API to
|
||||
// push a new route without reloading the page
|
||||
// push a new route without reloading the page if the click is
|
||||
// not modified (e.g., Ctrl-Click)
|
||||
link.click(function (e) {
|
||||
if(e.altKey || e.metaKey || e.shiftKey) {
|
||||
return true;
|
||||
}
|
||||
window.history.pushState({
|
||||
path: model.path
|
||||
}, model.path, utils.url_path_join(
|
||||
|
Loading…
Reference in New Issue
Block a user