Fixes Issue 625 where the Duplicate calculation would hang if no assigned slots where available.
Reviewed by: Lennard de Rijk
--- a/app/soc/content/js/duplicate-slots-090331.js Sat May 09 01:14:03 2009 +0200
+++ b/app/soc/content/js/duplicate-slots-090331.js Sat May 09 01:36:22 2009 +0200
@@ -11,13 +11,19 @@
this.showDuplicatesInit = function() {
+ html_string = '';
// Remember this object for Javascript scoping
- html_string = '';
var this_object = this;
var NUMBER_OF_ORGS = number_of_orgs;
var OFFSET_LENGTH = offset_length;
// Variables to handle progress bar updating
var ITERATIONS = (number_of_orgs % offset_length)==0 ? Math.floor(number_of_orgs/offset_length) : Math.floor(number_of_orgs/offset_length)+1;
+
+ if (ITERATIONS==0) {
+ $("#div_duplicate_slots").html("<strong>No org slots to process</strong>");
+ return;
+ }
+
var successful_calls = 0;
$("#id_button_duplicate_slots").fadeOut("slow",