Merge pull request #7622 from jdfreder/uploadfix

Fix upload feature for new dashboard UI
pull/37/head
Thomas Kluyver 11 years ago
commit e7b54cb7e0

@ -8705,6 +8705,9 @@ ul.breadcrumb span {
.list_item > div input {
margin-right: 7px;
}
.new-file input[type=checkbox] {
visibility: hidden;
}
.item_name {
line-height: 22px;
height: 24px;

@ -355,7 +355,14 @@ define([
file: 'edit',
};
/**
* Handles when any row selector checkbox is toggled.
*/
NotebookList.prototype._selection_changed = function() {
// Use a JQuery selector to find each row with a checked checkbox. If
// we decide to add more checkboxes in the future, this code will need
// to be changed to distinguish which checkbox is the row selector.
var selected = [];
var has_running_notebook = false;
var has_directory = false;
@ -363,16 +370,22 @@ define([
var that = this;
$('.list_item :checked').each(function(index, item) {
var parent = $(item).parent().parent();
selected.push({
name: parent.data('name'),
path: parent.data('path'),
type: parent.data('type')
});
has_running_notebook = has_running_notebook ||
(parent.data('type') == 'notebook' && that.sessions[parent.data('path')] !== undefined);
has_file = has_file || parent.data('type') == 'file';
has_directory = has_directory || parent.data('type') == 'directory';
// If the item doesn't have an upload button, it can be selected.
if (parent.find('.upload_button').length === 0) {
selected.push({
name: parent.data('name'),
path: parent.data('path'),
type: parent.data('type')
});
// Set flags according to what is selected. Flags are later
// used to decide which action buttons are visible.
has_running_notebook = has_running_notebook ||
(parent.data('type') == 'notebook' && that.sessions[parent.data('path')] !== undefined);
has_file = has_file || parent.data('type') == 'file';
has_directory = has_directory || parent.data('type') == 'directory';
}
});
this.selected = selected;
@ -383,14 +396,15 @@ define([
$('.rename-button').css('display', 'none');
}
// Shutdown is only visible when one or more notebooks are visible.
// Shutdown is only visible when one or more notebooks running notebooks
// are selected and no non-notebook items are selected.
if (has_running_notebook && !(has_file || has_directory)) {
$('.shutdown-button').css('display', 'inline-block');
} else {
$('.shutdown-button').css('display', 'none');
}
// Duplicate isn't visible if a directory is selected.
// Duplicate isn't visible when a directory is selected.
if (selected.length > 0 && !has_directory) {
$('.duplicate-button').css('display', 'inline-block');
} else {
@ -704,7 +718,6 @@ define([
var on_success = function () {
item.removeClass('new-file');
that.add_link(model, item);
that.add_delete_button(item);
that.session_list.load_sessions();
};

@ -98,6 +98,10 @@ ul.breadcrumb {
}
}
.new-file input[type=checkbox] {
visibility: hidden;
}
.item_name {
line-height: @btn_mini_height;
height: @btn_small_height;

Loading…
Cancel
Save