From 140ba153ae8fb445614ba6a049dfc8f07f3a6125 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 21 Nov 2013 04:11:33 +0400 Subject: [PATCH] tweaked the export dialog + some minor changes, mostly to debugging... Signed-off-by: Alex A. Naanou --- ui/data.js | 23 +++++++++++++++-------- ui/ui.js | 2 +- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ui/data.js b/ui/data.js index 1eae5e12..bc5480d5 100755 --- a/ui/data.js +++ b/ui/data.js @@ -1418,28 +1418,28 @@ function loadImagesAround(count, gid, ribbon, data){ } */ // XXX might be magic but now this appears to work!!! - // XXX this still is quite buggy!! // no common sections, do a full reload... //if(left == null && right == null){ if(left == null || right == null){ - console.warn('Ribbon #'+ribbon+', reloading...') + console.log('Ribbon #'+ribbon+', reloading...') var n = new_ribbon.indexOf(gid) var o = old_ribbon.indexOf(gid) o = o < 0 ? n : o + // calculate offsets... var left = n - o var right = (new_ribbon.length - old_ribbon.length) - left - console.log('>>>', left, right, - //'--- images:', ribbon_elem.find('.image').length, - 'new:', new_ribbon.length, - '@', n, + console.log(' >>>', left, right, '---', 'old:', old_ribbon.length, - '@', o) + '@', o, + 'new:', new_ribbon.length, + '@', n) extendRibbon(left, right, ribbon_elem) + // update the images... ribbon_elem.find('.image') .each(function(i, e){ updateImage(e, new_ribbon[i], size) @@ -1447,8 +1447,15 @@ function loadImagesAround(count, gid, ribbon, data){ var updated = new_ribbon.length // partial reload... + // XXX buggy... + // see: BUG: @ 9 image width, jumping to end of ribbon length 39 messes up loading... } else { - console.warn('Ribbon #'+ribbon+', updating...') + console.log('Ribbon #'+ribbon+', updating...') + console.log(' >>>', left, right, '---', + 'old:', old_ribbon.length, + '@', old_ribbon.indexOf(gid), + 'new:', new_ribbon.length, + '@', new_ribbon.indexOf(gid)) var res = extendRibbon(left, right, ribbon_elem) // XXX this will get all the current images, not the resulting ones... diff --git a/ui/ui.js b/ui/ui.js index af1739d3..7320f4e3 100755 --- a/ui/ui.js +++ b/ui/ui.js @@ -923,7 +923,7 @@ function exportPreviewsDialog(state, dfl){ var keys = Object.keys(cfg) - formDialog(null, 'Export: '+ state +'.', cfg, 'OK', 'exportPreviewsDialog') + formDialog(null, 'Export: '+ state +'.', cfg, 'OK', 'exportPreviewsDialog') .done(function(data){ // get the form data... var name = data[keys[0]]