mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 10:20:08 +00:00
some refactoring and bug fixes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
2240025747
commit
50bd9d2b45
@ -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
|
||||
|
||||
@ -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){
|
||||
|
||||
@ -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...
|
||||
|
||||
@ -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...
|
||||
|
||||
@ -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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user