mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-12-17 08:41:40 +00:00
added hard threshold to partial ribbon update (screen width from the edge)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
8b4eb8f4e9
commit
78b66c4710
@ -589,6 +589,7 @@ actions.Actions({
|
|||||||
|
|
||||||
|
|
||||||
// grouping...
|
// grouping...
|
||||||
|
// XXX need to tell .images about this...
|
||||||
group: ['Group images',
|
group: ['Group images',
|
||||||
function(gids, group){ this.data.group(gids, group) }],
|
function(gids, group){ this.data.group(gids, group) }],
|
||||||
ungroup: ['Ungroup images',
|
ungroup: ['Ungroup images',
|
||||||
@ -1238,6 +1239,10 @@ module.Features = Object.create(FeatureSet)
|
|||||||
// XXX try a strategy: load more in the direction of movement by an offset...
|
// XXX try a strategy: load more in the direction of movement by an offset...
|
||||||
// XXX updateRibbon(..) is not signature compatible with data.updateRibbon(..)
|
// XXX updateRibbon(..) is not signature compatible with data.updateRibbon(..)
|
||||||
var PartialRibbonsActions = actions.Actions({
|
var PartialRibbonsActions = actions.Actions({
|
||||||
|
// NOTE: this will force sync resize if one of the following is true:
|
||||||
|
// - the target is not loaded
|
||||||
|
// - we are less that screen width from the edge
|
||||||
|
// - threshold is set to 0
|
||||||
// XXX this is not signature compatible with data.updateRibbon(..)
|
// XXX this is not signature compatible with data.updateRibbon(..)
|
||||||
updateRibbon: ['Update partial ribbon size',
|
updateRibbon: ['Update partial ribbon size',
|
||||||
function(target, w, size, threshold){
|
function(target, w, size, threshold){
|
||||||
@ -1269,8 +1274,15 @@ var PartialRibbonsActions = actions.Actions({
|
|||||||
var pa = this.data.getImages(target, size, 'before').length - 1
|
var pa = this.data.getImages(target, size, 'before').length - 1
|
||||||
|
|
||||||
// do the update...
|
// do the update...
|
||||||
|
// no threshold beans force load...
|
||||||
|
if(threshold == 0
|
||||||
// the target is not loaded...
|
// the target is not loaded...
|
||||||
if(threshold == 0 || this.ribbons.getImage(target).length == 0){
|
|| this.ribbons.getImage(target).length == 0
|
||||||
|
// passed hard threshold on the right...
|
||||||
|
|| (nl < w && na > nl)
|
||||||
|
// passed hard threshold on the left...
|
||||||
|
|| (pl < w && pa > pl)){
|
||||||
|
|
||||||
this.resizeRibbon(target, size)
|
this.resizeRibbon(target, size)
|
||||||
|
|
||||||
// do a late resize...
|
// do a late resize...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user