mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Address comments,
Remove inverse, Deselect instead of unselect, Add separator.
This commit is contained in:
parent
4f3d5eb912
commit
fb88ecd55d
@ -126,8 +126,7 @@ define([
|
||||
$('#tree-selector .select-running-notebooks').click($.proxy(this.select_running_notebooks, this));
|
||||
$('#tree-selector .select-files').click($.proxy(this.select_files, this));
|
||||
$('#tree-selector .select-directories').click($.proxy(this.select_directories, this));
|
||||
$('#tree-selector .select-inverse').click($.proxy(this.select_inverse, this));
|
||||
$('#tree-selector .unselect-all').click($.proxy(this.unselect_all, this));
|
||||
$('#tree-selector .deselect-all').click($.proxy(this.deselect_all, this));
|
||||
}
|
||||
};
|
||||
|
||||
@ -379,7 +378,7 @@ define([
|
||||
* Select all of the notebooks in the tree.
|
||||
*/
|
||||
NotebookList.prototype.select_notebooks = function() {
|
||||
this.unselect_all();
|
||||
this.deselect_all();
|
||||
$('.list_item').each(function(index, item) {
|
||||
if ($(item).data('type') === 'notebook') {
|
||||
$(item).find('input[type=checkbox]').prop('checked', true);
|
||||
@ -392,7 +391,7 @@ define([
|
||||
* Select all of the running notebooks in the tree.
|
||||
*/
|
||||
NotebookList.prototype.select_running_notebooks = function() {
|
||||
this.unselect_all();
|
||||
this.deselect_all();
|
||||
var that = this;
|
||||
$('.list_item').each(function(index, item) {
|
||||
if ($(item).data('type') === 'notebook' && that.sessions[$(item).data('path')] !== undefined) {
|
||||
@ -406,7 +405,7 @@ define([
|
||||
* Select all of the files in the tree.
|
||||
*/
|
||||
NotebookList.prototype.select_files = function() {
|
||||
this.unselect_all();
|
||||
this.deselect_all();
|
||||
$('.list_item').each(function(index, item) {
|
||||
if ($(item).data('type') === 'file') {
|
||||
$(item).find('input[type=checkbox]').prop('checked', true);
|
||||
@ -419,7 +418,7 @@ define([
|
||||
* Select all of the directories in the tree.
|
||||
*/
|
||||
NotebookList.prototype.select_directories = function() {
|
||||
this.unselect_all();
|
||||
this.deselect_all();
|
||||
$('.list_item').each(function(index, item) {
|
||||
if ($(item).data('type') === 'directory') {
|
||||
$(item).find('input[type=checkbox]').prop('checked', true);
|
||||
@ -428,20 +427,10 @@ define([
|
||||
this._selection_changed();
|
||||
};
|
||||
|
||||
/**
|
||||
* Select the inverse of the current selection.
|
||||
*/
|
||||
NotebookList.prototype.select_inverse = function() {
|
||||
$('.list_item input[type=checkbox]').each(function(index, item) {
|
||||
$(item).prop('checked', !$(item).prop('checked'));
|
||||
});
|
||||
this._selection_changed();
|
||||
};
|
||||
|
||||
/**
|
||||
* Unselect everything selected in the tree.
|
||||
*/
|
||||
NotebookList.prototype.unselect_all = function() {
|
||||
NotebookList.prototype.deselect_all = function() {
|
||||
$('.list_item input[type=checkbox]').each(function(index, item) {
|
||||
$(item).prop('checked', false);
|
||||
});
|
||||
|
@ -76,7 +76,6 @@ data-terminals-available="{{terminals_available}}"
|
||||
</div>
|
||||
<div id="notebook_list">
|
||||
<div id="notebook_list_header" class="row list_header">
|
||||
|
||||
<div class="dropdown" id='tree-selector'>
|
||||
<button class="btn btn-default btn-xs dropdown-toggle" type="button" id="tree-selector-btn" data-toggle="dropdown" aria-expanded="true">
|
||||
<input type='checkbox'></input>
|
||||
@ -88,11 +87,10 @@ data-terminals-available="{{terminals_available}}"
|
||||
<li role="presentation" class="select-running-notebooks"><a role="menuitem" tabindex="-1" href="#">Select running notebooks</a></li>
|
||||
<li role="presentation" class="select-files"><a role="menuitem" tabindex="-1" href="#">Select files</a></li>
|
||||
<li role="presentation" class="select-directories"><a role="menuitem" tabindex="-1" href="#">Select directories</a></li>
|
||||
<li role="presentation" class="select-inverse"><a role="menuitem" tabindex="-1" href="#">Select inverse</a></li>
|
||||
<li role="presentation" class="unselect-all"><a role="menuitem" tabindex="-1" href="#">Unselect all</a></li>
|
||||
<li role="presentation" class="divider"></li>
|
||||
<li role="presentation" class="deselect-all"><a role="menuitem" tabindex="-1" href="#">Deselect all</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="project_name">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="{{breadcrumbs[0][0]}}"><i class="fa fa-home"></i></a></li>
|
||||
|
Loading…
Reference in New Issue
Block a user