mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
added expanded/collapsed group support to data.getImage(..) and data.getRibbon(..)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
ea88c16472
commit
3c5521dece
@ -607,6 +607,10 @@ var DataPrototype = {
|
|||||||
mode = mode == null ? 'before' : mode
|
mode = mode == null ? 'before' : mode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// get the loaded group gid...
|
||||||
|
var x = this.getLoadedInGroup(target)
|
||||||
|
target = x != null ? x : target
|
||||||
|
|
||||||
var i = this.order.indexOf(target)
|
var i = this.order.indexOf(target)
|
||||||
|
|
||||||
// invalid gid...
|
// invalid gid...
|
||||||
@ -920,6 +924,10 @@ var DataPrototype = {
|
|||||||
|
|
||||||
// image gid...
|
// image gid...
|
||||||
} else {
|
} else {
|
||||||
|
// get the loaded group gid...
|
||||||
|
var x = this.getLoadedInGroup(target)
|
||||||
|
target = x != null ? x : target
|
||||||
|
|
||||||
var i = this.order.indexOf(target)
|
var i = this.order.indexOf(target)
|
||||||
if(i == -1){
|
if(i == -1){
|
||||||
return null
|
return null
|
||||||
@ -1505,6 +1513,44 @@ var DataPrototype = {
|
|||||||
return null
|
return null
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Get loaded gid representing a group...
|
||||||
|
//
|
||||||
|
// This will either be a group gid if collapsed or first loaded gid
|
||||||
|
// from within if group expanded...
|
||||||
|
//
|
||||||
|
// NOTE: this will get the first loaded image of a group regardless
|
||||||
|
// of group/image gid given...
|
||||||
|
// Thus, this will return the argument ONLY if it is loaded.
|
||||||
|
// NOTE: this does not account for current position in selecting an
|
||||||
|
// image from the group...
|
||||||
|
getLoadedInGroup: function(gid){
|
||||||
|
var group = this.getGroup(gid)
|
||||||
|
|
||||||
|
// not a group...
|
||||||
|
if(group == null){
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// get the actual image gid...
|
||||||
|
var gids = gid == group ? this.groups[group] : [gid]
|
||||||
|
|
||||||
|
// find either
|
||||||
|
for(var k in this.ribbons){
|
||||||
|
if(this.ribbons[k].indexOf(group) >= 0){
|
||||||
|
return group
|
||||||
|
}
|
||||||
|
// get the first loaded gid in group...
|
||||||
|
for(var i=0; i<gids.length; i++){
|
||||||
|
if(this.ribbons[k].indexOf(gids[i]) >= 0){
|
||||||
|
return gids[i]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// nothing loaded...
|
||||||
|
return null
|
||||||
|
},
|
||||||
|
|
||||||
// Group image(s)...
|
// Group image(s)...
|
||||||
//
|
//
|
||||||
// Group image(s) into a new group
|
// Group image(s) into a new group
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user