Lines 13-19
Link Here
|
13 |
|
13 |
|
14 |
dt_overwrite_html_sorting_localeCompare(); |
14 |
dt_overwrite_html_sorting_localeCompare(); |
15 |
|
15 |
|
16 |
var rowsToCollapse = 5; |
|
|
17 |
$(document).ready(function(){ |
16 |
$(document).ready(function(){ |
18 |
var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, { |
17 |
var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, { |
19 |
"aoColumnDefs": [ |
18 |
"aoColumnDefs": [ |
Lines 56-65
Link Here
|
56 |
}); |
55 |
}); |
57 |
*/ |
56 |
*/ |
58 |
|
57 |
|
59 |
rowCountPending = $("#pendingt tbody.filterclass tr").length; |
|
|
60 |
rowCountReceived = $("#receivedt tbody.filterclass tr").length; |
61 |
if (rowCountPending > rowsToCollapse ) { if ( $.cookie("pendingKeepExpanded") != 1 ) { pendingCollapse(); } else { pendingExpand(); } } |
62 |
if (rowCountReceived > rowsToCollapse ) { if ( $.cookie("receivedKeepExpanded") != 1 ) { receivedCollapse(); } else { receivedExpand(); } } |
63 |
}); |
58 |
}); |
64 |
|
59 |
|
65 |
// Case-insensitive version of jquery's contains function |
60 |
// Case-insensitive version of jquery's contains function |
Lines 72-113
Link Here
|
72 |
containsExactly: "$(a).text() == m[3]" |
67 |
containsExactly: "$(a).text() == m[3]" |
73 |
}); |
68 |
}); |
74 |
|
69 |
|
75 |
|
|
|
76 |
// Collapse pending items table |
77 |
function pendingCollapse() { |
78 |
$.cookie("pendingKeepExpanded", 0, { path: "/", expires: 9999 }); |
79 |
$("#pendingcollapserow").remove(); |
80 |
$("#pendingt tr").show(); |
81 |
$("#pendingt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide(); |
82 |
$("#pendingt").before("<p id=\"pendingcollapserow\">" + _("Only the first ") + rowsToCollapse + _(" items are displayed.") + " <a href=\"javascript:pendingExpand();\">" + _("Click here to show all ") + rowCountPending + _(" items") + "<\/a>.<\/p>"); |
83 |
|
84 |
} |
85 |
|
86 |
// Expend pending items table |
87 |
function pendingExpand() { |
88 |
$.cookie("pendingKeepExpanded", 1, { path: "/", expires: 9999 }); |
89 |
$("#pendingcollapserow").remove(); |
90 |
$("#pendingt tr").show(); |
91 |
$("#pendingt tbody.filterclass tr.orderfound").remove(); |
92 |
$("#pendingt").before("<p id=\"pendingcollapserow\">" + rowCountPending + _(" items are displayed.") + " <a href=\"javascript:pendingCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>"); |
93 |
} |
94 |
|
95 |
// Collapse already received items table |
96 |
function receivedCollapse() { |
97 |
$.cookie("receivedKeepExpanded", 0, { path: "/", expires: 9999 }); |
98 |
$("#receivedcollapserow").remove(); |
99 |
$("#receivedt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide(); |
100 |
$("#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>"); |
101 |
} |
102 |
|
103 |
// Expand already received items table |
104 |
function receivedExpand() { |
105 |
$.cookie("receivedKeepExpanded", 1, { path: "/", expires: 9999 }); |
106 |
$("#receivedcollapserow").remove(); |
107 |
$("#receivedt tr").show(); |
108 |
$("#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>"); |
109 |
} |
110 |
|
111 |
//]]> |
70 |
//]]> |
112 |
</script> |
71 |
</script> |
113 |
<script type="text/javascript"> |
72 |
<script type="text/javascript"> |
114 |
- |
|
|