Merge pull request #6735 from Carreau/native-map

Use native map when possible
This commit is contained in:
Min RK 2014-11-12 16:31:51 -08:00
commit 0f8127c36f

View File

@ -1337,7 +1337,7 @@ define([
* @method collapse_all_output
*/
Notebook.prototype.collapse_all_output = function () {
$.map(this.get_cells(), function (cell, i) {
this.get_cells().map(function (cell, i) {
if (cell instanceof codecell.CodeCell) {
cell.collapse_output();
}
@ -1367,7 +1367,7 @@ define([
* @method expand_all_output
*/
Notebook.prototype.expand_all_output = function () {
$.map(this.get_cells(), function (cell, i) {
this.get_cells().map(function (cell, i) {
if (cell instanceof codecell.CodeCell) {
cell.expand_output();
}
@ -1397,7 +1397,7 @@ define([
* @method clear_all_output
*/
Notebook.prototype.clear_all_output = function () {
$.map(this.get_cells(), function (cell, i) {
this.get_cells().map(function (cell, i) {
if (cell instanceof codecell.CodeCell) {
cell.clear_output();
}
@ -1426,7 +1426,7 @@ define([
* @method scroll_all_output
*/
Notebook.prototype.scroll_all_output = function () {
$.map(this.get_cells(), function (cell, i) {
this.get_cells().map(function (cell, i) {
if (cell instanceof codecell.CodeCell) {
cell.scroll_output();
}
@ -1455,7 +1455,7 @@ define([
* @method toggle_all_output
*/
Notebook.prototype.toggle_all_output = function () {
$.map(this.get_cells(), function (cell, i) {
this.get_cells().map(function (cell, i) {
if (cell instanceof codecell.CodeCell) {
cell.toggle_output();
}
@ -1485,7 +1485,7 @@ define([
* @method toggle_all_output_scrolling
*/
Notebook.prototype.toggle_all_output_scroll = function () {
$.map(this.get_cells(), function (cell, i) {
this.get_cells().map(function (cell, i) {
if (cell instanceof codecell.CodeCell) {
cell.toggle_output_scroll();
}
@ -1521,7 +1521,7 @@ define([
var that = this;
utils.requireCodeMirrorMode(modename, function () {
$.map(that.get_cells(), function(cell, i) {
that.get_cells().map(function(cell, i) {
if (cell.cell_type === 'code'){
cell.code_mirror.setOption('mode', newmode);
// This is currently redundant, because cm_config ends up as