mirror of
https://github.com/home-assistant/frontend.git
synced 2026-05-08 17:28:46 +01:00
61 lines
1.5 KiB
HTML
61 lines
1.5 KiB
HTML
<link rel='import' href='../../bower_components/polymer/polymer.html'>
|
|
|
|
<link rel='import' href='../../bower_components/paper-scroll-header-panel/paper-scroll-header-panel.html'>
|
|
|
|
<link rel='import' href='../../bower_components/paper-toolbar/paper-toolbar.html'>
|
|
<link rel='import' href='../../bower_components/paper-icon-button/paper-icon-button.html'>
|
|
|
|
<dom-module id='partial-base'>
|
|
<style is="custom-style" include="iron-positioning"></style>
|
|
<style>
|
|
:host {
|
|
-ms-user-select: none;
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
}
|
|
|
|
.menu-icon {
|
|
margin-right: 24px;
|
|
}
|
|
</style>
|
|
<template>
|
|
<paper-scroll-header-panel class='fit'>
|
|
<paper-toolbar>
|
|
<paper-icon-button icon='mdi:menu' class$='[[computeMenuButtonClass(narrow, showMenu)]]' on-tap='toggleMenu'></paper-icon-button>
|
|
<div class="title">
|
|
<content select='[header-title]'></content>
|
|
</div>
|
|
<content select='[header-buttons]'></content>
|
|
</paper-toolbar>
|
|
|
|
<content></content>
|
|
</paper-scroll-header-panel>
|
|
</template>
|
|
</dom-module>
|
|
|
|
<script>
|
|
Polymer({
|
|
is: 'partial-base',
|
|
|
|
properties: {
|
|
narrow: {
|
|
type: Boolean,
|
|
value: false,
|
|
},
|
|
|
|
showMenu: {
|
|
type: Boolean,
|
|
value: false,
|
|
},
|
|
},
|
|
|
|
computeMenuButtonClass: function (narrow, showMenu) {
|
|
return !narrow && showMenu ? 'menu-icon invisible' : 'menu-icon';
|
|
},
|
|
|
|
toggleMenu: function () {
|
|
this.fire('open-menu');
|
|
},
|
|
});
|
|
</script>
|