mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +00:00
Moved dialog logic to base class.
This commit is contained in:
parent
5e9303dbf2
commit
edb01b6bb4
@ -1,22 +1,16 @@
|
|||||||
<link rel="import" href="../bower_components/polymer/polymer.html">
|
<link rel="import" href="../bower_components/polymer/polymer.html">
|
||||||
<link rel="import" href="../bower_components/core-style/core-style.html">
|
|
||||||
<link rel="import" href="../bower_components/paper-dialog/paper-action-dialog.html">
|
|
||||||
<link rel="import" href="../bower_components/paper-button/paper-button.html">
|
<link rel="import" href="../bower_components/paper-button/paper-button.html">
|
||||||
<link rel="import" href="../bower_components/paper-input/paper-input.html">
|
<link rel="import" href="../bower_components/paper-input/paper-input.html">
|
||||||
<link rel="import" href="../bower_components/paper-input/paper-input-decorator.html">
|
<link rel="import" href="../bower_components/paper-input/paper-input-decorator.html">
|
||||||
<link rel="import" href="../bower_components/paper-input/paper-autogrow-textarea.html">
|
<link rel="import" href="../bower_components/paper-input/paper-autogrow-textarea.html">
|
||||||
|
|
||||||
|
<link rel="import" href="ha-action-dialog.html">
|
||||||
<link rel="import" href="../components/events-list.html">
|
<link rel="import" href="../components/events-list.html">
|
||||||
|
|
||||||
<polymer-element name="event-fire-dialog" attributes="api">
|
<polymer-element name="event-fire-dialog" attributes="api">
|
||||||
<template>
|
<template>
|
||||||
|
|
||||||
<paper-action-dialog
|
<ha-action-dialog id="dialog" heading="Fire Event" class='two-column'>
|
||||||
id="dialog" heading="Fire Event"
|
|
||||||
transition="core-transition-bottom"
|
|
||||||
backdrop="true" layered="false">
|
|
||||||
|
|
||||||
<core-style ref='ha-dialog'></core-style>
|
|
||||||
|
|
||||||
<div layout horizontal>
|
<div layout horizontal>
|
||||||
<div class='ha-form'>
|
<div class='ha-form'>
|
||||||
@ -43,7 +37,7 @@
|
|||||||
|
|
||||||
<paper-button dismissive>Cancel</paper-button>
|
<paper-button dismissive>Cancel</paper-button>
|
||||||
<paper-button affirmative on-click={{clickFireEvent}}>Fire Event</paper-button>
|
<paper-button affirmative on-click={{clickFireEvent}}>Fire Event</paper-button>
|
||||||
</paper-dialog>
|
</ha-action-dialog>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
@ -0,0 +1,24 @@
|
|||||||
|
<link rel="import" href="../bower_components/polymer/polymer.html">
|
||||||
|
<link rel="import" href="../bower_components/core-style/core-style.html">
|
||||||
|
<link rel="import" href="../bower_components/paper-dialog/paper-action-dialog.html">
|
||||||
|
<link rel="import" href="../bower_components/paper-dialog/paper-dialog-transition.html">
|
||||||
|
|
||||||
|
<polymer-element name="ha-action-dialog" extends="paper-action-dialog">
|
||||||
|
<template>
|
||||||
|
<core-style ref='ha-dialog'></core-style>
|
||||||
|
<shadow></shadow>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
Polymer({
|
||||||
|
layered: true,
|
||||||
|
backdrop: true,
|
||||||
|
transition: 'core-transition-bottom',
|
||||||
|
|
||||||
|
domReady: function() {
|
||||||
|
this.addEventListener('core-overlay-open-completed', function() {
|
||||||
|
this.resizeHandler();
|
||||||
|
}.bind(this));
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</polymer-element>
|
@ -1,21 +1,16 @@
|
|||||||
<link rel="import" href="../bower_components/polymer/polymer.html">
|
<link rel="import" href="../bower_components/polymer/polymer.html">
|
||||||
<link rel="import" href="../bower_components/core-style/core-style.html">
|
|
||||||
<link rel="import" href="../bower_components/paper-dialog/paper-action-dialog.html">
|
|
||||||
<link rel="import" href="../bower_components/paper-dialog/paper-dialog-transition.html">
|
|
||||||
<link rel="import" href="../bower_components/paper-button/paper-button.html">
|
<link rel="import" href="../bower_components/paper-button/paper-button.html">
|
||||||
<link rel="import" href="../bower_components/paper-input/paper-input.html">
|
<link rel="import" href="../bower_components/paper-input/paper-input.html">
|
||||||
<link rel="import" href="../bower_components/paper-input/paper-input-decorator.html">
|
<link rel="import" href="../bower_components/paper-input/paper-input-decorator.html">
|
||||||
<link rel="import" href="../bower_components/paper-input/paper-autogrow-textarea.html">
|
<link rel="import" href="../bower_components/paper-input/paper-autogrow-textarea.html">
|
||||||
|
|
||||||
|
<link rel="import" href="ha-action-dialog.html">
|
||||||
<link rel="import" href="../components/services-list.html">
|
<link rel="import" href="../components/services-list.html">
|
||||||
|
|
||||||
<polymer-element name="service-call-dialog" attributes="api">
|
<polymer-element name="service-call-dialog" attributes="api">
|
||||||
<template>
|
<template>
|
||||||
|
|
||||||
<paper-action-dialog
|
<ha-action-dialog id="dialog" heading="Call Service">
|
||||||
id="dialog" heading="Call Service"
|
|
||||||
transition="core-transition-bottom"
|
|
||||||
backdrop="true" layered="false">
|
|
||||||
|
|
||||||
<core-style ref='ha-dialog'></core-style>
|
<core-style ref='ha-dialog'></core-style>
|
||||||
|
|
||||||
@ -43,7 +38,7 @@
|
|||||||
|
|
||||||
<paper-button dismissive>Cancel</paper-button>
|
<paper-button dismissive>Cancel</paper-button>
|
||||||
<paper-button affirmative on-click={{clickCallService}}>Call Service</paper-button>
|
<paper-button affirmative on-click={{clickCallService}}>Call Service</paper-button>
|
||||||
</paper-action-dialog>
|
</ha-action-dialog>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
@ -1,17 +1,12 @@
|
|||||||
<link rel="import" href="../bower_components/polymer/polymer.html">
|
<link rel="import" href="../bower_components/polymer/polymer.html">
|
||||||
<link rel="import" href="../bower_components/core-style/core-style.html">
|
|
||||||
|
|
||||||
|
<link rel="import" href="ha-action-dialog.html">
|
||||||
<link rel="import" href="../cards/state-card-content.html">
|
<link rel="import" href="../cards/state-card-content.html">
|
||||||
<link rel="import" href="../more-infos/more-info-content.html">
|
<link rel="import" href="../more-infos/more-info-content.html">
|
||||||
|
|
||||||
<polymer-element name="state-card-dialog" attributes="api">
|
<polymer-element name="state-card-dialog" attributes="api">
|
||||||
<template>
|
<template>
|
||||||
<paper-action-dialog
|
<ha-action-dialog id="dialog">
|
||||||
id="dialog"
|
|
||||||
transition="core-transition-bottom"
|
|
||||||
backdrop="true" layered="false">
|
|
||||||
|
|
||||||
<core-style ref='ha-dialog'></core-style>
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.title-card {
|
.title-card {
|
||||||
@ -27,13 +22,19 @@
|
|||||||
|
|
||||||
<paper-button dismissive>Dismiss</paper-button>
|
<paper-button dismissive>Dismiss</paper-button>
|
||||||
<paper-button affirmative on-click={{editClicked}}>Edit State</paper-button>
|
<paper-button affirmative on-click={{editClicked}}>Edit State</paper-button>
|
||||||
</paper-action-dialog>
|
</ha-action-dialog>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
Polymer({
|
Polymer({
|
||||||
stateObj: {},
|
stateObj: {},
|
||||||
|
|
||||||
|
// domReady: function() {
|
||||||
|
// this.$.dialog.addEventListener('core-overlay-open-completed', function() {
|
||||||
|
// this.$.dialog.resizeHandler();
|
||||||
|
// }.bind(this));
|
||||||
|
// },
|
||||||
|
|
||||||
show: function(stateObj) {
|
show: function(stateObj) {
|
||||||
this.stateObj = stateObj;
|
this.stateObj = stateObj;
|
||||||
this.$.dialog.toggle();
|
this.$.dialog.toggle();
|
||||||
|
@ -1,19 +1,15 @@
|
|||||||
<link rel="import" href="../bower_components/polymer/polymer.html">
|
<link rel="import" href="../bower_components/polymer/polymer.html">
|
||||||
<link rel="import" href="../bower_components/core-style/core-style.html">
|
|
||||||
<link rel="import" href="../bower_components/paper-dialog/paper-action-dialog.html">
|
|
||||||
<link rel="import" href="../bower_components/paper-button/paper-button.html">
|
<link rel="import" href="../bower_components/paper-button/paper-button.html">
|
||||||
<link rel="import" href="../bower_components/paper-input/paper-input.html">
|
<link rel="import" href="../bower_components/paper-input/paper-input.html">
|
||||||
<link rel="import" href="../bower_components/paper-input/paper-input-decorator.html">
|
<link rel="import" href="../bower_components/paper-input/paper-input-decorator.html">
|
||||||
<link rel="import" href="../bower_components/paper-input/paper-autogrow-textarea.html">
|
<link rel="import" href="../bower_components/paper-input/paper-autogrow-textarea.html">
|
||||||
|
|
||||||
|
<link rel="import" href="ha-action-dialog.html">
|
||||||
<link rel="import" href="../components/entity-list.html">
|
<link rel="import" href="../components/entity-list.html">
|
||||||
|
|
||||||
<polymer-element name="state-set-dialog" attributes="api">
|
<polymer-element name="state-set-dialog" attributes="api">
|
||||||
<template>
|
<template>
|
||||||
<paper-action-dialog
|
<ha-action-dialog id="dialog" heading="Set State">
|
||||||
id="dialog" heading="Set State"
|
|
||||||
transition="core-transition-bottom"
|
|
||||||
backdrop="true" layered="false">
|
|
||||||
|
|
||||||
<core-style ref='ha-dialog'></core-style>
|
<core-style ref='ha-dialog'></core-style>
|
||||||
|
|
||||||
@ -41,7 +37,7 @@
|
|||||||
|
|
||||||
<paper-button dismissive>Cancel</paper-button>
|
<paper-button dismissive>Cancel</paper-button>
|
||||||
<paper-button affirmative on-click={{clickSetState}}>Set State</paper-button>
|
<paper-button affirmative on-click={{clickSetState}}>Set State</paper-button>
|
||||||
</paper-action-dialog>
|
</ha-action-dialog>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
@ -4,34 +4,43 @@
|
|||||||
<polymer-element name="home-assistant-style" noscript>
|
<polymer-element name="home-assistant-style" noscript>
|
||||||
<template>
|
<template>
|
||||||
<core-style id="ha-dialog">
|
<core-style id="ha-dialog">
|
||||||
paper-action-dialog, paper-dialog {
|
:host {
|
||||||
font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial;
|
font-family: RobotoDraft, 'Helvetica Neue', Helvetica, Arial;
|
||||||
|
|
||||||
min-width: 350px;
|
min-width: 350px;
|
||||||
}
|
}
|
||||||
|
|
||||||
paper-action-dialog .sidebar, paper-dialog .sidebar {
|
:host .sidebar {
|
||||||
margin-left: 30px;
|
margin-left: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (max-width: 620px) {
|
@media all and (max-width: 620px) {
|
||||||
paper-action-dialog, paper-dialog {
|
:host.two-column {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: calc(100% - 64px);
|
height: calc(100% - 64px);
|
||||||
top: 64px;
|
top: 64px;
|
||||||
}
|
}
|
||||||
|
|
||||||
paper-action-dialog .sidebar, paper-dialog .sidebar {
|
:host .sidebar {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.ha-form paper-input {
|
@media all and (max-width: 464px) {
|
||||||
|
:host {
|
||||||
|
margin: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: calc(100% - 64px);
|
||||||
|
top: 64px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
html /deep/ .ha-form paper-input {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ha-form paper-input:first-child {
|
html /deep/ .ha-form paper-input:first-child {
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
}
|
}
|
||||||
</core-style>
|
</core-style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user