more tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-04-19 21:39:25 +03:00
parent 81e66be661
commit a9cf6f39b6
2 changed files with 17 additions and 5 deletions

View File

@ -144,6 +144,7 @@ var PartialRibbonsActions = actions.Actions({
: this.ribbons
.preventTransitions(r)
.updateRibbonInPlace(
//.updateRibbon(
gids,
r_gid,
// XXX this makes the animation of the ribbon
@ -157,8 +158,7 @@ var PartialRibbonsActions = actions.Actions({
// jumpy but does not touch the indicator
// animation...
target)
//.restoreTransitions(r, true)
.restoreTransitions(r)
.restoreTransitions(r, true)
}
}],
})

View File

@ -1638,8 +1638,6 @@ var RibbonsPrototype = {
// NOTE: reference must be both present in the loaded ribbon and in
// the given gids...
// XXX need to clean out marks of unloaded images...
// XXX need to sync the offset and image loading...
updateRibbonInPlace: function(gids, ribbon, reference){
var that = this
var r = this.getRibbon(ribbon)
@ -1667,10 +1665,24 @@ var RibbonsPrototype = {
}
// update gids...
var unload_marks = []
gids
.slice(0, loaded.length)
.forEach(function(gid, i){
gid && that.setElemGID(loaded.eq(i), gid) })
if(gid !== undefined){
var img = loaded.eq(i)
// cleanup marks...
var g = that.getElemGID(img)
unload_marks = gids.indexOf(g) < 0 ?
unload_marks.concat(that.getImageMarks(g).toArray())
: unload_marks
gid && that.setElemGID(img, gid)
}
})
$(unload_marks)
.remove()
// update images...
this.updateImage(loaded)