Commits

Dan O'Donovan committed 84f99ac

Tino's https://bitbucket.org/tino fix for issue 85 Dashboard index: Error in columns calculation

Comments (0)

Files changed (1)

admin_tools/dashboard/static/admin_tools/js/jquery/jquery.dashboard.js

         var start = 0;
         var stop = 0;
         var last_stop = 0;
-        if (options.columns != sizes.length) {
-            // don't break layout if columns count changed
+
+        // don't break layout if columns count or elts count changed
+        var elts_count=0;
+        for(var i in sizes) { elts_count += sizes[i]; }
+        if (options.columns != sizes.length || elts_count != elts.length) {
+            // reset sizes so we don't break
             sizes = [];
         }
+        
         for (var i = 0; i < options.columns; i++) {
             if (typeof(sizes[i]) == 'undefined') {
                 start = i * size;