Created
April 23, 2014 20:11
-
-
Save cj3kim/11230574 to your computer and use it in GitHub Desktop.
ScrollContainer bug?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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);
});