For deleting a list of selected items, only reload_opac() once at the
end, not once for each item deleted.
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
dojo.forEach(items,
function(item) {
var fmObject = new fieldmapper[self.fmClass]().fromStoreItem(item);
- new openils.PermaCrud()['eliminate'](fmObject, {oncomplete : function(r) { self.store.deleteItem(item) }});
+ new openils.PermaCrud()['eliminate'](
+ fmObject, {
+ oncomplete : function(r) {
+ self.store.deleteItem(item);
+ if (--total < 1) {
+ try {
+ xulG.reload_opac();
+ } catch (E) {
+ (dump ? dump : console.log)(E);
+ }
+ }
+ }
+ }
+ );
}
);
- try {
- xulG.reload_opac();
- } catch (E) {
- (dump ? dump : console.log)(E);
- }
},
_formatRowSelectInput : function(rowIdx) {