mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-27 00:07:16 +00:00
Partially solved the browser freezing problem + tootlip is also binded at a new page generation of the DataTable
This commit is contained in:
parent
acdd1367a3
commit
34221b083f
2 changed files with 5 additions and 2 deletions
|
@ -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 a new issue