-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix group more-info not updating * Remove old observer * Upgrade translate(0) hack
- Loading branch information
1 parent
8078158
commit 41e97a6
Showing
6 changed files
with
110 additions
and
21 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<link rel="import" href="../../bower_components/polymer/polymer-element.html"> | ||
<link rel="import" href="../../bower_components/app-layout/app-header-layout/app-header-layout.html"> | ||
<!-- | ||
@license | ||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved. | ||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | ||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | ||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | ||
Code distributed by Google as part of the polymer project is also | ||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
--> | ||
|
||
<!-- | ||
This code is copied from app-header-layout. | ||
'fullbleed' support is removed as Home Assisstant doesn't use it. | ||
transform: translate(0) is added. | ||
--> | ||
|
||
<dom-module id="ha-app-layout"> | ||
<template> | ||
<style> | ||
:host { | ||
display: block; | ||
/** | ||
* Force app-header-layout to have its own stacking context so that its parent can | ||
* control the stacking of it relative to other elements (e.g. app-drawer-layout). | ||
* This could be done using `isolation: isolate`, but that's not well supported | ||
* across browsers. | ||
*/ | ||
position: relative; | ||
z-index: 0; | ||
} | ||
#wrapper ::slotted([slot=header]) { | ||
@apply --layout-fixed-top; | ||
z-index: 1; | ||
} | ||
#wrapper.initializing ::slotted([slot=header]) { | ||
position: relative; | ||
} | ||
:host([has-scrolling-region]) { | ||
height: 100%; | ||
} | ||
:host([has-scrolling-region]) #wrapper ::slotted([slot=header]) { | ||
position: absolute; | ||
} | ||
:host([has-scrolling-region]) #wrapper.initializing ::slotted([slot=header]) { | ||
position: relative; | ||
} | ||
:host([has-scrolling-region]) #wrapper #contentContainer { | ||
@apply --layout-fit; | ||
-webkit-overflow-scrolling: touch; | ||
} | ||
:host([has-scrolling-region]) #wrapper.initializing #contentContainer { | ||
position: relative; | ||
} | ||
#contentContainer { | ||
/* Create a stacking context here so that all children appear below the header. */ | ||
position: relative; | ||
/* Using 'transform' will cause 'position: fixed' elements to behave like | ||
'position: absolute' relative to this element. */ | ||
transform: translate(0); | ||
z-index: 0; | ||
} | ||
:host([has-scrolling-region]) .scroll-limiter { | ||
overflow-y: auto; | ||
height: 100% | ||
} | ||
@media print { | ||
:host([has-scrolling-region]) .scroll-limiter { | ||
overflow-y: visible; | ||
} | ||
} | ||
</style> | ||
|
||
<div id="wrapper" class="initializing"> | ||
<slot id="headerSlot" name="header"></slot> | ||
|
||
<div id="contentContainer"> | ||
<div class="scroll-limiter"> | ||
<slot></slot> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</template> | ||
</dom-module> | ||
|
||
<script> | ||
class HaAppLayout extends customElements.get('app-header-layout') { | ||
static get is() { return 'ha-app-layout'; } | ||
} | ||
customElements.define(HaAppLayout.is, HaAppLayout); | ||
</script> |
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
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