Show More
@@ -84,23 +84,29 b' var IPython = (function (IPython) {' | |||||
84 |
|
84 | |||
85 | NotebookList.prototype.clear_list = function () { |
|
85 | NotebookList.prototype.clear_list = function () { | |
86 | this.element.children('.list_item').remove(); |
|
86 | this.element.children('.list_item').remove(); | |
87 | } |
|
87 | }; | |
88 |
|
88 | |||
89 |
|
89 | |||
90 | NotebookList.prototype.load_list = function () { |
|
90 | NotebookList.prototype.load_list = function () { | |
|
91 | var that = this; | |||
91 | var settings = { |
|
92 | var settings = { | |
92 | processData : false, |
|
93 | processData : false, | |
93 | cache : false, |
|
94 | cache : false, | |
94 | type : "GET", |
|
95 | type : "GET", | |
95 | dataType : "json", |
|
96 | dataType : "json", | |
96 | success : $.proxy(this.list_loaded, this) |
|
97 | success : $.proxy(this.list_loaded, this), | |
|
98 | error : $.proxy( function(){ | |||
|
99 | that.list_loaded([], null, null, {msg:"Error connecting to server."}); | |||
|
100 | },this) | |||
97 | }; |
|
101 | }; | |
|
102 | ||||
98 | var url = $('body').data('baseProjectUrl') + 'notebooks'; |
|
103 | var url = $('body').data('baseProjectUrl') + 'notebooks'; | |
99 | $.ajax(url, settings); |
|
104 | $.ajax(url, settings); | |
100 | }; |
|
105 | }; | |
101 |
|
106 | |||
102 |
|
107 | |||
103 | NotebookList.prototype.list_loaded = function (data, status, xhr) { |
|
108 | NotebookList.prototype.list_loaded = function (data, status, xhr, param) { | |
|
109 | var message = param.msg || 'Notebook list empty.'; | |||
104 | var len = data.length; |
|
110 | var len = data.length; | |
105 | this.clear_list(); |
|
111 | this.clear_list(); | |
106 |
|
112 | |||
@@ -109,7 +115,7 b' var IPython = (function (IPython) {' | |||||
109 | $(this.new_notebook_item(0)) |
|
115 | $(this.new_notebook_item(0)) | |
110 | .append( |
|
116 | .append( | |
111 | $('<div style="margin:auto;text-align:center;color:grey"/>') |
|
117 | $('<div style="margin:auto;text-align:center;color:grey"/>') | |
112 |
.text( |
|
118 | .text(message) | |
113 | ) |
|
119 | ) | |
114 | } |
|
120 | } | |
115 |
|
121 |
General Comments 0
You need to be logged in to leave comments.
Login now