Skip to content

Instantly share code, notes, and snippets.

@calebj
Last active Sep 22, 2015
Embed
What would you like to do?
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<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-menu/core-submenu.html">
<link rel="import" href="../core-pages/core-pages.html">
<polymer-element name="main-screen" attributes="menuTitle mainTitle">
<template>
<style>
</style>
<link href="https://polymer-designer.appspot.com/components/element/main-screen.css" rel="stylesheet"></link>
<core-scaffold id="core_scaffold">
<core-header-panel navigation flex>
<core-toolbar>
<span>{{ menuTitle }}</span>
</core-toolbar>
<core-menu selected="1" selectedindex="1" on-core-select="{{ selectAction }}">
<core-item id="core_item" num="0" label="Android" icon="android" horizontal center layout></core-item>
<core-item id="core_item1" num="1" label="Bug Report" icon="bug-report" horizontal center layout active></core-item>
<core-item num="2" label="Account" icon="account-circle" horizontal center layout></core-item>
</core-menu>
</core-header-panel>
<span tool>
<paper-shadow></paper-shadow>
</span>
<div id="div" fit class="content">
<h1 id="h1">Polymer Rocks!</h1>
<core-pages selected="0" selectedindex="0" notap id="pages">
<div id="div1" active>You have selected "Android"</div>
<div>You have selected "Bug Report"</div>
<div>You have selected "Account"</div>
</core-pages>
</div>
</core-scaffold>
</template>
<script>
Polymer({
ready: function () {
this.pages = this.$.pages;
},
selectAction: function (e, detail) {
if (detail.isSelected) {
var selectedItem = detail.item;
this.pages.selected = selectedItem.attributes.num.nodeValue;
}
}
});
</script>
</polymer-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment