Bug 36868: Move array splice in OPAC js to after the -1 check
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
5579974cd1
commit
b369ba5d17
|
|
@ -234,13 +234,13 @@ function delSingleRecord(biblionumber) {
|
|||
var valCookie = readCookie(nameCookie);
|
||||
var arrayRecords = valCookie.split("/");
|
||||
var pos = jQuery.inArray(biblionumber, arrayRecords);
|
||||
arrayRecords.splice(pos, 1);
|
||||
|
||||
// if pos is -1, the cart is empty, bail
|
||||
if (pos === -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
arrayRecords.splice(pos, 1);
|
||||
valCookie = arrayRecords.join("/");
|
||||
writeCookie(nameCookie, valCookie);
|
||||
updateBasket(arrayRecords.length - 1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue