mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-28 18:00:09 +00:00
minor bugfix -- now ribbon gids can be used in url-hash and in .current or .focusImage(..)
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
90276c7529
commit
6bf5296918
@ -207,7 +207,7 @@ var DataPrototype = {
|
||||
|| this.getImages(this.ribbon_order[0])[0]
|
||||
|| this.order[0] },
|
||||
set current(value){
|
||||
this.__current = value },
|
||||
this.focusImage(value) },
|
||||
|
||||
get base(){
|
||||
return this.__base || this.ribbon_order.slice(-1)[0] },
|
||||
@ -1135,8 +1135,12 @@ var DataPrototype = {
|
||||
// info...
|
||||
focusImage: function(target, mode, list){
|
||||
var current = this.getImage(target, mode, list)
|
||||
// in case no args are given other than target...
|
||||
if(target && current == null && mode == null && list == null){
|
||||
current = this.getImage(target, 'after')
|
||||
}
|
||||
if(this.order.indexOf(current) >= 0){
|
||||
this.current = current
|
||||
this.__current = current
|
||||
}
|
||||
return this
|
||||
},
|
||||
@ -2561,7 +2565,6 @@ var DataPrototype = {
|
||||
data = typeof(data) == typeof('str') ? JSON.parse(data) : data
|
||||
data = formats.updateData(data)
|
||||
this.base = data.base
|
||||
this.current = data.current
|
||||
this.order = data.order.slice()
|
||||
this.ribbon_order = data.ribbon_order.slice()
|
||||
|
||||
@ -2578,6 +2581,8 @@ var DataPrototype = {
|
||||
}
|
||||
})
|
||||
|
||||
this.current = data.current
|
||||
|
||||
// extra data...
|
||||
!clean
|
||||
&& Object.keys(data).forEach(function(k){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user