Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
remove experimental 'reveal' mode... we will provide something similar
Browse files Browse the repository at this point in the history
but as a different element
  • Loading branch information
frankiefu committed May 7, 2014
1 parent 1fffda6 commit c64a333
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 52 deletions.
21 changes: 0 additions & 21 deletions core-header-panel.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,3 @@ mode: cover
bottom: 0;
left: 0;
}

/*
mode: reveal
*/
/*@polyfill :host([mode=reveal]) #outerContainer > .core-header, :host([mode=reveal]) #outerContainer > core-toolbar */
:host([mode=reveal]) ::content#headerContent > * {
z-index: 1;
}

:host([mode=reveal]) #mainPanel {
position: static;
}

:host([mode=reveal]) #mainContainer {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}

29 changes: 3 additions & 26 deletions core-header-panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

<core-layout id="mainPanel" core-flex>

<div id="mainContainer" core-flex?="{{mode !== 'cover' && mode != 'reveal'}}" on-scroll="{{scroll}}">
<div id="mainContainer" core-flex?="{{mode !== 'cover'}}" on-scroll="{{scroll}}">
<content id="mainContent" select="*"></content>
</div>

Expand Down Expand Up @@ -122,31 +122,22 @@
* @default false
*/
shadow: false,

},

prevScrollTop: 0,

attached: function() {
this.async('scroll', null, 100);
this.async('scroll');
},

modeChanged: function() {
this.reset();
this.scroll();
},

get header() {
return this.$.headerContent.getDistributedNodes()[0];
},

reset: function() {
this.$.mainContainer.style = null;
this.header.style = null;
},

scroll: function() {
var shadowMode = {'waterfall': 1, 'waterfall-tall': 1, 'reveal': 1};
var shadowMode = {'waterfall': 1, 'waterfall-tall': 1};
var noShadow = {'seamed': 1, 'cover': 1, 'scroll': 1};
var tallMode = {'waterfall-tall': 1};

Expand All @@ -163,21 +154,7 @@
if (tallMode[this.mode]) {
header.classList.toggle(this.tallClass, atTop);
}

if (this.mode === 'reveal') {
if (!this.headerHeight) {
this.headerHeight = header.offsetHeight;
main.style.paddingTop = this.headerHeight + 'px';
}

this.y = Math.min(this.headerHeight,
Math.max((this.y || 0) + (sTop - this.prevScrollTop), 0));
var s = header.style;
s.webkitTransform = s.transform = 'translateY(' + (-this.y) + 'px)';
}
}

this.prevScrollTop = sTop;
}

});
Expand Down
5 changes: 0 additions & 5 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,5 @@
<div class="content" style="margin: 60px 60px 60px 0;"></div>
</core-header-panel>

<core-header-panel mode="reveal">
<div class="core-header">reveal</div>
<div class="content"></div>
</core-header-panel>

</body>
</html>

0 comments on commit c64a333

Please sign in to comment.