diff --git a/notebook/static/notebook/js/maintoolbar.js b/notebook/static/notebook/js/maintoolbar.js
index 1be0d42ce..31b4bdb67 100644
--- a/notebook/static/notebook/js/maintoolbar.js
+++ b/notebook/static/notebook/js/maintoolbar.js
@@ -89,6 +89,7 @@ define([
// encountered when building a toolbar.
MainToolBar.prototype._pseudo_actions.add_celltype_list = function () {
var that = this;
+ var multiselect = $('').attr('value','multiselect').attr('disabled','').text('-');
var sel = $('')
.attr('id','cell_type')
.addClass('form-control select-xs')
@@ -96,13 +97,19 @@ define([
.append($('').attr('value','markdown').text('Markdown'))
.append($('').attr('value','raw').text('Raw NBConvert'))
.append($('').attr('value','heading').text('Heading'))
- .append($('').attr('value','multiselect').text('-'));
+ .append(multiselect);
this.notebook.keyboard_manager.register_events(sel);
this.events.on('selected_cell_type_changed.Notebook', function (event, data) {
- if (data.cell_type === 'heading') {
- sel.val('Markdown');
+ if ( that.notebook.get_selected_cells_indices().length > 1) {
+ multiselect.show();
+ sel.val('multiselect');
+ multiselect.hide();
} else {
- sel.val(data.cell_type);
+ if (data.cell_type === 'heading') {
+ sel.val('Markdown');
+ } else {
+ sel.val(data.cell_type);
+ }
}
});
sel.change(function () {
diff --git a/notebook/static/notebook/js/notebook.js b/notebook/static/notebook/js/notebook.js
index fca65f0cd..b7c07bdef 100644
--- a/notebook/static/notebook/js/notebook.js
+++ b/notebook/static/notebook/js/notebook.js
@@ -709,6 +709,7 @@ define(function (require) {
}
var cell = this.get_cell(index);
cell.select(moveanchor);
+ this.update_soft_selection();
if (cell.cell_type === 'heading') {
this.events.trigger('selected_cell_type_changed.Notebook',
{'cell_type':cell.cell_type,level:cell.level}
@@ -719,7 +720,6 @@ define(function (require) {
);
}
}
- this.update_soft_selection();
return this;
};