mirror of
https://github.com/jupyter/notebook.git
synced 2025-04-12 14:00:27 +08:00
prevent autorefresh when pending upload
don't clear list if 'upload' button are present to avoid clearing the list and the upload form
This commit is contained in:
parent
a6f78c90b3
commit
13cf61912b
@ -260,6 +260,7 @@ var IPython = (function (IPython) {
|
||||
var that = this;
|
||||
var new_buttons = $('<span/>').addClass('item_buttons');
|
||||
var upload_button = $('<button>Upload</button>').button().
|
||||
addClass('upload-button').
|
||||
click(function (e) {
|
||||
var nbname = item.find('.item_name > input').attr('value');
|
||||
var nbformat = item.data('nbformat');
|
||||
|
@ -37,12 +37,18 @@ $(document).ready(function () {
|
||||
|
||||
var enable_autorefresh = function(){
|
||||
//refresh immediately , then start interval
|
||||
IPython.notebook_list.load_list();
|
||||
IPython.cluster_list.load_list();
|
||||
if($('upload_button').length == 0)
|
||||
{
|
||||
IPython.notebook_list.load_list();
|
||||
IPython.cluster_list.load_list();
|
||||
}
|
||||
if (!interval_id){
|
||||
interval_id = setInterval(function(){
|
||||
IPython.notebook_list.load_list();
|
||||
IPython.cluster_list.load_list();
|
||||
if($('upload_button').length == 0)
|
||||
{
|
||||
IPython.notebook_list.load_list();
|
||||
IPython.cluster_list.load_list();
|
||||
}
|
||||
}, time_refresh*1000);
|
||||
}
|
||||
}
|
||||
@ -65,6 +71,9 @@ $(document).ready(function () {
|
||||
// finally start it, it will refresh immediately
|
||||
enable_autorefresh();
|
||||
|
||||
IPython.enable_autorefresh = enable_autorefresh;
|
||||
IPython.disable_autorefresh = disable_autorefresh;
|
||||
|
||||
IPython.page.show();
|
||||
|
||||
// bound the upload method to the on change of the file select list
|
||||
|
Loading…
x
Reference in New Issue
Block a user