More Material

This commit is contained in:
Paulus Schoutsen 2016-04-08 00:10:39 -07:00
parent d9232df18b
commit cdfec7dc90
38 changed files with 179 additions and 216 deletions

View File

@ -17,6 +17,7 @@
border-radius: 2px; border-radius: 2px;
} }
.caption { .caption {
@apply(--paper-font-common-nowrap);
position: absolute; position: absolute;
left: 0px; left: 0px;
right: 0px; right: 0px;
@ -32,9 +33,6 @@
font-weight: 500; font-weight: 500;
line-height: 16px; line-height: 16px;
color: white; color: white;
white-space: nowrap;
overflow-x: hidden;
text-overflow: ellipsis;
} }
</style> </style>
<template> <template>

View File

@ -15,13 +15,13 @@
cursor: pointer; cursor: pointer;
} }
.header { .header {
font-size: 24px; @apply(--paper-font-headline);
color: var(--primary-text-color);
padding: 24px 16px 16px; padding: 24px 16px 16px;
text-transform: capitalize; text-transform: capitalize;
} }
.header .name { .header .name {
overflow: hidden; @apply(--paper-font-common-nowrap);
text-overflow: ellipsis;
} }
ha-entity-toggle { ha-entity-toggle {
margin-left: 16px; margin-left: 16px;

View File

@ -5,7 +5,7 @@
<dom-module id='ha-introduction-card'> <dom-module id='ha-introduction-card'>
<style> <style>
:host { :host {
font-size: 14px; @apply(--paper-font-body1)
} }
a { a {
color: var(--dark-primary-color); color: var(--dark-primary-color);

View File

@ -5,6 +5,7 @@
<dom-module id="ha-entity-toggle"> <dom-module id="ha-entity-toggle">
<style> <style>
paper-icon-button { paper-icon-button {
color: var(--primary-text-color);
transition: color .5s; transition: color .5s;
} }
paper-icon-button[state-active] { paper-icon-button[state-active] {
@ -13,6 +14,7 @@
paper-toggle-button { paper-toggle-button {
cursor: pointer; cursor: pointer;
--paper-toggle-button-label-spacing: 0; --paper-toggle-button-label-spacing: 0;
padding: 9px 0;
} }
</style> </style>
<template> <template>

View File

@ -25,6 +25,14 @@ export default new Polymer({
}, },
}, },
listeners: {
tap: 'onTap',
},
onTap(ev) {
ev.stopPropagation();
},
ready() { ready() {
this.forceStateChange(); this.forceStateChange();
}, },

View File

@ -11,7 +11,9 @@
background-color: white; background-color: white;
} }
.header { .header {
font-size: 24px; @apply(--paper-font-headline);
@apply(--paper-font-common-expensive-kerning);
opacity: var(--dark-primary-opacity);
padding: 24px 16px 16px; padding: 24px 16px 16px;
text-transform: capitalize; text-transform: capitalize;
} }

View File

@ -8,6 +8,8 @@
<style is="custom-style" include="iron-flex"></style> <style is="custom-style" include="iron-flex"></style>
<style> <style>
:host { :host {
@apply(--paper-font-body1);
display: block; display: block;
line-height: 2em; line-height: 2em;
} }
@ -32,7 +34,7 @@
} }
a { a {
color: var(--accent-color); color: var(--primary-color);
} }
</style> </style>
<template> <template>

View File

@ -1,62 +0,0 @@
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../state-summary/state-card.html">
<dom-module id="state-cards">
<style is="custom-style" include="iron-flex"></style>
<style>
:host {
display: block;
}
@media all and (min-width: 1020px) {
.state-card {
width: calc(50% - 44px);
margin: 8px 0 0 8px;
}
}
@media all and (min-width: 1356px) {
.state-card {
width: calc(33% - 38px);
}
}
@media all and (min-width: 1706px) {
.state-card {
width: calc(25% - 42px);
}
}
.no-states-content {
max-width: 500px;
background-color: #fff;
border-radius: 2px;
box-shadow: rgba(0, 0, 0, 0.098) 0px 2px 4px, rgba(0, 0, 0, 0.098) 0px 0px 3px;
padding: 0 16px 8px;
margin: 16px;
}
</style>
<template>
<div class='horizontal layout wrap'>
<template is='dom-repeat' items="{{states}}">
<state-card class="state-card" state-obj="[[item]]"></state-card>
</template>
<template is='dom-if' if="[[computeEmptyStates(states)]]">
<div class='no-states-content'>
<h3>Hi there!</h3>
<p>
It looks like we have nothing to show you right now. It could be that we have not yet discovered all your devices but it is more likely that you have not configured Home Assistant yet.
</p>
<p>
Please see the <a href='https://home-assistant.io/getting-started/' target='_blank'>Getting Started</a> section on how to setup your devices.
</p>
</div>
</template>
</div>
</template>
</dom-module>

View File

@ -1,18 +0,0 @@
import Polymer from '../polymer';
require('../state-summary/state-card');
export default new Polymer({
is: 'state-cards',
properties: {
states: {
type: Array,
value: [],
},
},
computeEmptyStates(states) {
return states.length === 0;
},
});

View File

@ -6,7 +6,7 @@
<dom-module id="state-info"> <dom-module id="state-info">
<style> <style>
:host { :host {
line-height: 1.5; @apply(--paper-font-body1);
min-width: 150px; min-width: 150px;
white-space: nowrap; white-space: nowrap;
} }
@ -20,17 +20,19 @@
} }
.name { .name {
@apply(--paper-font-common-nowrap);
text-transform: capitalize; text-transform: capitalize;
font-weight: 400; color: var(--primary-text-color);
text-overflow: ellipsis; line-height: 40px;
overflow-x: hidden; }
.name[in-dialog] {
line-height: 20px;
} }
.time-ago { .time-ago {
@apply(--paper-font-common-nowrap);
color: var(--secondary-text-color); color: var(--secondary-text-color);
margin-top: -2px;
text-overflow: ellipsis;
overflow-x: hidden;
} }
</style> </style>
@ -39,11 +41,13 @@
<state-badge state-obj='[[stateObj]]'></state-badge> <state-badge state-obj='[[stateObj]]'></state-badge>
<div class='info'> <div class='info'>
<div class='name'>[[stateObj.entityDisplay]]</div> <div class='name' in-dialog$='[[inDialog]]'>[[stateObj.entityDisplay]]</div>
<template is='dom-if' if='[[inDialog]]'>
<div class='time-ago'> <div class='time-ago'>
<relative-ha-datetime datetime-obj='[[stateObj.lastChangedAsDate]]'></relative-ha-datetime> <relative-ha-datetime datetime-obj='[[stateObj.lastChangedAsDate]]'></relative-ha-datetime>
</div> </div>
</template>
</div> </div>
</div> </div>

View File

@ -7,6 +7,11 @@ export default new Polymer({
is: 'state-info', is: 'state-info',
properties: { properties: {
detailed: {
type: Boolean,
value: false,
},
stateObj: { stateObj: {
type: Object, type: Object,
}, },

View File

@ -37,7 +37,7 @@
<template> <template>
<!-- entry-animation='slide-up-animation' exit-animation='slide-down-animation' --> <!-- entry-animation='slide-up-animation' exit-animation='slide-down-animation' -->
<paper-dialog id="dialog" with-backdrop opened='{{dialogOpen}}'> <paper-dialog id="dialog" with-backdrop opened='{{dialogOpen}}'>
<h2><state-card-content state-obj="[[stateObj]]"></state-card-content></h2> <h2><state-card-content state-obj="[[stateObj]]" in-dialog></state-card-content></h2>
<paper-dialog-scrollable> <paper-dialog-scrollable>
<template is='dom-if' if="[[showHistoryComponent]]"> <template is='dom-if' if="[[showHistoryComponent]]">
<state-history-charts state-history="[[stateHistory]]" <state-history-charts state-history="[[stateHistory]]"

View File

@ -22,11 +22,11 @@
} }
.version { .version {
font-size: 24px; @apply(--paper-font-headline);
} }
.develop { .develop {
font-size: 18px; @apply(--paper-font-subhead);
} }
.about a { .about a {
@ -44,6 +44,7 @@
} }
.error-log { .error-log {
@apply(--paper-font-code1)
clear: both; clear: both;
white-space: pre-wrap; white-space: pre-wrap;
} }
@ -83,7 +84,7 @@
The following errors have been logged this session: The following errors have been logged this session:
<paper-icon-button icon='mdi:refresh' on-tap='refreshErrorLog'></paper-icon-button> <paper-icon-button icon='mdi:refresh' on-tap='refreshErrorLog'></paper-icon-button>
</p> </p>
<pre class='error-log'>[[errorLog]]</pre> <div class='error-log'>[[errorLog]]</div>
</div> </div>
</partial-base> </partial-base>
</template> </template>

View File

@ -1,11 +1,26 @@
<link rel='import' href='../../bower_components/polymer/polymer.html'> <link rel='import' href='../../bower_components/polymer/polymer.html'>
<link rel="import" href="../../bower_components/paper-button/paper-button.html">
<link rel="import" href="../components/state-info.html">
<link rel='import' href='./state-card-display.html'>
<link rel='import' href='../components/state-info.html'> <link rel='import' href='../components/state-info.html'>
<dom-module id='state-card-configurator'> <dom-module id='state-card-configurator'>
<style is="custom-style" include="iron-flex iron-flex-alignment"></style>
<style>
paper-button {
color: var(--default-primary-color);
font-weight: 500;
top: 3px;
height: 37px;
}
</style>
<template> <template>
<state-card-display state-obj='[[stateObj]]'></state-card-display> <div class='horizontal justified layout'>
<state-info state-obj="[[stateObj]]" in-dialog='[[inDialog]]'></state-info>
<paper-button hidden$='[[inDialog]]'>[[stateObj.state]]</paper-button>
</div>
<!-- pre load the image so the dialog is rendered the proper size --> <!-- pre load the image so the dialog is rendered the proper size -->
<template is='dom-if' if='[[stateObj.attributes.description_image]]'> <template is='dom-if' if='[[stateObj.attributes.description_image]]'>

View File

@ -7,6 +7,11 @@ export default new Polymer({
is: 'state-card-configurator', is: 'state-card-configurator',
properties: { properties: {
inDialog: {
type: Boolean,
value: false,
},
stateObj: { stateObj: {
type: Object, type: Object,
}, },

View File

@ -19,16 +19,24 @@ export default new Polymer({
is: 'state-card-content', is: 'state-card-content',
properties: { properties: {
inDialog: {
type: Boolean,
value: false,
},
stateObj: { stateObj: {
type: Object, type: Object,
observer: 'stateObjChanged',
}, },
}, },
stateObjChanged(stateObj) { observers: [
'inputChanged(inDialog, stateObj)',
],
inputChanged(inDialog, stateObj) {
if (!stateObj) return; if (!stateObj) return;
dynamicContentUpdater( dynamicContentUpdater(
this, `STATE-CARD-${stateCardType(stateObj).toUpperCase()}`, { stateObj }); this, `STATE-CARD-${stateCardType(stateObj).toUpperCase()}`, { stateObj, inDialog });
}, },
}); });

View File

@ -6,17 +6,19 @@
<style is="custom-style" include="iron-flex iron-flex-alignment"></style> <style is="custom-style" include="iron-flex iron-flex-alignment"></style>
<style> <style>
.state { .state {
@apply(--paper-font-body1);
color: var(--primary-text-color);
margin-left: 16px; margin-left: 16px;
text-transform: capitalize; text-transform: capitalize;
font-weight: 400;
text-align: right; text-align: right;
line-height: 1.5; line-height: 40px;
} }
</style> </style>
<template> <template>
<div class='horizontal justified layout'> <div class='horizontal justified layout'>
<state-info state-obj="[[stateObj]]"></state-info> <state-info state-obj="[[stateObj]]" in-dialog='[[inDialog]]'></state-info>
<div class='state'>[[stateObj.stateDisplay]]</div> <div class='state'>[[stateObj.stateDisplay]]</div>
</div> </div>
</template> </template>

View File

@ -6,6 +6,11 @@ export default new Polymer({
is: 'state-card-display', is: 'state-card-display',
properties: { properties: {
detailed: {
type: Boolean,
value: false,
},
stateObj: { stateObj: {
type: Object, type: Object,
}, },

View File

@ -13,7 +13,7 @@
<template> <template>
<div class='horizontal justified layout'> <div class='horizontal justified layout'>
<state-info state-obj="[[stateObj]]"></state-info> <state-info state-obj="[[stateObj]]" in-dialog='[[inDialog]]'></state-info>
<paper-dropdown-menu no-label-float selected-item-label='{{selectedOption}}' on-tap='stopPropagation'> <paper-dropdown-menu no-label-float selected-item-label='{{selectedOption}}' on-tap='stopPropagation'>
<paper-menu class="dropdown-content" selected="[[computeSelected(stateObj)]]"> <paper-menu class="dropdown-content" selected="[[computeSelected(stateObj)]]">
<template is='dom-repeat' items='[[stateObj.attributes.options]]'> <template is='dom-repeat' items='[[stateObj.attributes.options]]'>

View File

@ -9,6 +9,11 @@ export default new Polymer({
is: 'state-card-input_select', is: 'state-card-input_select',
properties: { properties: {
detailed: {
type: Boolean,
value: false,
},
stateObj: { stateObj: {
type: Object, type: Object,
}, },

View File

@ -13,7 +13,7 @@
<template> <template>
<div class='horizontal justified layout'> <div class='horizontal justified layout'>
<state-info state-obj="[[stateObj]]"></state-info> <state-info state-obj="[[stateObj]]" in-dialog='[[inDialog]]'></state-info>
<paper-slider min='[[min]]' max='[[max]]' value='{{value}}' step='[[step]]' pin on-change='selectedValueChanged'> <paper-slider min='[[min]]' max='[[max]]' value='{{value}}' step='[[step]]' pin on-change='selectedValueChanged'>
</paper-slider> </paper-slider>
</div> </div>

View File

@ -9,6 +9,11 @@ export default new Polymer({
is: 'state-card-input_slider', is: 'state-card-input_slider',
properties: { properties: {
detailed: {
type: Boolean,
value: false,
},
stateObj: { stateObj: {
type: Object, type: Object,
observer: 'stateObjectChanged', observer: 'stateObjectChanged',

View File

@ -10,29 +10,26 @@
} }
.state { .state {
@apply(--paper-font-common-nowrap);
@apply(--paper-font-body1);
margin-left: 16px; margin-left: 16px;
text-align: right; text-align: right;
overflow-x: hidden;
} }
.main-text { .main-text {
white-space: nowrap; @apply(--paper-font-common-nowrap);
overflow-x: hidden; color: var(--primary-text-color);
text-overflow: ellipsis;
text-transform: capitalize; text-transform: capitalize;
font-weight: 400;
} }
.secondary-text { .secondary-text {
white-space: nowrap; @apply(--paper-font-common-nowrap);
overflow-x: hidden;
text-overflow: ellipsis;
color: var(--secondary-text-color); color: var(--secondary-text-color);
} }
</style> </style>
<template> <template>
<div class='horizontal justified layout'> <div class='horizontal justified layout'>
<state-info state-obj="[[stateObj]]"></state-info> <state-info state-obj="[[stateObj]]" in-dialog='[[inDialog]]'></state-info>
<div class='state'> <div class='state'>
<div class='main-text'>[[computePrimaryText(stateObj, isPlaying)]]</div> <div class='main-text'>[[computePrimaryText(stateObj, isPlaying)]]</div>
<div class='secondary-text'>[[computeSecondaryText(stateObj)]]</div> <div class='secondary-text'>[[computeSecondaryText(stateObj)]]</div>

View File

@ -8,6 +8,11 @@ export default new Polymer({
is: 'state-card-media_player', is: 'state-card-media_player',
properties: { properties: {
detailed: {
type: Boolean,
value: false,
},
stateObj: { stateObj: {
type: Object, type: Object,
}, },

View File

@ -19,7 +19,7 @@
</style> </style>
<template> <template>
<div class='horizontal justified layout'> <div class='horizontal justified layout'>
<state-info state-obj="[[stateObj]]"></state-info> <state-info state-obj="[[stateObj]]" in-dialog='[[inDialog]]'></state-info>
<div class='state'> <div class='state'>
<paper-icon-button icon="mdi:arrow-up" on-tap='onMoveUpTap' <paper-icon-button icon="mdi:arrow-up" on-tap='onMoveUpTap'
disabled='[[computeIsFullyClosed(stateObj)]]'></paper-icon-button> disabled='[[computeIsFullyClosed(stateObj)]]'></paper-icon-button>

View File

@ -10,6 +10,11 @@ export default new Polymer({
is: 'state-card-rollershutter', is: 'state-card-rollershutter',
properties: { properties: {
detailed: {
type: Boolean,
value: false,
},
stateObj: { stateObj: {
type: Object, type: Object,
}, },

View File

@ -1,23 +1,23 @@
<link rel="import" href="../../bower_components/polymer/polymer.html"> <link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html"> <link rel="import" href="../../bower_components/paper-button/paper-button.html">
<link rel="import" href="../components/state-info.html"> <link rel="import" href="../components/state-info.html">
<dom-module id="state-card-scene"> <dom-module id="state-card-scene">
<style is="custom-style" include="iron-flex iron-flex-alignment"></style> <style is="custom-style" include="iron-flex iron-flex-alignment"></style>
<style> <style>
paper-icon-button { paper-button {
border: 1px solid;
border-radius: 50%;
color: var(--default-primary-color); color: var(--default-primary-color);
line-height: 24px; font-weight: 500;
top: 3px;
height: 37px;
} }
</style> </style>
<template> <template>
<div class='horizontal justified layout'> <div class='horizontal justified layout'>
<state-info state-obj="[[stateObj]]"></state-info> <state-info state-obj="[[stateObj]]" in-dialog='[[inDialog]]'></state-info>
<paper-icon-button on-tap='activateScene' icon='mdi:play'></paper-icon-button> <paper-button on-tap='activateScene'>ACTIVATE</paper-button>
</div> </div>
</template> </template>
</dom-module> </dom-module>

View File

@ -9,12 +9,18 @@ export default new Polymer({
is: 'state-card-scene', is: 'state-card-scene',
properties: { properties: {
detailed: {
type: Boolean,
value: false,
},
stateObj: { stateObj: {
type: Object, type: Object,
}, },
}, },
activateScene() { activateScene(ev) {
ev.stopPropagation();
serviceActions.callTurnOn(this.stateObj.entityId); serviceActions.callTurnOn(this.stateObj.entityId);
}, },
}); });

View File

@ -1,5 +1,5 @@
<link rel="import" href="../../bower_components/polymer/polymer.html"> <link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html"> <link rel="import" href="../../bower_components/paper-button/paper-button.html">
<link rel="import" href="../components/state-info.html"> <link rel="import" href="../components/state-info.html">
<link rel="import" href="../components/entity/ha-entity-toggle.html"> <link rel="import" href="../components/entity/ha-entity-toggle.html">
@ -7,22 +7,22 @@
<dom-module id="state-card-script"> <dom-module id="state-card-script">
<style is="custom-style" include="iron-flex iron-flex-alignment"></style> <style is="custom-style" include="iron-flex iron-flex-alignment"></style>
<style> <style>
paper-icon-button { paper-button {
border: 1px solid;
border-radius: 50%;
color: var(--default-primary-color); color: var(--default-primary-color);
line-height: 24px; font-weight: 500;
top: 3px;
height: 37px;
} }
</style> </style>
<template> <template>
<div class='horizontal justified layout'> <div class='horizontal justified layout'>
<state-info state-obj="[[stateObj]]"></state-info> <state-info state-obj="[[stateObj]]" in-dialog='[[inDialog]]'></state-info>
<template is='dom-if' if='[[stateObj.attributes.can_cancel]]'> <template is='dom-if' if='[[stateObj.attributes.can_cancel]]'>
<ha-entity-toggle state-obj='[[stateObj]]'></ha-entity-toggle> <ha-entity-toggle state-obj='[[stateObj]]'></ha-entity-toggle>
</template> </template>
<template is='dom-if' if='[[!stateObj.attributes.can_cancel]]'> <template is='dom-if' if='[[!stateObj.attributes.can_cancel]]'>
<paper-icon-button on-tap='fireScript' icon='mdi:play'></paper-icon-button> <paper-button on-tap='fireScript'>ACTIVATE</paper-button>
</template> </template>
</div> </div>
</template> </template>

View File

@ -10,12 +10,18 @@ export default new Polymer({
is: 'state-card-script', is: 'state-card-script',
properties: { properties: {
detailed: {
type: Boolean,
value: false,
},
stateObj: { stateObj: {
type: Object, type: Object,
}, },
}, },
fireScript() { fireScript(ev) {
ev.stopPropagation();
serviceActions.callTurnOn(this.stateObj.entityId); serviceActions.callTurnOn(this.stateObj.entityId);
}, },
}); });

View File

@ -6,33 +6,26 @@
<style is="custom-style" include="iron-flex iron-flex-alignment"></style> <style is="custom-style" include="iron-flex iron-flex-alignment"></style>
<style> <style>
:host { :host {
@apply(--paper-font-body1);
line-height: 1.5; line-height: 1.5;
} }
.state { .state {
margin-left: 16px; margin-left: 16px;
text-align: right; text-align: right;
overflow-x: hidden;
} }
.target { .target {
text-transform: capitalize; color: var(--primary-text-color);
font-weight: 400;
white-space: nowrap;
overflow-x: hidden;
text-overflow: ellipsis;
} }
.current { .current {
color: var(--secondary-text-color); color: var(--secondary-text-color);
white-space: nowrap;
overflow-x: hidden;
text-overflow: ellipsis;
} }
</style> </style>
<template> <template>
<div class='horizontal justified layout'> <div class='horizontal justified layout'>
<state-info state-obj="[[stateObj]]"></state-info> <state-info state-obj="[[stateObj]]" in-dialog='[[inDialog]]'></state-info>
<div class='state'> <div class='state'>
<div class='target'>[[computeTargetTemperature(stateObj)]]</div> <div class='target'>[[computeTargetTemperature(stateObj)]]</div>

View File

@ -6,6 +6,11 @@ export default new Polymer({
is: 'state-card-thermostat', is: 'state-card-thermostat',
properties: { properties: {
detailed: {
type: Boolean,
value: false,
},
stateObj: { stateObj: {
type: Object, type: Object,
}, },

View File

@ -11,8 +11,8 @@
} }
</style> </style>
<template> <template>
<div class='horizontal justified layout center'> <div class='horizontal justified layout'>
<state-info state-obj="[[stateObj]]"></state-info> <state-info state-obj="[[stateObj]]" in-dialog='[[inDialog]]'></state-info>
<ha-entity-toggle state-obj="[[stateObj]]"></ha-entity-toggle> <ha-entity-toggle state-obj="[[stateObj]]"></ha-entity-toggle>
</div> </div>

View File

@ -7,6 +7,11 @@ export default new Polymer({
is: 'state-card-toggle', is: 'state-card-toggle',
properties: { properties: {
detailed: {
type: Boolean,
value: false,
},
stateObj: { stateObj: {
type: Object, type: Object,
}, },

View File

@ -4,22 +4,22 @@
<dom-module id="state-card-weblink"> <dom-module id="state-card-weblink">
<style> <style>
state-badge { :host {
float: left; display: block;
} }
.name { .name {
margin-left: 56px; @apply(--paper-font-common-nowrap);
@apply(--paper-font-body1);
color: var(--primary-color);
text-transform: capitalize; text-transform: capitalize;
font-weight: 400;
text-overflow: ellipsis;
overflow-x: hidden;
line-height: 40px; line-height: 40px;
margin-left: 16px;
} }
</style> </style>
<template> <template>
<state-badge state-obj='[[stateObj]]'></state-badge> <state-badge state-obj='[[stateObj]]' in-dialog='[[inDialog]]'></state-badge>
<div class='name'>[[stateObj.entityDisplay]]</div> <a href='[[stateObj.entityDisplay]]' target='_blank' class='name' id='link'>[[stateObj.entityDisplay]]</a>
</template> </template>
</dom-module> </dom-module>

View File

@ -6,6 +6,11 @@ export default new Polymer({
is: 'state-card-weblink', is: 'state-card-weblink',
properties: { properties: {
detailed: {
type: Boolean,
value: false,
},
stateObj: { stateObj: {
type: Object, type: Object,
}, },
@ -17,6 +22,10 @@ export default new Polymer({
onTap(ev) { onTap(ev) {
ev.stopPropagation(); ev.stopPropagation();
if (ev.target === this.$.link) {
// Only open window if we clicked on card but not the link
return;
}
window.open(this.stateObj.state, '_blank'); window.open(this.stateObj.state, '_blank');
}, },
}); });

View File

@ -1,29 +0,0 @@
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="state-card-content.html">
<dom-module id="state-card">
<style>
:host {
border-radius: 2px;
box-shadow: rgba(0, 0, 0, 0.098) 0px 2px 4px, rgba(0, 0, 0, 0.098) 0px 0px 3px;
transition: all 0.30s ease-out;
position: relative;
background-color: white;
padding: 16px;
width: 100%;
cursor: pointer;
overflow: hidden;
-ms-user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
}
</style>
<template>
<state-card-content state-obj="[[stateObj]]"></state-card-content>
</template>
</dom-module>

View File

@ -1,26 +0,0 @@
import hass from '../util/home-assistant-js-instance';
import Polymer from '../polymer';
require('./state-card-content');
const { moreInfoActions } = hass;
export default new Polymer({
is: 'state-card',
properties: {
stateObj: {
type: Object,
},
},
listeners: {
tap: 'cardTapped',
},
cardTapped(ev) {
ev.stopPropagation();
this.async(() => moreInfoActions.selectEntity(this.stateObj.entityId), 1);
},
});