mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix a weird button issue
- reloadTable() was causing the button 'click' handler to fire... - NFI why this is happening
This commit is contained in:
parent
ab4e6548dc
commit
9757fb06db
@ -325,7 +325,7 @@ function barcodeCheckIn(location_id, options={}) {
|
|||||||
modalEnable(modal, false);
|
modalEnable(modal, false);
|
||||||
|
|
||||||
// Remove click listeners
|
// Remove click listeners
|
||||||
$(modal + ' .button-item-remove').off('click');
|
$(modal + ' .button-item-remove').unbind('click');
|
||||||
|
|
||||||
var table = $(modal + ' #items-table-div');
|
var table = $(modal + ' #items-table-div');
|
||||||
|
|
||||||
@ -361,18 +361,24 @@ function barcodeCheckIn(location_id, options={}) {
|
|||||||
|
|
||||||
$(modal + ' #barcode').focus();
|
$(modal + ' #barcode').focus();
|
||||||
|
|
||||||
|
$(modal + ' .button-item-remove').unbind('click').on('mouseup', function() {
|
||||||
$(modal + ' .button-item-remove').on('click', function() {
|
|
||||||
var pk = $(this).attr('pk');
|
var pk = $(this).attr('pk');
|
||||||
|
|
||||||
|
var match = false;
|
||||||
|
|
||||||
for (var ii = 0; ii < items.length; ii++) {
|
for (var ii = 0; ii < items.length; ii++) {
|
||||||
if (pk.toString() == items[ii].pk.toString()) {
|
if (pk.toString() == items[ii].pk.toString()) {
|
||||||
//items.splice(ii, 1);
|
items.splice(ii, 1);
|
||||||
|
match = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (match) {
|
||||||
|
reloadTable();
|
||||||
|
}
|
||||||
|
|
||||||
reloadTable();
|
return false;
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user