Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Commit

Permalink
Updates to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
IjzerenHein committed Dec 2, 2014
1 parent 86d4fd1 commit cda80f2
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 40 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ FlexScrollView is a flexible and highly performant scroll-view for famo.us suppo
- bottom/right alignment
- all the good stuff you expect from a scrollview and more ;)

It is based on [ScrollController](docs/ScrollController.md) which implements the core functionality of the scroll-view, which is turn is inherited from [LayoutController](docs/LayoutController.md).
[FlexScrollView](docs/FlexScrollView.md) is based on [ScrollController](docs/ScrollController.md) which implements the core functionality of the scroll-view, which is turn is inherited from [LayoutController](docs/LayoutController.md).

### Take the [FlexScrollView Tutorial](tutorials/FlexScrollView.md)
### For a full overview, take the [FlexScrollView Tutorial](tutorials/FlexScrollView.md)


## Standard layouts
Expand Down
5 changes: 3 additions & 2 deletions docs/layouts/CollectionLayout.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ continues at the next column/row.
Example:

```javascript
var FlexScrollView = require('famous-flex/FlexScrollView');
var CollectionLayout = require('famous-flex/layouts/CollectionLayout');

scrollView = new FlexScrollView({
var scrollView = new FlexScrollView({
layout: CollectionLayout,
layoutOptions: {
itemSize: [100, 100], // item has width and height of 100 pixels
Expand All @@ -27,6 +28,6 @@ scrollView = new FlexScrollView({
new Surface({content: 'item 2'}),
new Surface({content: 'item 3'})
]
})
});
```

6 changes: 3 additions & 3 deletions docs/layouts/GridLayout.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ columns and rows.
|options|type|description|
|---|---|---|
|`cells`|Size|Number of cells: [columns, rows]|
|`[margins]`|Array|Margins applied to the outside (e.g. [10, 20, 10, 20])|
|`[margins]`|Number/Array|Margins shorthand (e.g. 5, [10, 20], [2, 5, 2, 10])|
|`[spacing]`|Size|Spacing between renderables. (e.g. [10, 10]|

Example:

```javascript
var GridLayout = require('famous-flex/layouts/GridLayout');

new LayoutController({
var layoutController = new LayoutController({
layout: GridLayout,
layoutOptions: {
cells: [10, 5], // 10 columns, 5 rows
Expand All @@ -26,6 +26,6 @@ new LayoutController({
new Surface({content: 'item 2'}),
new Surface({content: 'item 3'})
]
})
});
```

6 changes: 3 additions & 3 deletions docs/layouts/HeaderFooterLayout.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ Three part layout consisting of a top-header, bottom-footer and middle part.
|---|---|---|
|`[headerSize]`|Number|Height of the header|
|`[footerSize]`|Number|Height of the footer|
|`[margins]`|Number/Array|Margins|
|`[margins]`|Number/Array|Margins shorthand (e.g. 5, [10, 20], [2, 5, 2, 10])|

Example:

```javascript
var HeaderFooterLayout = require('famous-flex/layouts/HeaderFooterLayout');

new LayoutController({
var layout = new LayoutController({
layout: HeaderFooterLayout,
layoutOptions: {
headerSize: 60, // header has height of 60 pixels
Expand All @@ -24,6 +24,6 @@ new LayoutController({
content: new Surface({content: 'This is the content surface'}),
footer: new Surface({content: 'This is the footer surface'})
}
})
});
```

16 changes: 8 additions & 8 deletions docs/layouts/ListLayout.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ Lays out items and optionally sticky sections from top to bottom or left to righ
Example:

```javascript
var ScrollView = require('famous-flex/ScrollView');
var FlexScrollView = require('famous-flex/FlexScrollView');
var ListLayout = require('famous-flex/layouts/ListLayout');

var scrollView = new ScrollView({
var scrollView = new FlexScrollView({
layout: ListLayout,
layoutOptions: {
isSectionCallback: _isSection,
margins: [20, 10, 20, 10],
spacing: 1,
isSectionCallback: function(renderNode) {
return renderNode.isSection;
},
},
dataSource: [
// first section
Expand All @@ -30,7 +34,7 @@ var scrollView = new ScrollView({
_createCell(),
]
});
this.add(tableView);
this.add(scrollView);

function _createCell() {
return new Surface({
Expand All @@ -47,9 +51,5 @@ function _createSection() {
section.isSection = true; // mark renderNode as section
return section;
}

function _isSection(renderNode) {
return renderNode.isSection;
}
```

6 changes: 3 additions & 3 deletions docs/layouts/NavBarLayout.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ When no item-width is specified, the width of the renderable itsself is used.

|options|type|description|
|---|---|---|
|`[margins]`|Margins|Margins to use (see Margins)|
|`[margins]`|Number/Array|Margins shorthand (e.g. 5, [10, 20], [2, 5, 2, 10])|
|`[itemWidth]`|Number|Width of the left & right items|
|`[leftItemWidth]`|Number|Width of the left items|
|`[rightItemWidth]`|Number|Width of the right items|
Expand All @@ -18,7 +18,7 @@ Example:
```javascript
var NavBarLayout = require('famous-flex/layouts/NavBarLayout');

new LayoutController({
var layout = new LayoutController({
layout: NavBarLayout,
layoutOptions: {
margins: [5, 5, 5, 5], // margins to utilize
Expand All @@ -35,6 +35,6 @@ new LayoutController({
new Surface({content: 'right2'})
]
}
})
});
```

5 changes: 3 additions & 2 deletions src/layouts/CollectionLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
* Example:
*
* ```javascript
* var FlexScrollView = require('famous-flex/FlexScrollView');
* var CollectionLayout = require('famous-flex/layouts/CollectionLayout');
*
* scrollView = new FlexScrollView({
* var scrollView = new FlexScrollView({
* layout: CollectionLayout,
* layoutOptions: {
* itemSize: [100, 100], // item has width and height of 100 pixels
Expand All @@ -39,7 +40,7 @@
* new Surface({content: 'item 2'}),
* new Surface({content: 'item 3'})
* ]
* })
* });
* ```
* @module
*/
Expand Down
6 changes: 3 additions & 3 deletions src/layouts/GridLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
* |options|type|description|
* |---|---|---|
* |`cells`|Size|Number of cells: [columns, rows]|
* |`[margins]`|Array|Margins applied to the outside (e.g. [10, 20, 10, 20])|
* |`[margins]`|Number/Array|Margins shorthand (e.g. 5, [10, 20], [2, 5, 2, 10])|
* |`[spacing]`|Size|Spacing between renderables. (e.g. [10, 10]|
*
* Example:
*
* ```javascript
* var GridLayout = require('famous-flex/layouts/GridLayout');
*
* new LayoutController({
* var layoutController = new LayoutController({
* layout: GridLayout,
* layoutOptions: {
* cells: [10, 5], // 10 columns, 5 rows
Expand All @@ -38,7 +38,7 @@
* new Surface({content: 'item 2'}),
* new Surface({content: 'item 3'})
* ]
* })
* });
* ```
* @module
*/
Expand Down
6 changes: 3 additions & 3 deletions src/layouts/HeaderFooterLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
* |---|---|---|
* |`[headerSize]`|Number|Height of the header|
* |`[footerSize]`|Number|Height of the footer|
* |`[margins]`|Number/Array|Margins|
* |`[margins]`|Number/Array|Margins shorthand (e.g. 5, [10, 20], [2, 5, 2, 10])|
*
* Example:
*
* ```javascript
* var HeaderFooterLayout = require('famous-flex/layouts/HeaderFooterLayout');
*
* new LayoutController({
* var layout = new LayoutController({
* layout: HeaderFooterLayout,
* layoutOptions: {
* headerSize: 60, // header has height of 60 pixels
Expand All @@ -35,7 +35,7 @@
* content: new Surface({content: 'This is the content surface'}),
* footer: new Surface({content: 'This is the footer surface'})
* }
* })
* });
* ```
* @module
*/
Expand Down
16 changes: 8 additions & 8 deletions src/layouts/ListLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@
* Example:
*
* ```javascript
* var ScrollView = require('famous-flex/ScrollView');
* var FlexScrollView = require('famous-flex/FlexScrollView');
* var ListLayout = require('famous-flex/layouts/ListLayout');
*
* var scrollView = new ScrollView({
* var scrollView = new FlexScrollView({
* layout: ListLayout,
* layoutOptions: {
* isSectionCallback: _isSection,
* margins: [20, 10, 20, 10],
* spacing: 1,
* isSectionCallback: function(renderNode) {
* return renderNode.isSection;
* },
* },
* dataSource: [
* // first section
Expand All @@ -41,7 +45,7 @@
* _createCell(),
* ]
* });
* this.add(tableView);
* this.add(scrollView);
*
* function _createCell() {
* return new Surface({
Expand All @@ -58,10 +62,6 @@
* section.isSection = true; // mark renderNode as section
* return section;
* }
*
* function _isSection(renderNode) {
* return renderNode.isSection;
* }
* ```
* @module
*/
Expand Down
6 changes: 3 additions & 3 deletions src/layouts/NavBarLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* |options|type|description|
* |---|---|---|
* |`[margins]`|Margins|Margins to use (see Margins)|
* |`[margins]`|Number/Array|Margins shorthand (e.g. 5, [10, 20], [2, 5, 2, 10])|
* |`[itemWidth]`|Number|Width of the left & right items|
* |`[leftItemWidth]`|Number|Width of the left items|
* |`[rightItemWidth]`|Number|Width of the right items|
Expand All @@ -29,7 +29,7 @@
* ```javascript
* var NavBarLayout = require('famous-flex/layouts/NavBarLayout');
*
* new LayoutController({
* var layout = new LayoutController({
* layout: NavBarLayout,
* layoutOptions: {
* margins: [5, 5, 5, 5], // margins to utilize
Expand All @@ -46,7 +46,7 @@
* new Surface({content: 'right2'})
* ]
* }
* })
* });
* ```
* @module
*/
Expand Down

0 comments on commit cda80f2

Please sign in to comment.