Lines 317-322
$(document).ready(function() {
Link Here
|
317 |
} |
317 |
} |
318 |
}; |
318 |
}; |
319 |
|
319 |
|
|
|
320 |
var tabsInit = function( ui, illtable_el ) { |
321 |
localStorage.setItem( |
322 |
"illrequests_activetab", |
323 |
$( "#ill-requests-tabs" ).tabs( "option", "active" ) |
324 |
); |
325 |
|
326 |
var ill_dt = illtable_el.DataTable(); |
327 |
$.fn.dataTable.ext.search.pop(); |
328 |
ill_dt.draw(); |
329 |
|
330 |
if ( $( "#ill-requests-tabs" ).tabs( "option", "active" ) > 0 ) { |
331 |
// Initializing some other tab than "All" |
332 |
var ill_tab_statuses = $("#ill-requests-tabs>ul>li.ui-tabs-active>a").attr('data-statuses'); |
333 |
ill_tab_statuses = ill_tab_statuses.split("|"); |
334 |
|
335 |
// Only show rows having the status defined in ILLRequestsTabs system |
336 |
// preference in this tab |
337 |
$.fn.dataTable.ext.search.push( |
338 |
function(settings, data, dataIndex) { |
339 |
return ill_tab_statuses.indexOf(ill_dt.row(dataIndex).data().status) >= 0; |
340 |
} |
341 |
); |
342 |
ill_dt.draw(); |
343 |
} |
344 |
}; |
345 |
|
346 |
$('#ill-requests-tabs').tabs({ |
347 |
create: function(event,ui) { |
348 |
if ( $.fn.dataTable.isDataTable( 'table#ill-requests' ) ) { |
349 |
tabsInit(ui, $("table#ill-requests")); |
350 |
} |
351 |
}, |
352 |
activate: function(event,ui) { |
353 |
if ( $.fn.dataTable.isDataTable( 'table#ill-requests' ) ) { |
354 |
tabsInit(ui, $("table#ill-requests")); |
355 |
} |
356 |
} |
357 |
}); |
358 |
|
359 |
var activeTab = localStorage.getItem("illrequests_activetab"); |
360 |
if( activeTab ){ |
361 |
$("#ill-requests-tabs").tabs("option","active", activeTab ); |
362 |
} |
363 |
|
320 |
// Display the modal containing request supplier metadata |
364 |
// Display the modal containing request supplier metadata |
321 |
$('#ill-request-display-log').on('click', function(e) { |
365 |
$('#ill-request-display-log').on('click', function(e) { |
322 |
e.preventDefault(); |
366 |
e.preventDefault(); |
Lines 523-528
$(document).ready(function() {
Link Here
|
523 |
|
567 |
|
524 |
}); |
568 |
}); |
525 |
|
569 |
|
|
|
570 |
if( activeTab ){ |
571 |
if ( $.fn.dataTable.isDataTable( 'table#ill-requests' ) ) { |
572 |
tabsInit(null, $("table#ill-requests")); |
573 |
} |
574 |
} |
575 |
|
526 |
}); |
576 |
}); |
527 |
} //END if window.location.search.length == 0 |
577 |
} //END if window.location.search.length == 0 |
528 |
|
578 |
|