Lines 604-634
function filterDataTable( table, column, term ){
Link Here
|
604 |
table.search( term ).draw("page"); |
604 |
table.search( term ).draw("page"); |
605 |
} |
605 |
} |
606 |
} |
606 |
} |
607 |
|
|
|
608 |
/* get_columns_saved_state checks for a DataTables configuration saved |
609 |
* in the browser's local storage. If it is present, the columns |
610 |
* configuration supplied by Koha is overwritten |
611 |
* |
612 |
* It takes two parameters: |
613 |
* - localstorage_config, the DataTables saved state object from local storage |
614 |
* - columns_settings, the columns settings object supplied by the template |
615 |
*/ |
616 |
|
617 |
function get_columns_saved_state( localstorage_config, columns_settings ){ |
618 |
var tables = JSON.parse( localstorage_config ); |
619 |
// if a table configuration was found in local storage, parse it |
620 |
if( tables ){ |
621 |
var stateSave_column_visibility = []; |
622 |
$(tables.columns).each(function(){ |
623 |
stateSave_column_visibility.push( this.visible === true ? 0 : 1 ); |
624 |
}); |
625 |
$.each( columns_settings, function( index, key ){ |
626 |
if( stateSave_column_visibility[ index ] !== columns_settings[key] ){ |
627 |
columns_settings[ index ].is_hidden = stateSave_column_visibility[ index ]; |
628 |
} |
629 |
}); |
630 |
return columns_settings; |
631 |
} else { |
632 |
return columns_settings; |
633 |
} |
634 |
} |
635 |
- |