changeset 1571:c7b8c035ffac

regions plugin: fixed one-off error with region numbers
author hertzhaft
date Mon, 07 Nov 2016 01:06:37 +0100
parents bfd2d6f709d5
children 453f6c3b31af
files webapp/src/main/webapp/jquery/jquery.digilib.regions.js
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/webapp/src/main/webapp/jquery/jquery.digilib.regions.js	Mon Nov 07 00:56:12 2016 +0100
+++ b/webapp/src/main/webapp/jquery/jquery.digilib.regions.js	Mon Nov 07 01:06:37 2016 +0100
@@ -171,9 +171,9 @@
             }
             var onComplete = function (data, rect) {
                 if (rect == null) return;
-                var count = getRegions(data, 'regionURL').length;
+                var index = getRegions(data, 'regionURL').length + 1;
                 var attr = {'class' : CSS+'regionURL '+CSS+'overlay'};
-                var item = {'rect' : rect, 'index' : count, 'attributes' : attr};
+                var item = {'rect' : rect, 'index' : index, 'attributes' : attr};
                 var $regionDiv = addRegionDiv(data, item);
                 fn.highlightButtons(data, 'defineregion', 0);
                 redisplay(data);