summaryrefslogtreecommitdiffstats
path: root/public_html
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-02-22 14:29:57 +0100
committerAleksander Machniak <alec@alec.pl>2012-02-22 14:29:57 +0100
commitd1b65b80e8e70e4797b1fd41bb710f8270f31bbe (patch)
tree0f049d1e228d5727f68ea2726aa7f9e2b2b761a1 /public_html
parent395cd9af60479e5d3339a980cdfc08a202b13c56 (diff)
downloadwebadmin-d1b65b80e8e70e4797b1fd41bb710f8270f31bbe.tar.gz
Fixed list paging issues
Refresh users list after user add/update
Diffstat (limited to 'public_html')
-rw-r--r--public_html/js/kolab_admin.js22
-rw-r--r--public_html/skins/default/ui.js7
2 files changed, 18 insertions, 11 deletions
diff --git a/public_html/js/kolab_admin.js b/public_html/js/kolab_admin.js
index 62272d1..89ee9ec 100644
--- a/public_html/js/kolab_admin.js
+++ b/public_html/js/kolab_admin.js
@@ -498,11 +498,11 @@ function kolab_admin()
this.user_list = function(props)
{
- if (props) {
- if (props.search) {
- props = $.extend(props, this.serialize_form('#search-form'));
- }
- }
+ if (!props)
+ props = {};
+
+ if (props.search === undefined && this.env.search_request)
+ props.search_request = this.env.search_request;
this.http_post('user.list', props);
};
@@ -518,9 +518,14 @@ function kolab_admin()
if (!this.api_response(response))
return;
+ var page = this.env.list_page;
+
+ // goto previous page if last user on the current page has been deleted
+ if (this.env.list_count)
+ page -= 1;
+
this.display_message('user.delete.success');
- this.set_watermark('taskcontent');
- // @TODO: refresh the list
+ this.command('user.list', {page: page});
};
this.user_save = function()
@@ -546,8 +551,7 @@ function kolab_admin()
return;
this.display_message('user.add.success');
- this.set_watermark('taskcontent');
- // @TODO: refresh the list
+ this.command('user.list', {page: this.env.list_page});
};
};
diff --git a/public_html/skins/default/ui.js b/public_html/skins/default/ui.js
index f2baa38..9a1b433 100644
--- a/public_html/skins/default/ui.js
+++ b/public_html/skins/default/ui.js
@@ -33,7 +33,10 @@ function search_init()
})
.keypress(function(e) {
if (this.value && e.which == 13) { // ENTER key
- kadm.command('user.list', {search: this.value});
+ var props = kadm.serialize_form('#search-form');
+ props.search = this.value;
+
+ kadm.command('user.list', props);
}
})
.focus(function() {
@@ -48,7 +51,7 @@ function search_reset()
input.val(kadm.t('search')).addClass('inactive');
- kadm.command('user.list');
+ kadm.command('user.list', {search: ''});
}
function search_details()