mirror of https://github.com/CIRCL/AIL-framework
Partially solved the browser freezing problem + tootlip is also binded at a new page generation of the DataTable
parent
acdd1367a3
commit
34221b083f
|
@ -97,7 +97,7 @@ def event_stream_getImportantPasteByModule(module_name):
|
||||||
data["date"] = curr_date
|
data["date"] = curr_date
|
||||||
data["char_to_display"] = max_preview_modal
|
data["char_to_display"] = max_preview_modal
|
||||||
data["finished"] = True if index == len(all_pastes_list) else False
|
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)
|
yield 'data: %s\n\n' % json.dumps(data)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ function deploy_source() {
|
||||||
var curr_numElem = parseInt($("#myTable_"+moduleName).attr('data-numElem'));
|
var curr_numElem = parseInt($("#myTable_"+moduleName).attr('data-numElem'));
|
||||||
console.log(curr_numElem);
|
console.log(curr_numElem);
|
||||||
if (feed.index > curr_numElem & feed.module == moduleName) { // Avoid doubling the pastes
|
if (feed.index > curr_numElem & feed.module == moduleName) { // Avoid doubling the pastes
|
||||||
|
// Add the row to the table
|
||||||
search_table.row.add( [
|
search_table.row.add( [
|
||||||
feed.index,
|
feed.index,
|
||||||
"<a target=\"_blank\" href=\"{{ url_for('showsavedpaste') }}?paste="+feed.path+"&num="+feed.index+"\"> "+ feed.path +"</a>",
|
"<a target=\"_blank\" href=\"{{ url_for('showsavedpaste') }}?paste="+feed.path+"&num="+feed.index+"\"> "+ feed.path +"</a>",
|
||||||
|
@ -151,7 +152,9 @@ $(document).ready(function(){
|
||||||
|
|
||||||
// Use to bind the button with the new displayed data
|
// 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)
|
// (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
|
// On click, get html content from url and update the corresponding modal
|
||||||
$("[data-toggle='modal']").unbind('click.openmodal').on("click.openmodal", function (event) {
|
$("[data-toggle='modal']").unbind('click.openmodal').on("click.openmodal", function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
Loading…
Reference in New Issue