javascript - Famo.us: Issue with Dragging and Panning -
i added 2 draggable containersurfaces (dragbox1 & dragbox2) onto transparent containersurface (panlayer), draggable. enables panning while enabling single dragging of 2 boxes.
this worked in famo.us 0.2, ever since started using version 0.3 dragging box activates panning. how stop drag-event propagating?
define(function(require, exports, module) { var engine = require('famous/core/engine'); var containersurface = require('famous/surfaces/containersurface'); var statemodifier = require('famous/modifiers/statemodifier'); var transform = require('famous/core/transform'); var draggable = require('famous/modifiers/draggable'); var maincontext = engine.createcontext(); var dragbox1 = new containersurface({ size: [200,200], properties: { backgroundcolor: '#ff0000' } }); var dragbox2 = new containersurface({ size: [200,200], properties: { backgroundcolor: '#0000ff' } }); var dragmod1 = new draggable({}); var dragmod2 = new draggable({}); var panmod = new draggable({}); var contentlayer = new containersurface({ size: [undefined, undefined], properties: { backgroundcolor: '#00ffff' } }); var panlayer = new containersurface({ size: [undefined, undefined], properties: { backgroundcolor: 'rgba(0, 0, 0, 0)' } }); panmod.subscribe(contentlayer); dragmod1.subscribe(dragbox1); dragmod2.subscribe(dragbox2); contentlayer.add(panmod).add(panlayer); panlayer.add(dragmod1).add(dragbox1); panlayer.add(dragmod2).add(new statemodifier({transform: transform.translate(300,0,0)})).add(dragbox2); maincontext.add(contentlayer); });
Comments
Post a Comment