diff --git a/var/www/Flask_server.py b/var/www/Flask_server.py index 7a630ccc..ca6daa46 100755 --- a/var/www/Flask_server.py +++ b/var/www/Flask_server.py @@ -97,7 +97,7 @@ def event_stream_getImportantPasteByModule(module_name): data["date"] = curr_date data["char_to_display"] = max_preview_modal data["finished"] = True if index == len(all_pastes_list) else False - print index + time.sleep(0.002) #So that the front end client is not flooded by data yield 'data: %s\n\n' % json.dumps(data) diff --git a/var/www/templates/important_paste_by_module.html b/var/www/templates/important_paste_by_module.html index c1664283..3f3e3814 100644 --- a/var/www/templates/important_paste_by_module.html +++ b/var/www/templates/important_paste_by_module.html @@ -36,6 +36,7 @@ function deploy_source() { var curr_numElem = parseInt($("#myTable_"+moduleName).attr('data-numElem')); console.log(curr_numElem); if (feed.index > curr_numElem & feed.module == moduleName) { // Avoid doubling the pastes + // Add the row to the table search_table.row.add( [ feed.index, " "+ feed.path +"", @@ -151,7 +152,9 @@ $(document).ready(function(){ // Use to bind the button with the new displayed data // (The bind do not happens if the dataTable is in tabs and the clicked data is in another page) - $('#myTable').on( 'draw.dt', function () { + search_table.on( 'draw.dt', function () { + // Bind tooltip each time we draw a new page + $('[data-toggle="tooltip"]').tooltip(); // On click, get html content from url and update the corresponding modal $("[data-toggle='modal']").unbind('click.openmodal').on("click.openmodal", function (event) { event.preventDefault();