Last active
August 29, 2015 14:05
-
-
Save dsanders11/b2f0c7c2e334df47ff9c to your computer and use it in GitHub Desktop.
designer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../core-animated-pages/core-animated-pages.html"> | |
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html"> | |
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html"> | |
<link rel="import" href="../core-animated-pages/transitions/slide-down.html"> | |
<link rel="import" href="../core-animated-pages/transitions/slide-up.html"> | |
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; | |
box-sizing: border-box; | |
} | |
#core_pages { | |
width: 100%; | |
height: 100%; | |
border: 1px solid silver; | |
left: 0px; | |
top: 0px; | |
position: absolute; | |
} | |
#section { | |
left: 260px; | |
top: 280px; | |
position: absolute; | |
} | |
#core_toolbar { | |
right: 0px; | |
color: rgb(255, 255, 255); | |
fill: rgb(255, 255, 255); | |
background-color: rgb(82, 199, 135); | |
} | |
#page2 { | |
top: 0px; | |
left: 0px; | |
width: 100%; | |
height: 100%; | |
position: absolute; | |
} | |
#page1 { | |
opacity: 1; | |
} | |
</style> | |
<core-animated-pages id="core_pages" transitions="hero-transition" selected="0" notap> | |
<section id="page1" active> | |
<core-toolbar id="core_toolbar" active> | |
<core-icon-button id="core_icon_button" icon="menu"></core-icon-button> | |
<div id="div" flex>Toolbar 1</div> | |
<core-icon-button id="core_icon_button1" on-click="{{ addClick }}" icon="add" theme="core-light-theme"></core-icon-button> | |
</core-toolbar> | |
</section> | |
<section id="page2" active> | |
<core-toolbar id="core_toolbar" active> | |
<core-icon-button id="core_icon_button" on-click="{{ backClick }}" icon="arrow-back"></core-icon-button> | |
<div id="div" flex>Toolbar 2</div> | |
</core-toolbar> | |
</section> | |
</core-animated-pages> | |
</template> | |
<script> | |
Polymer('my-element', { | |
addClick: function (event, detail, sender) { | |
var pages = this.$.core_pages; | |
var child = this.$.page1; | |
var i = 0; | |
while( (child = child.previousSibling) != null ) | |
i++; | |
pages.selected = i; | |
}, | |
backClick: function (event, detail, sender) { | |
var pages = this.$.core_pages; | |
pages.selected = (pages.selected - 1) % pages.children.length; | |
} | |
}); | |
</script> | |
</polymer-element> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment