From 4aee44ce024d0fb1c71814226a0359aadff6e779 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 7 Nov 2015 21:08:12 +0300 Subject: [PATCH] several bugs fixed... Signed-off-by: Alex A. Naanou --- ui (gen4)/data.js | 20 ++++++++++++++++---- ui (gen4)/ui.js | 6 +----- ui (gen4)/viewer.js | 3 ++- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/ui (gen4)/data.js b/ui (gen4)/data.js index f7d23620..9d77206b 100755 --- a/ui (gen4)/data.js +++ b/ui (gen4)/data.js @@ -643,10 +643,15 @@ var DataPrototype = { return -1 } - // normalize the list to a sparse list of gids... list = list == null ? - this.ribbons[this.getRibbon(target)] + this.ribbons[ + this.getRibbon(target) + // target exists but is not loaded... + || this.getRibbon() + // no current ribbon... + || this.getRibbon(this.getImage(target, 'before', this.getImages())) + || this.getRibbon(this.getImage(target, 'after', this.getImages()))] : list.constructor === Array ? this.makeSparseImages(list) : this.ribbons[this.getRibbon(list)] @@ -2065,12 +2070,19 @@ var DataPrototype = { var r = this.getRibbon() // if current ribbon is not empty get the closest image in it... if(r in crop.ribbons && crop.ribbons[r].length > 0){ - crop.focusImage(this.current, 'after', this.getRibbon()) + // XXX is this the correct way to do this??? + // ...should we use direction??? + var target = crop.getImage(this.current, 'after', this.getRibbon()) + || crop.getImage(this.current, 'before', this.getRibbon()) // if ribbon got deleted, get the closest loaded image... } else { - crop.focusImage(this.current, list) + // XXX is this the correct way to do this??? + // ...should we use direction??? + var target = crop.getImage(this.current, 'after', list) + || crop.getImage(this.current, 'before', list) } + crop.focusImage(target) // XXX ??? //crop.parent = this diff --git a/ui (gen4)/ui.js b/ui (gen4)/ui.js index 0f163f07..71942856 100755 --- a/ui (gen4)/ui.js +++ b/ui (gen4)/ui.js @@ -254,17 +254,13 @@ $(function(){ 'experiments', ]) - // this publishes all the actions... - //module.GLOBAL_KEYBOARD.__proto__ = a - // setup the viewer... a.load({ viewer: $('.viewer'), }) - // load some testing data... - // NOTE: we can load this in parts... + // NOTE: we can (and do) load this in parts... a .setEmptyMsg('Loading...') .load({ diff --git a/ui (gen4)/viewer.js b/ui (gen4)/viewer.js index 0c162245..ce3f5857 100755 --- a/ui (gen4)/viewer.js +++ b/ui (gen4)/viewer.js @@ -1276,7 +1276,8 @@ actions.Actions({ collapseGroup: [ reloadAfter(true) ], - crop: [ reloadAfter() ], + // XXX BUG? reloadAfter() here does not remove some images... + crop: [ reloadAfter(true) ], // XXX BUG? reloadAfter() produces an align error... uncrop: [ reloadAfter(true) ], // XXX might be a good idea to do this in a new viewer in an overlay...