##// END OF EJS Templates
Converting loops in *_all_output to $.map().
Brian E. Granger -
Show More
@@ -1183,13 +1183,11 b' var IPython = (function (IPython) {'
1183 1183 * @method collapse_all_output
1184 1184 */
1185 1185 Notebook.prototype.collapse_all_output = function () {
1186 var ncells = this.ncells();
1187 var cells = this.get_cells();
1188 for (var i=0; i<ncells; i++) {
1189 if (cells[i] instanceof IPython.CodeCell) {
1190 cells[i].collapse_output();
1186 $.map(this.get_cells(), function (cell, i) {
1187 if (cell instanceof IPython.CodeCell) {
1188 cell.collapse_output();
1191 1189 }
1192 };
1190 });
1193 1191 // this should not be set if the `collapse` key is removed from nbformat
1194 1192 this.set_dirty(true);
1195 1193 };
@@ -1215,13 +1213,11 b' var IPython = (function (IPython) {'
1215 1213 * @method expand_all_output
1216 1214 */
1217 1215 Notebook.prototype.expand_all_output = function () {
1218 var ncells = this.ncells();
1219 var cells = this.get_cells();
1220 for (var i=0; i<ncells; i++) {
1221 if (cells[i] instanceof IPython.CodeCell) {
1222 cells[i].expand_output();
1216 $.map(this.get_cells(), function (cell, i) {
1217 if (cell instanceof IPython.CodeCell) {
1218 cell.expand_output();
1223 1219 }
1224 };
1220 });
1225 1221 // this should not be set if the `collapse` key is removed from nbformat
1226 1222 this.set_dirty(true);
1227 1223 };
@@ -1247,13 +1243,11 b' var IPython = (function (IPython) {'
1247 1243 * @method clear_all_output
1248 1244 */
1249 1245 Notebook.prototype.clear_all_output = function () {
1250 var ncells = this.ncells();
1251 var cells = this.get_cells();
1252 for (var i=0; i<ncells; i++) {
1253 if (cells[i] instanceof IPython.CodeCell) {
1254 cells[i].clear_output();
1246 $.map(this.get_cells(), function (cell, i) {
1247 if (cell instanceof IPython.CodeCell) {
1248 cell.clear_output();
1255 1249 }
1256 };
1250 });
1257 1251 this.set_dirty(true);
1258 1252 };
1259 1253
@@ -1278,13 +1272,11 b' var IPython = (function (IPython) {'
1278 1272 * @method scroll_all_output
1279 1273 */
1280 1274 Notebook.prototype.scroll_all_output = function () {
1281 var ncells = this.ncells();
1282 var cells = this.get_cells();
1283 for (var i=0; i<ncells; i++) {
1284 if (cells[i] instanceof IPython.CodeCell) {
1285 cells[i].scroll_output();
1275 $.map(this.get_cells(), function (cell, i) {
1276 if (cell instanceof IPython.CodeCell) {
1277 cell.scroll_output();
1286 1278 }
1287 };
1279 });
1288 1280 // this should not be set if the `collapse` key is removed from nbformat
1289 1281 this.set_dirty(true);
1290 1282 };
General Comments 0
You need to be logged in to leave comments. Login now