more tweaking and minor fixes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-04-19 00:25:52 +03:00
parent 2d19efaef7
commit 38f26e0c28
2 changed files with 12 additions and 12 deletions

View File

@ -15,9 +15,6 @@ var core = require('features/core')
/*********************************************************************/
// XXX do we need to do most of the work here on in imagegrid/data.js???
// ...another question would be if we can do this using existing
// functionality?
var PartialRibbonsActions = actions.Actions({
config: {
@ -31,11 +28,9 @@ var PartialRibbonsActions = actions.Actions({
'ribbon-resize-threshold': 2,
// Sets size of ribbons in single image mode...
'ribbons-resize-single-image': 13,
'ribbons-resize-single-image': 21,
},
// XXX preload???
updateRibbon: ['- Interface/Update partial ribbon size',
function(target, w, size, threshold){
target = target instanceof jQuery
@ -87,7 +82,7 @@ var PartialRibbonsActions = actions.Actions({
|| (loaded < size && na + pa > loaded)
// ribbon too long...
|| loaded > size * threshold){
console.log('RESIZE')
//console.log('RESIZE')
this.resizeRibbon(target, size)
//*/
@ -133,9 +128,11 @@ var PartialRibbonsActions = actions.Actions({
|| (pl < update_threshold && pa > pl)
// loaded more than we need by threshold...
|| nl + pl + 1 > size + update_threshold){
console.log('UPDATE')
r.length == 0 ?
// ribbon not loaded...
//console.log('UPDATE')
(r.length == 0
|| (this.toggleSingleImage
&& this.toggleSingleImage('?') == 'on')) ?
// resize...
this.resizeRibbon(target, size)
// simply update...
: this.ribbons

View File

@ -1638,6 +1638,8 @@ 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)
@ -1665,8 +1667,9 @@ var RibbonsPrototype = {
}
// update gids...
$(gids.slice(0, loaded.length))
.each(function(i, gid){
gids
.slice(0, loaded.length)
.forEach(function(gid, i){
gid && that.setElemGID(loaded.eq(i), gid) })
// update images...