]> git.datanom.net - qtadmin.git/blame_incremental - js/forms.js
Finish change row per page
[qtadmin.git] / js / forms.js
... / ...
CommitLineData
1/* vim: set ts=4 tw=4 sw=4 noet: */
2
3function updateRowsPerPage() {
4 var pos;
5 var url;
6 var base;
7 var href;
8 var rowsPerPage = document.getElementById("rows");
9 var link = document.getElementsByTagName('a');
10 var found = false;
11 for (var i = 0; i < link.length; i++) {
12 url = link[i].href;
13 pos = url.search('rowsperpage');
14 if (pos >= 0) {
15 found = true;
16 base = url.slice(0, pos);
17 href = base + 'rowsperpage=' + rowsPerPage.value;
18 link[i].href = href;
19 }
20 }
21 if (found == false) {
22 pos = location.href.search('rowsperpage');
23 if (pos >= 0) {
24 base = location.href.slice(0, pos);
25 } else {
26 base = location.href;
27 }
28 if (location.href.charAt(location.href.length) == '?') {
29 href = base + 'rowsperpage=' + rowsPerPage.value;
30 } else {
31 href = base + '?rowsperpage=' + rowsPerPage.value;
32 }
33 } else {
34 pos = location.href.search('rowsperpage');
35 base = location.href.slice(0, pos);
36 href = base + 'rowsperpage=' + rowsPerPage.value;
37 }
38 location.href = href;
39}
This page took 0.05093 seconds and 5 git commands to generate.