From 867837bfef7c98b34c1da13974d23027b4a36446 Mon Sep 17 00:00:00 2001 From: vin Date: Mon, 22 May 2017 17:12:09 +0530 Subject: [PATCH 1/2] Add timeout for navigator item index change handler. Fix for issue# 1130 --- src/navigator.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/navigator.js b/src/navigator.js index 45379fa1..57dc5881 100644 --- a/src/navigator.js +++ b/src/navigator.js @@ -231,8 +231,10 @@ $.Navigator = function( options ){ }); viewer.world.addHandler("item-index-change", function(event) { - var item = _this.world.getItemAt(event.previousIndex); - _this.world.setItemIndex(item, event.newIndex); + window.setTimeout(function(){ + var item = _this.world.getItemAt(event.previousIndex); + _this.world.setItemIndex(item, event.newIndex); + },1); }); viewer.world.addHandler("remove-item", function(event) { From 4eca8aca9813b95b5e1f72f81acecfee439e83cc Mon Sep 17 00:00:00 2001 From: vin Date: Mon, 22 May 2017 17:12:09 +0530 Subject: [PATCH 2/2] Add timeout for navigator item index change handler. Fix for issue# 1130 --- src/navigator.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/navigator.js b/src/navigator.js index 45379fa1..12273b79 100644 --- a/src/navigator.js +++ b/src/navigator.js @@ -231,8 +231,10 @@ $.Navigator = function( options ){ }); viewer.world.addHandler("item-index-change", function(event) { - var item = _this.world.getItemAt(event.previousIndex); - _this.world.setItemIndex(item, event.newIndex); + window.setTimeout(function(){ + var item = _this.world.getItemAt(event.previousIndex); + _this.world.setItemIndex(item, event.newIndex); + }, 1); }); viewer.world.addHandler("remove-item", function(event) {