Skip to content

Instantly share code, notes, and snippets.

@MrTiggr
Created August 3, 2014 12:25
Show Gist options
  • Save MrTiggr/5bb3adc47108761e86cc to your computer and use it in GitHub Desktop.
Save MrTiggr/5bb3adc47108761e86cc to your computer and use it in GitHub Desktop.
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-pages/core-pages.html">
<polymer-element name="my-element" attributes="title_text selectedView">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
box-sizing: border-box;
}
#section {
width: 420px;
height: 630px;
border: 5px solid rgb(204, 204, 204);
left: 400px;
top: 100px;
position: absolute;
}
#paper_tabs {
color: rgb(255, 255, 255);
box-shadow: rgba(0, 0, 0, 0.2) 0px 3px 2px;
background-color: rgb(0, 188, 212);
}
#core_toolbar {
right: 0px;
color: rgb(255, 255, 255);
fill: rgb(255, 255, 255);
background-color: rgb(79, 125, 201);
}
#core_pages {
width: 100%;
height: 100%;
border: 1px solid silver;
top: 0px;
left: 0px;
}
#section2 {
width: 100%;
height: 100%;
position: absolute;
top: 0px;
left: 0px;
}
#section1 {
height: 75px;
}
</style>
<section id="feature_panel" layout vertical>
<core-toolbar id="core_toolbar">
<div id="title" flex>{{ title_text }}</div>
<core-icon-button active="{{selectedView==0}}" icon="list" id="btn_listview" on-click="{{ selectListview }}"></core-icon-button>
<core-icon-button active="{{selectedView==1}}" icon="drive-form" id="btn_formview" on-click="{{ selectFormview }}"></core-icon-button>
</core-toolbar>
<section id="views" flex end>
<core-pages selected="{{ selectedView }}" selectedindex="0" notap id="view_pages">
<section id="listview" active>List View</section>
<section id="formview">Form View</section>
</core-pages>
</section>
</section>
</template>
<script>
Polymer('my-element', {
selectedView: 0,
title_text: 'Properties',
publish: {
"title_text": {
"reflect": true
}
},
selectListview: function (){
this.selectedView=0;
},
selectFormview: function (){
this.selectedView=1;
}
});
</script>
</polymer-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment