Show More
@@ -233,27 +233,34 b' var IPython = (function (IPython) {' | |||
|
233 | 233 | }; |
|
234 | 234 | |
|
235 | 235 | MenuBar.prototype.update_restore_checkpoint = function(checkpoints) { |
|
236 | if (! checkpoints) { | |
|
237 | checkpoints = []; | |
|
236 | var ul = this.element.find("#restore_checkpoint").find("ul"); | |
|
237 | ul.empty(); | |
|
238 | if (! checkpoints || checkpoints.length == 0) { | |
|
239 | ul.append( | |
|
240 | $("<li/>") | |
|
241 | .addClass("disabled") | |
|
242 | .append( | |
|
243 | $("<a/>") | |
|
244 | .text("No checkpoints") | |
|
245 | ) | |
|
246 | ); | |
|
247 | return; | |
|
238 | 248 | }; |
|
239 | this.element.find("#restore_checkpoint").find("ul").find("li").each(function(i) { | |
|
240 | var li = $(this); | |
|
241 | var a = li.find("a"); | |
|
242 | a.off("click"); | |
|
243 | if (checkpoints.length <= i) { | |
|
244 | li.hide(); | |
|
245 | return; | |
|
246 | } else { | |
|
247 | li.show(); | |
|
248 | }; | |
|
249 | ||
|
250 | for (var i = 0; i < checkpoints.length; i++) { | |
|
249 | 251 | var checkpoint = checkpoints[i]; |
|
250 | 252 | var d = new Date(checkpoint.last_modified); |
|
251 |
l |
|
|
252 | d.format("mmm dd HH:MM:ss") | |
|
253 | ).click(function () { | |
|
254 | IPython.notebook.restore_checkpoint_dialog(checkpoint); | |
|
255 | }); | |
|
256 | }); | |
|
253 | ul.append( | |
|
254 | $("<li/>").append( | |
|
255 | $("<a/>") | |
|
256 | .attr("href", "#") | |
|
257 | .text(d.format("mmm dd HH:MM:ss")) | |
|
258 | .click(function () { | |
|
259 | IPython.notebook.restore_checkpoint_dialog(checkpoint); | |
|
260 | }) | |
|
261 | ) | |
|
262 | ); | |
|
263 | }; | |
|
257 | 264 | }; |
|
258 | 265 | |
|
259 | 266 | IPython.MenuBar = MenuBar; |
General Comments 0
You need to be logged in to leave comments.
Login now