some tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2015-12-26 06:44:43 +03:00
parent 2e2ddce373
commit caf1ba4c9f
3 changed files with 20 additions and 17 deletions

View File

@ -83,7 +83,9 @@ core.ImageGridFeatures.Feature('viewer-testing', [
// ui control... // ui control...
'ui-clickable', 'ui-clickable',
//'ui-direct-control-jquery', //'ui-direct-control-jquery',
//'ui-direct-control-gsap', // XXX BUG: on touch down and first move this gets offset by a distance
// not sure why...
'ui-direct-control-gsap',
// experimental and optional features... // experimental and optional features...
//'auto-single-image', //'auto-single-image',

View File

@ -546,7 +546,7 @@ actions.Actions({
fitOrig: ['Zoom/Fit to original scale', fitOrig: ['Zoom/Fit to original scale',
function(){ function(){
this.ribbons.setScale(1) this.ribbons.scale(1)
this.refresh() this.refresh()
}], }],
// NOTE: if this gets a count argument it will fit count images, // NOTE: if this gets a count argument it will fit count images,
@ -2113,8 +2113,11 @@ var CurrentImageIndicatorActions = actions.Actions({
.addClass('current-marker ui-current-image-indicator') .addClass('current-marker ui-current-image-indicator')
.css({ .css({
opacity: '0', opacity: '0',
//top: '0px', // NOTE: these are not used for positioning
//left: '0px', // but are needed for correct absolute
// placement...
top: '0px',
left: '0px',
}) })
.appendTo(ribbon) .appendTo(ribbon)
.animate({ .animate({
@ -2607,7 +2610,7 @@ module.RibbonsPlacement = core.ImageGridFeatures.Feature({
}, },
actions: actions.Actions({ actions: actions.Actions({
toggleRibbonsPlacementMode: ['Interface/', toggleRibbonsPlacementMode: ['- Interface/',
Toggler(null, function(_, state){ Toggler(null, function(_, state){
if(state == null){ if(state == null){
return this.config['ui-ribbons-placement-mode'] return this.config['ui-ribbons-placement-mode']
@ -2682,11 +2685,12 @@ module.Clickable = core.ImageGridFeatures.Feature({
}) })
// XXX add tap/click to focus...
// XXX add pinch-zoom... // XXX add pinch-zoom...
// XXX add vertical scroll... // XXX add vertical scroll...
// XXX disable drag in single image mode unless image is larger than the screen... // XXX disable drag in single image mode unless image is larger than the screen...
// XXX BUG: current image indicator gets shown in random places... // XXX BUG: current image indicator gets shown in random places...
// XXX BUG: this does it's work via css left which is both slow and
// messes up positioning...
var DirectControljQ = var DirectControljQ =
module.DirectControljQ = core.ImageGridFeatures.Feature({ module.DirectControljQ = core.ImageGridFeatures.Feature({
title: '', title: '',
@ -2749,6 +2753,8 @@ module.DirectControljQ = core.ImageGridFeatures.Feature({
}) })
// XXX BUG: this does not account for scale when setting the initial drag
// position, resulting in a jump...
// XXX disable drag in single image mode unless image is larger than the screen... // XXX disable drag in single image mode unless image is larger than the screen...
// XXX do not use this for production -- GSAp has a bad license... // XXX do not use this for production -- GSAp has a bad license...
var DirectControlGSAP = var DirectControlGSAP =
@ -2767,11 +2773,6 @@ module.DirectControlGSAP = core.ImageGridFeatures.Feature({
// XXX add setup/taredown... // XXX add setup/taredown...
handlers: [ handlers: [
// setup ribbon dragging... // setup ribbon dragging...
// XXX fast but uses messes up positioning...
// ...setting type: 'left' will fix this but make things
// really slow (as slow as jQuery.ui.draggable(..))...
// XXX shifting to using transforms for centering fixes the align
// issue but makes the initial move jump...
['updateRibbon', ['updateRibbon',
function(_, target){ function(_, target){
var that = this var that = this
@ -2781,8 +2782,6 @@ module.DirectControlGSAP = core.ImageGridFeatures.Feature({
if(r.length > 0 && !r.hasClass('draggable')){ if(r.length > 0 && !r.hasClass('draggable')){
r.addClass('draggable') r.addClass('draggable')
var o, scale
Draggable.create(r, { Draggable.create(r, {
type: 'x', type: 'x',
cursor: 'auto', cursor: 'auto',
@ -2790,8 +2789,6 @@ module.DirectControlGSAP = core.ImageGridFeatures.Feature({
var c = that.ribbons.getImageByPosition('center', r) var c = that.ribbons.getImageByPosition('center', r)
that that
.updateRibbon(c) .updateRibbon(c)
// XXX is this correct???
//.updateCurrentImageIndicator()
}}) }})
} }
}], }],

View File

@ -308,8 +308,7 @@ var RibbonsPrototype = {
}, },
// DOM Adapter... // DOM Adapter...
dom: legacyDOMAdapter, dom: DOMAdapter,
//dom: DOMAdapter,
// Constructors... // Constructors...
createViewer: RibbonsClassPrototype.createViewer, createViewer: RibbonsClassPrototype.createViewer,
@ -1495,6 +1494,11 @@ var RibbonsPrototype = {
// NOTE: the argument force is currently ignored, it serves as a // NOTE: the argument force is currently ignored, it serves as a
// place holder for overloading... // place holder for overloading...
// //
// XXX this depends on image size being fixed for compensating
// position shift...
// ...a simpler way to go is to check .position().left of the
// reference image before and after the chage and add the delta
// to the offset...
// XXX make this add images in chunks of adjacent images... // XXX make this add images in chunks of adjacent images...
// XXX might be a good idea to do the actual adding in requestAnimationFrame(..) // XXX might be a good idea to do the actual adding in requestAnimationFrame(..)
updateRibbon: function(gids, ribbon, reference, force){ updateRibbon: function(gids, ribbon, reference, force){