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

View File

@ -1638,8 +1638,6 @@ var RibbonsPrototype = {
// NOTE: reference must be both present in the loaded ribbon and in // NOTE: reference must be both present in the loaded ribbon and in
// the given gids... // 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){ updateRibbonInPlace: function(gids, ribbon, reference){
var that = this var that = this
var r = this.getRibbon(ribbon) var r = this.getRibbon(ribbon)
@ -1667,10 +1665,24 @@ var RibbonsPrototype = {
} }
// update gids... // update gids...
var unload_marks = []
gids gids
.slice(0, loaded.length) .slice(0, loaded.length)
.forEach(function(gid, i){ .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... // update images...
this.updateImage(loaded) this.updateImage(loaded)