mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
more tweaking and minor fixes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
2d19efaef7
commit
38f26e0c28
@ -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({
|
var PartialRibbonsActions = actions.Actions({
|
||||||
config: {
|
config: {
|
||||||
@ -31,11 +28,9 @@ var PartialRibbonsActions = actions.Actions({
|
|||||||
'ribbon-resize-threshold': 2,
|
'ribbon-resize-threshold': 2,
|
||||||
|
|
||||||
// Sets size of ribbons in single image mode...
|
// 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',
|
updateRibbon: ['- Interface/Update partial ribbon size',
|
||||||
function(target, w, size, threshold){
|
function(target, w, size, threshold){
|
||||||
target = target instanceof jQuery
|
target = target instanceof jQuery
|
||||||
@ -87,7 +82,7 @@ var PartialRibbonsActions = actions.Actions({
|
|||||||
|| (loaded < size && na + pa > loaded)
|
|| (loaded < size && na + pa > loaded)
|
||||||
// ribbon too long...
|
// ribbon too long...
|
||||||
|| loaded > size * threshold){
|
|| loaded > size * threshold){
|
||||||
console.log('RESIZE')
|
//console.log('RESIZE')
|
||||||
this.resizeRibbon(target, size)
|
this.resizeRibbon(target, size)
|
||||||
//*/
|
//*/
|
||||||
|
|
||||||
@ -133,9 +128,11 @@ var PartialRibbonsActions = actions.Actions({
|
|||||||
|| (pl < update_threshold && pa > pl)
|
|| (pl < update_threshold && pa > pl)
|
||||||
// loaded more than we need by threshold...
|
// loaded more than we need by threshold...
|
||||||
|| nl + pl + 1 > size + update_threshold){
|
|| nl + pl + 1 > size + update_threshold){
|
||||||
console.log('UPDATE')
|
//console.log('UPDATE')
|
||||||
r.length == 0 ?
|
(r.length == 0
|
||||||
// ribbon not loaded...
|
|| (this.toggleSingleImage
|
||||||
|
&& this.toggleSingleImage('?') == 'on')) ?
|
||||||
|
// resize...
|
||||||
this.resizeRibbon(target, size)
|
this.resizeRibbon(target, size)
|
||||||
// simply update...
|
// simply update...
|
||||||
: this.ribbons
|
: this.ribbons
|
||||||
|
|||||||
@ -1638,6 +1638,8 @@ 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)
|
||||||
@ -1665,8 +1667,9 @@ var RibbonsPrototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// update gids...
|
// update gids...
|
||||||
$(gids.slice(0, loaded.length))
|
gids
|
||||||
.each(function(i, gid){
|
.slice(0, loaded.length)
|
||||||
|
.forEach(function(gid, i){
|
||||||
gid && that.setElemGID(loaded.eq(i), gid) })
|
gid && that.setElemGID(loaded.eq(i), gid) })
|
||||||
|
|
||||||
// update images...
|
// update images...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user