The Gitlab instance will be restarted on Monday April 28th at 2AM. There will be a short interruption of service.

Skip to content
Snippets Groups Projects
Commit 985955e6 authored by Demian Katz's avatar Demian Katz
Browse files

Deduplicate selected cart items.

- Fixes bug with double-counting on Combined search results.
parent 3d38b14e
No related merge requests found
......@@ -155,14 +155,15 @@ VuFind.register('cart', function Cart() {
$("#updateCart, #bottom_updateCart").unbind('click').click(function cartUpdate() {
var elId = this.id;
var selected = [];
var addToSelected = function processCartFormValues() {
if (-1 === selected.indexOf(this.value)) {
selected.push(this.value);
}
};
var selectedInForm = $form.find('input[name="ids[]"]:checked');
var selectedFormAttr = $('input[form="' + $form.attr('id') + '"][name="ids[]"]:checked');
$(selectedInForm).each(function cartFormCheckboxValues() {
selected.push(this.value);
});
$(selectedFormAttr).each(function cartAttrCheckboxValues() {
selected.push(this.value);
});
$(selectedInForm).each(addToSelected);
$(selectedFormAttr).each(addToSelected);
if (selected.length > 0) {
var msg = "";
var orig = getFullItems();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment