diff --git a/ui (gen4)/data.js b/ui (gen4)/data.js index d549213f..f7d23620 100755 --- a/ui (gen4)/data.js +++ b/ui (gen4)/data.js @@ -546,6 +546,10 @@ var DataPrototype = { // XXX most of the complexity here comes from argument DSL parsing, // might be good to revise argument syntax and handling... getImage: function(target, mode, list){ + // empty data... + if(this.order == null || (this.order && this.order.length == 0)){ + return null + } // no args... if(target == null && mode == null && list == null){ return this.current diff --git a/ui (gen4)/ribbons.js b/ui (gen4)/ribbons.js index d12a0c41..b3e2cf50 100755 --- a/ui (gen4)/ribbons.js +++ b/ui (gen4)/ribbons.js @@ -81,6 +81,7 @@ var RibbonsClassPrototype = { }, // XXX NOTE: quots removal might render this incompatible with older data formats... createRibbon: function(gids){ + gids = gids || [] gids = gids.constructor !== Array ? [gids] : gids var that = this return $(gids.map(function(gid){ @@ -91,6 +92,7 @@ var RibbonsClassPrototype = { }, // XXX NOTE: quots removal might render this incompatible with older data formats... createImage: function(gids){ + gids = gids || [] gids = gids.constructor !== Array ? [gids] : gids var that = this return $(gids.map(function(gid){ diff --git a/ui (gen4)/testing.js b/ui (gen4)/testing.js index ae7357f0..5c574e71 100755 --- a/ui (gen4)/testing.js +++ b/ui (gen4)/testing.js @@ -100,7 +100,6 @@ module.setupActions = function(viewer){ viewer = viewer == null ? $('.viewer') : viewer //r = r == null ? makeTestRibbons(viewer, images) : r - //var vv = Object.create(v.Viewer) var vv = Object.create(v.Client) // XXX need to automate this... diff --git a/ui (gen4)/ui.js b/ui (gen4)/ui.js index 1c19b04d..ae4e5a4b 100755 --- a/ui (gen4)/ui.js +++ b/ui (gen4)/ui.js @@ -246,6 +246,7 @@ $(function(){ // used switch experimental actions on (set to true) or off (unset or false)... //a.experimental = true + // setup actions... viewer.ImageGridFeatures.setup(a, [ 'viewer-testing', @@ -256,15 +257,20 @@ $(function(){ // 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... a + .setEmptyMsg('Loading...') .load({ - viewer: $('.viewer'), data: data.Data(testing.mock_data), images: testing.makeTestImages(), }) - .setEmptyMsg('Loading...') // this is needed when loading legacy sources that do not have tags // synced... // do not do for actual data... diff --git a/ui (gen4)/viewer.js b/ui (gen4)/viewer.js index d406611a..5f723fa7 100755 --- a/ui (gen4)/viewer.js +++ b/ui (gen4)/viewer.js @@ -793,7 +793,6 @@ module.ImageGridFeatures = Object.create(features.FeatureSet) var ViewerActions = module.ViewerActions = -//actions.Actions(Client, { actions.Actions({ /* @@ -1528,6 +1527,10 @@ var PartialRibbonsActions = actions.Actions({ // the target might not be loaded... var r_gid = data.getRibbon(target) + if(r_gid == null){ + return + } + // localize transition prevention... // NOTE: for the initial load this may be empty... var r = ribbons.getRibbon(r_gid) @@ -1535,7 +1538,7 @@ var PartialRibbonsActions = actions.Actions({ // XXX do we need to for example ignore unloaded (r.length == 0) // ribbons here, for example not load ribbons too far off // screen?? - + ribbons .preventTransitions(r) .updateRibbon(