##// END OF EJS Templates
prevent autorefresh when pending upload...
Matthias BUSSONNIER -
Show More
@@ -260,6 +260,7 b' var IPython = (function (IPython) {'
260 var that = this;
260 var that = this;
261 var new_buttons = $('<span/>').addClass('item_buttons');
261 var new_buttons = $('<span/>').addClass('item_buttons');
262 var upload_button = $('<button>Upload</button>').button().
262 var upload_button = $('<button>Upload</button>').button().
263 addClass('upload-button').
263 click(function (e) {
264 click(function (e) {
264 var nbname = item.find('.item_name > input').attr('value');
265 var nbname = item.find('.item_name > input').attr('value');
265 var nbformat = item.data('nbformat');
266 var nbformat = item.data('nbformat');
@@ -37,12 +37,18 b' $(document).ready(function () {'
37
37
38 var enable_autorefresh = function(){
38 var enable_autorefresh = function(){
39 //refresh immediately , then start interval
39 //refresh immediately , then start interval
40 IPython.notebook_list.load_list();
40 if($('upload_button').length == 0)
41 IPython.cluster_list.load_list();
41 {
42 IPython.notebook_list.load_list();
43 IPython.cluster_list.load_list();
44 }
42 if (!interval_id){
45 if (!interval_id){
43 interval_id = setInterval(function(){
46 interval_id = setInterval(function(){
44 IPython.notebook_list.load_list();
47 if($('upload_button').length == 0)
45 IPython.cluster_list.load_list();
48 {
49 IPython.notebook_list.load_list();
50 IPython.cluster_list.load_list();
51 }
46 }, time_refresh*1000);
52 }, time_refresh*1000);
47 }
53 }
48 }
54 }
@@ -65,6 +71,9 b' $(document).ready(function () {'
65 // finally start it, it will refresh immediately
71 // finally start it, it will refresh immediately
66 enable_autorefresh();
72 enable_autorefresh();
67
73
74 IPython.enable_autorefresh = enable_autorefresh;
75 IPython.disable_autorefresh = disable_autorefresh;
76
68 IPython.page.show();
77 IPython.page.show();
69
78
70 // bound the upload method to the on change of the file select list
79 // bound the upload method to the on change of the file select list
General Comments 0
You need to be logged in to leave comments. Login now