reverted media player card

This commit is contained in:
Dennis Karpienski 2016-04-11 18:38:54 +02:00
parent 40b19006f1
commit 4398fcdec3
2 changed files with 1 additions and 55 deletions

View File

@ -55,13 +55,6 @@
top: 91px;
}
.source-container {
position: absolute;
left: 8px;
right: 8px;
top: 170px;
}
.controls {
@apply(--paper-font-body1);
padding: 8px;
@ -145,28 +138,6 @@
class='self-center'
></paper-icon-button>
</div>
<div
class='controls layout horizontal justified'
invisible$='[[!playerObj.supportsSelectInputSource]]'
>
<paper-icon-button
icon="mdi:login-variant">
</paper-icon-button>
<paper-dropdown-menu no-label-float selected-item-label='{{selectedSource}}' on-tap='stopPropagation'>
<paper-menu class="dropdown-content" selected="[[computeSelectedSource(stateObj)]]">
<template is='dom-repeat' items='[[stateObj.attributes.source_list]]'>
<paper-item>[[item]]</paper-item>
</template>
</paper-menu>
</paper-dropdown-menu>
</div>
</paper-material>
</div>
<div class='source-container'
>
<paper-material elevation="1">
</paper-material>
</div>
</template>

View File

@ -27,11 +27,6 @@ export default new Polymer({
computed: 'computePlaybackControlIcon(playerObj)',
},
selectedSource: {
type: String,
observer: 'selectedSourceChanged',
},
/**
* The z-depth of the card, from 0-5.
*/
@ -43,11 +38,7 @@ export default new Polymer({
},
playerObjChanged(playerObj) {
this.style.height = '78px';
if (this.computeShowControls(playerObj)) {
this.style.height = playerObj.supportsSelectInputSource ? '232px' : '175px';
}
this.style.height = this.computeShowControls(playerObj) ? '175px' : '78px';
this.style.backgroundImage = playerObj.stateObj.attributes.entity_picture ?
`url(${playerObj.stateObj.attributes.entity_picture})` : '';
},
@ -85,18 +76,6 @@ export default new Polymer({
return playerObj.isMuted ? 'mdi:volume-off' : 'mdi:volume-high';
},
computeSelectedSource(stateObj) {
return stateObj.attributes.source_list.indexOf(stateObj.attributes.source);
},
selectedSourceChanged(option) {
// Selected Option will transition to '' before transitioning to new value
if (option === '' || option === this.stateObj.attributes.source) {
return;
}
this.playerObj.input(option);
},
handleNext(ev) {
ev.stopPropagation();
this.playerObj.nextTrack();
@ -132,8 +111,4 @@ export default new Polymer({
this.playerObj.volumeMute(!this.playerObj.isMuted);
},
stopPropagation(ev) {
ev.stopPropagation();
},
});