mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 20:52:56 +01:00
Prevent reloading page when showing/hiding archived
This commit is contained in:
parent
06fa2e5dc4
commit
6b64910c9d
@ -117,13 +117,7 @@ class AccountController extends BaseController
|
||||
{
|
||||
Session::put("show_trash:{$entityType}", $visible == 'true');
|
||||
|
||||
if ($entityType == 'user') {
|
||||
return Redirect::to('settings/'.ACCOUNT_USER_MANAGEMENT);
|
||||
} elseif ($entityType == 'token') {
|
||||
return Redirect::to('settings/'.ACCOUNT_API_TOKENS);
|
||||
} else {
|
||||
return Redirect::to("{$entityType}s");
|
||||
}
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
public function getSearchData()
|
||||
|
@ -42,9 +42,13 @@
|
||||
|
||||
function setTrashVisible() {
|
||||
var checked = $('#trashed').is(':checked');
|
||||
window.location = '{!! URL::to('view_archive/token') !!}' + (checked ? '/true' : '/false');
|
||||
var url = '{{ URL::to('view_archive/token') }}' + (checked ? '/true' : '/false');
|
||||
|
||||
$.get(url, function(data) {
|
||||
refreshDatatable();
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@stop
|
||||
|
@ -39,7 +39,11 @@
|
||||
|
||||
function setTrashVisible() {
|
||||
var checked = $('#trashed').is(':checked');
|
||||
window.location = '{!! URL::to('view_archive/user') !!}' + (checked ? '/true' : '/false');
|
||||
var url = '{{ URL::to('view_archive/user') }}' + (checked ? '/true' : '/false');
|
||||
|
||||
$.get(url, function(data) {
|
||||
refreshDatatable();
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -42,8 +42,12 @@
|
||||
});
|
||||
@endif
|
||||
|
||||
function refreshDatatable() {
|
||||
window.dataTable.api().ajax.reload();
|
||||
}
|
||||
|
||||
function load_{{ $class }}() {
|
||||
jQuery('.{{ $class }}').dataTable({
|
||||
window.dataTable = jQuery('.{{ $class }}').dataTable({
|
||||
"fnRowCallback": function(row, data) {
|
||||
if (data[0].indexOf('ENTITY_DELETED') > 0) {
|
||||
$(row).addClass('entityDeleted');
|
||||
|
@ -101,7 +101,11 @@
|
||||
|
||||
function setTrashVisible() {
|
||||
var checked = $('#trashed').is(':checked');
|
||||
window.location = '{{ URL::to('view_archive/' . $entityType) }}' + (checked ? '/true' : '/false');
|
||||
var url = '{{ URL::to('view_archive/' . $entityType) }}' + (checked ? '/true' : '/false');
|
||||
|
||||
$.get(url, function(data) {
|
||||
refreshDatatable();
|
||||
})
|
||||
}
|
||||
|
||||
$(function() {
|
||||
|
Loading…
Reference in New Issue
Block a user