Skip to content

Instantly share code, notes, and snippets.

@cj3kim cj3kim/gist:11230574
Created Apr 23, 2014

Embed
What would you like to do?
ScrollContainer bug?
function ScrollContainer(options) {
this.options = Object.create(ScrollContainer.DEFAULT_OPTIONS);
this._optionsManager = new OptionsManager(this.options);
if (options) this.setOptions(options);
this.container = new ContainerSurface(this.options.container);
this.scrollview = new Scrollview(this.options.scrollview);
this.surface.add(this.scrollview);
EventHandler.setInputHandler(this, this.scrollview);
EventHandler.setOutputHandler(this, this.scrollview);
this.scrollview.subscribe(this.container);
}
ScrollContainer.DEFAULT_OPTIONS = {
container: {
properties: {overflow : 'hidden'}
},
scrollview: {direction: Utility.Direction.X}
};
@cj3kim

This comment has been minimized.

Copy link
Owner Author

commented Apr 23, 2014

require("./famous-polyfills/index");

require('domready')(function () {
var Engine = require('./famous/core/Engine');
var InputSurface = require('./famous/surfaces/InputSurface');
var StateModifier = require('./famous/modifiers/StateModifier');
var ContainerSurface = require('./famous/surfaces/ContainerSurface');
var ScrollContainer = require('./famous/views/ScrollContainer');

// create the main context
var mainContext = Engine.createContext();

var wrapper = new ContainerSurface({
size: [undefined, undefined],
});

var chatWrapper = new ContainerSurface({
size: [false, undefined],
properties: {
width: '80%',
backgroundColor: 'blue'
}
});

var chatDisplay = new ScrollContainer({
size: [undefined, false],
properties: {
height: '80%',
backgroundColor: 'red'
},
surface: undefined
});

var chatMessages = [];
chatDisplay.sequenceFrom(chatMessages);

var chatInput = new InputSurface({
size: [undefined, false],
properties: {
height: '20%',
backgroundColor: 'yellow'
}
});

chatWrapper.add(chatDisplay);
chatWrapper.add(chatInput);
wrapper.add(chatWrapper)

mainContext.add(wrapper);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.