mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 12:54:31 -04: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');
|
Session::put("show_trash:{$entityType}", $visible == 'true');
|
||||||
|
|
||||||
if ($entityType == 'user') {
|
return RESULT_SUCCESS;
|
||||||
return Redirect::to('settings/'.ACCOUNT_USER_MANAGEMENT);
|
|
||||||
} elseif ($entityType == 'token') {
|
|
||||||
return Redirect::to('settings/'.ACCOUNT_API_TOKENS);
|
|
||||||
} else {
|
|
||||||
return Redirect::to("{$entityType}s");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSearchData()
|
public function getSearchData()
|
||||||
|
@ -42,7 +42,11 @@
|
|||||||
|
|
||||||
function setTrashVisible() {
|
function setTrashVisible() {
|
||||||
var checked = $('#trashed').is(':checked');
|
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>
|
</script>
|
||||||
|
@ -39,7 +39,11 @@
|
|||||||
|
|
||||||
function setTrashVisible() {
|
function setTrashVisible() {
|
||||||
var checked = $('#trashed').is(':checked');
|
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>
|
</script>
|
||||||
|
@ -42,8 +42,12 @@
|
|||||||
});
|
});
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
function refreshDatatable() {
|
||||||
|
window.dataTable.api().ajax.reload();
|
||||||
|
}
|
||||||
|
|
||||||
function load_{{ $class }}() {
|
function load_{{ $class }}() {
|
||||||
jQuery('.{{ $class }}').dataTable({
|
window.dataTable = jQuery('.{{ $class }}').dataTable({
|
||||||
"fnRowCallback": function(row, data) {
|
"fnRowCallback": function(row, data) {
|
||||||
if (data[0].indexOf('ENTITY_DELETED') > 0) {
|
if (data[0].indexOf('ENTITY_DELETED') > 0) {
|
||||||
$(row).addClass('entityDeleted');
|
$(row).addClass('entityDeleted');
|
||||||
|
@ -101,7 +101,11 @@
|
|||||||
|
|
||||||
function setTrashVisible() {
|
function setTrashVisible() {
|
||||||
var checked = $('#trashed').is(':checked');
|
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() {
|
$(function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user