Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Unified Diff: third_party/polymer/components/core-scaffold/core-scaffold.html

Issue 582873003: Polymer elements added to third_party/polymer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/components/core-scaffold/core-scaffold.html
diff --git a/third_party/polymer/components/core-scaffold/core-scaffold.html b/third_party/polymer/components/core-scaffold/core-scaffold.html
new file mode 100644
index 0000000000000000000000000000000000000000..5edd64b48b19492d9fe82f4e88fe77f32061b558
--- /dev/null
+++ b/third_party/polymer/components/core-scaffold/core-scaffold.html
@@ -0,0 +1,157 @@
+<!--
+Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+Code distributed by Google as part of the polymer project is also
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+-->
+
+<!--
+`core-scaffold` provides general application layout, introducing a
+responsive scaffold containing a header, toolbar, menu, title and
+areas for application content.
+
+Example:
+
+ <core-scaffold>
+ <core-header-panel navigation flex mode="seamed">
+ <core-toolbar>Application</core-toolbar>
+ <core-menu theme="core-light-theme">
+ <core-item icon="settings" label="item1"></core-item>
+ <core-item icon="settings" label="item2"></core-item>
+ </core-menu>
+ </core-header-panel>
+ <div tool>Title</div>
+ <div>Content goes here...</div>
+ </core-scaffold>
+
+Use `mode` to control the header and scrolling behavior of `core-header-panel`
+and `responsiveWidth` to change the layout of the scaffold.
+
+To have the content fits to the main area, use `fit` attribute.
+
+ <core-scaffold>
+ <core-header-panel navigation flex mode="seamed">
+ ....
+ </core-header-panel>
+ <div tool>Title</div>
+ <div fit>Content fits to the main area</div>
+ </core-scaffold>
+
+@group Polymer Core Elements
+@element core-scaffold
+@homepage github.io
+-->
+
+<link rel="import" href="../core-toolbar/core-toolbar.html">
+<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
+<link rel="import" href="../core-header-panel/core-header-panel.html">
+<link rel="import" href="../core-icon-button/core-icon-button.html">
+
+<polymer-element name="core-scaffold">
+<template>
+
+ <style>
+
+ :host {
+ display: block;
+ }
+
+ [drawer] {
+ background-color: #fff;
+ box-shadow: 1px 0 1px rgba(0, 0, 0, 0.1);
+ }
+
+ [main] {
+ height: 100%;
+ background-color: #eee;
+ }
+
+ core-toolbar {
+ background-color: #526E9C;
+ color: #fff;
+ }
+
+ #drawerPanel:not([narrow]) #menuButton {
+ display: none;
+ }
+
+ </style>
+
+ <core-drawer-panel id="drawerPanel" narrow="{{narrow}}" responsiveWidth="{{responsiveWidth}}">
+
+ <div vertical layout drawer>
+
+ <content select="[navigation], nav"></content>
+
+ </div>
+
+ <core-header-panel main mode="{{mode}}">
+
+ <core-toolbar>
+ <core-icon-button id="menuButton" icon="menu" on-tap="{{togglePanel}}"></core-icon-button>
+ <content select="[tool]"></content>
+ </core-toolbar>
+
+ <content select="*"></content>
+
+ </core-header-panel>
+
+ </core-drawer-panel>
+
+</template>
+<script>
+
+ Polymer('core-scaffold', {
+
+ publish: {
+ /**
+ * When the browser window size is smaller than the `responsiveWidth`,
+ * `core-drawer-panel` changes to a narrow layout. In narrow layout,
+ * the drawer will be stacked on top of the main panel.
+ *
+ * @attribute responsiveWidth
+ * @type string
+ * @default '600px'
+ */
+ responsiveWidth: '600px',
+
+ /**
+ * Used to control the header and scrolling behaviour of `core-header-panel`
+ *
+ * @attribute mode
+ * @type string
+ * @default 'seamed'
+ */
+ mode: {value: 'seamed', reflect: true}
+ },
+
+ /**
+ * Toggle the drawer panel
+ * @method togglePanel
+ */
+ togglePanel: function() {
+ this.$.drawerPanel.togglePanel();
+ },
+
+ /**
+ * Open the drawer panel
+ * @method openDrawer
+ */
+ openDrawer: function() {
+ this.$.drawerPanel.openDrawer();
+ },
+
+ /**
+ * Close the drawer panel
+ * @method closeDrawer
+ */
+ closeDrawer: function() {
+ this.$.drawerPanel.closeDrawer();
+ }
+
+ });
+
+</script>
+</polymer-element>
« no previous file with comments | « third_party/polymer/components/core-scaffold/bower.json ('k') | third_party/polymer/components/core-scaffold/demo.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698