Skip to content

Commit

Permalink
Improve docs for .paper-header
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Garcia committed Mar 21, 2016
1 parent 9e264cc commit 9344473
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
8 changes: 8 additions & 0 deletions paper-scroll-header-panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@
`paper-scroll-header-panel` works well with `paper-toolbar` but can use any element
that represents a header by adding a `paper-header` class to it.
Note: If the class `paper-header` is used, the header must be positioned relative or absolute. e.g.
```css
.paper-header {
position: relative;
}
```
```html
<paper-scroll-header-panel>
<div class="paper-header">Header</div>
Expand Down
26 changes: 13 additions & 13 deletions test/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@

setup(function() {
scrollHeaderPanel = fixture('trivialProgress');

toolbar = Polymer.dom(scrollHeaderPanel).querySelector('paper-toolbar');
content = Polymer.dom(scrollHeaderPanel).querySelector('.content');
});

test('check default', function() {
assert.equal(scrollHeaderPanel.header, toolbar);
assert.equal(scrollHeaderPanel.content, content);
assert.equal(scrollHeaderPanel.condenses, false);
assert.equal(scrollHeaderPanel.noReveal, false);
assert.equal(scrollHeaderPanel.fixed, false);
assert.typeOf(scrollHeaderPanel.scroller, 'object');
assert.equal(scrollHeaderPanel.keepCondensedHeader, false);
assert.equal(scrollHeaderPanel.keepCondensedHeader, false);

scrollHeaderPanel.measureHeaderHeight();
assert.equal(scrollHeaderPanel.headerHeight, toolbar.offsetHeight);
assert.equal(scrollHeaderPanel.condensedHeaderHeight, Math.round(toolbar.offsetHeight * 1/3));
flush(function() {
assert.equal(scrollHeaderPanel.header, toolbar);
assert.equal(scrollHeaderPanel.content, content);
assert.equal(scrollHeaderPanel.condenses, false);
assert.equal(scrollHeaderPanel.noReveal, false);
assert.equal(scrollHeaderPanel.fixed, false);
assert.typeOf(scrollHeaderPanel.scroller, 'object');
assert.equal(scrollHeaderPanel.keepCondensedHeader, false);
assert.equal(scrollHeaderPanel.keepCondensedHeader, false);
scrollHeaderPanel.measureHeaderHeight();
assert.equal(scrollHeaderPanel.headerHeight, toolbar.offsetHeight);
assert.equal(scrollHeaderPanel.condensedHeaderHeight, Math.round(toolbar.offsetHeight * 1/3));
});
});

test('condensation', function(done) {
Expand Down

0 comments on commit 9344473

Please sign in to comment.