|
Lines 24-31
Link Here
|
| 24 |
|
24 |
|
| 25 |
rowCountPending = $("#pendingt tbody.filterclass tr").length; |
25 |
rowCountPending = $("#pendingt tbody.filterclass tr").length; |
| 26 |
rowCountReceived = $("#receivedt tbody.filterclass tr").length; |
26 |
rowCountReceived = $("#receivedt tbody.filterclass tr").length; |
| 27 |
if (rowCountPending > rowsToCollapse) { pendingCollapse(); } |
27 |
if (rowCountPending > rowsToCollapse && $.cookie("pendingKeepExpanded") != 1 ) { pendingCollapse(); } |
| 28 |
if (rowCountReceived > rowsToCollapse) { receivedCollapse(); } |
28 |
if (rowCountReceived > rowsToCollapse && $.cookie("receivedKeepExpanded") != 1 ) { receivedCollapse(); } else { receivedExpand(); } |
| 29 |
}); |
29 |
}); |
| 30 |
|
30 |
|
| 31 |
// Case-insensitive version of jquery's contains function |
31 |
// Case-insensitive version of jquery's contains function |
|
Lines 41-46
Link Here
|
| 41 |
|
41 |
|
| 42 |
// Collapse pending items table |
42 |
// Collapse pending items table |
| 43 |
function pendingCollapse() { |
43 |
function pendingCollapse() { |
|
|
44 |
$.cookie("pendingKeepExpanded", 0, { path: "/", expires: 9999 }); |
| 44 |
$("#pendingcollapserow").remove(); |
45 |
$("#pendingcollapserow").remove(); |
| 45 |
$("#pendingt tr").show(); |
46 |
$("#pendingt tr").show(); |
| 46 |
$("#pendingt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide(); |
47 |
$("#pendingt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide(); |
|
Lines 50-55
Link Here
|
| 50 |
|
51 |
|
| 51 |
// Expend pending items table |
52 |
// Expend pending items table |
| 52 |
function pendingExpand() { |
53 |
function pendingExpand() { |
|
|
54 |
$.cookie("pendingKeepExpanded", 1, { path: "/", expires: 9999 }); |
| 53 |
$("#pendingcollapserow").remove(); |
55 |
$("#pendingcollapserow").remove(); |
| 54 |
$("#pendingt tr").show(); |
56 |
$("#pendingt tr").show(); |
| 55 |
$("#pendingt tbody.filterclass tr.orderfound").remove(); |
57 |
$("#pendingt tbody.filterclass tr.orderfound").remove(); |
|
Lines 58-63
Link Here
|
| 58 |
|
60 |
|
| 59 |
// Collapse already received items table |
61 |
// Collapse already received items table |
| 60 |
function receivedCollapse() { |
62 |
function receivedCollapse() { |
|
|
63 |
$.cookie("receivedKeepExpanded", 0, { path: "/", expires: 9999 }); |
| 61 |
$("#receivedcollapserow").remove(); |
64 |
$("#receivedcollapserow").remove(); |
| 62 |
$("#receivedt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide(); |
65 |
$("#receivedt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide(); |
| 63 |
$("#receivedt").before("<p id=\"receivedcollapserow\">" + _("Only the first ") + rowsToCollapse + _(" items are displayed.") + "<a href=\"javascript:receivedExpand();\">" + _("Click here to show all ") + rowCountReceived + _(" items") + "<\/a>.<\/p>"); |
66 |
$("#receivedt").before("<p id=\"receivedcollapserow\">" + _("Only the first ") + rowsToCollapse + _(" items are displayed.") + "<a href=\"javascript:receivedExpand();\">" + _("Click here to show all ") + rowCountReceived + _(" items") + "<\/a>.<\/p>"); |
|
Lines 65-70
Link Here
|
| 65 |
|
68 |
|
| 66 |
// Expand already received items table |
69 |
// Expand already received items table |
| 67 |
function receivedExpand() { |
70 |
function receivedExpand() { |
|
|
71 |
$.cookie("receivedKeepExpanded", 1, { path: "/", expires: 9999 }); |
| 68 |
$("#receivedcollapserow").remove(); |
72 |
$("#receivedcollapserow").remove(); |
| 69 |
$("#receivedt tr").show(); |
73 |
$("#receivedt tr").show(); |
| 70 |
$("#receivedt").before("<p id=\"receivedcollapserow\">" + _("All ") + rowCountReceived + _(" items are displayed.") + "<a href=\"javascript:receivedCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>"); |
74 |
$("#receivedt").before("<p id=\"receivedcollapserow\">" + _("All ") + rowCountReceived + _(" items are displayed.") + "<a href=\"javascript:receivedCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>"); |
| 71 |
- |
|
|