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