3
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7
Code distributed by Google as part of the polymer project is also
8
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
12
<title>paper-drawer-panel demo</title>
14
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
15
<meta name="mobile-web-app-capable" content="yes">
16
<meta name="apple-mobile-web-app-capable" content="yes">
18
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
20
<link rel="import" href="../../paper-styles/demo-pages.html">
21
<link rel="import" href="../../paper-button/paper-button.html">
22
<link rel="import" href="../paper-drawer-panel.html">
24
<style is="custom-style">
26
#paperDrawerPanel [main] {
28
background-color: var(--google-grey-100);
31
#paperDrawerPanel [drawer] {
32
border-right: 1px solid var(--google-grey-300);
35
#paperDrawerPanel[right-drawer] [drawer] {
36
border-left: 1px solid var(--google-grey-300);
42
background-color: var(--google-blue-700);
49
background-color: transparent;
60
<paper-drawer-panel id="paperDrawerPanel" force-narrow>
62
<button tabindex="0">Options</button>
63
<button tabindex="0">Settings</button>
64
<button tabindex="0" paper-drawer-toggle>Close drawer</button>
68
<paper-button onclick="flipDrawer()" raised>flip drawer</paper-button>
71
<paper-button paper-drawer-toggle raised>toggle drawer</paper-button>
81
var DRAWER_ATTR = 'right-drawer';
83
var pdp = document.getElementById('paperDrawerPanel');
85
global.flipDrawer = function() {
86
if (pdp.hasAttribute(DRAWER_ATTR)) {
87
pdp.removeAttribute(DRAWER_ATTR);
89
pdp.setAttribute(DRAWER_ATTR, '');