Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
gnestor committed Jan 25, 2017
1 parent 8081da7 commit e5dedde
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions notebook/static/tree/js/notebooklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,9 @@ define([
$('.rename-button').css('display', 'none');
}

// Move is visible iff at least one item is selected, and none of them
// Move is visible if at least one item is selected, and none of them
// are a running notebook.
if (selected.length >= 1 && !has_running_notebook) {
if (selected.length > 0 && !has_running_notebook) {
$('.move-button').css('display', 'inline-block');
} else {
$('.move-button').css('display', 'none');
Expand Down Expand Up @@ -905,7 +905,7 @@ define([

var item_path = that.selected[0].path;

window.open(utils.url_path_join(that.base_url, 'files', item_path) + '?download=1');
window.open(utils.url_path_join(that.base_url, 'files', utils.encode_uri_components(item_path)) + '?download=1', IPython._target);
};

NotebookList.prototype.delete_selected = function() {
Expand Down Expand Up @@ -959,17 +959,19 @@ define([
var that = this;
that.selected.forEach(function(item) {
var item_path = utils.encode_uri_components(item.path);
// Handle HTML files differently
var item_type = item_path.endsWith('.html') ? 'view' : 'files';
var w = window.open(utils.url_path_join(that.base_url, item_type, utils.encode_uri_components(item_path)), IPython._target);
window.open(utils.url_path_join(that.base_url, item_type, utils.encode_uri_components(item_path)), IPython._target);
});
};

NotebookList.prototype.edit_selected = function() {
var that = this;
that.selected.forEach(function(item) {
var item_path = utils.encode_uri_components(item.path);
// Handle ipynb files differently
var item_type = item_path.endsWith('.ipynb') ? 'notebooks' : 'edit';
var w = window.open(utils.url_path_join(that.base_url, item_type, utils.encode_uri_components(item_path)), IPython._target);
window.open(utils.url_path_join(that.base_url, item_type, utils.encode_uri_components(item_path)), IPython._target);
});
};

Expand Down

0 comments on commit e5dedde

Please sign in to comment.