This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpolymer-ui-toolbar.html
70 lines (68 loc) · 2.4 KB
/
polymer-ui-toolbar.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!--
Copyright 2013 The Polymer Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<!--
/**
* @module Polymer UI Elements
*/
/**
* polymer-ui-toolbar is a horizontal bar containing elements that can perform actions.
*
* Example:
*
* <polymer-ui-toolbar>
* <polymer-ui-icon-button src="menu.png" on-click="{{menuAction}}"></polymer-ui-icon-button>
* <div flex>Title</div>
* <polymer-ui-icon-button src="more.png" on-click="{{moreAction}}"></polymer-ui-icon-button>
* </polymer-ui-toolbar>
*
* polymer-ui-toolbar can adopt to smaller screen size. If the attribute "responsive" is set
* and the screen size is less than the responsiveWidth (default to 800px), the toolbar will
* be moved to the bottom of the page.
*
* Example:
*
* <polymer-ui-toolbar>
* <polymer-ui-icon-button icon="menu"></polymer-ui-icon-button>
* <div flex>Title</div>
* <polymer-ui-toolbar responsive>
* <polymer-ui-icon-button icon="add"></polymer-ui-icon-button>
* <polymer-ui-icon-button icon="trash"></polymer-ui-icon-button>
* <polymer-ui-icon-button icon="search"></polymer-ui-icon-button>
* </polymer-ui-toolbar>
* </polymer-ui-toolbar>
*
* @class polymer-ui-toolbar
*/
/**
* Max-width when element becomes responsive.
*
* @attribute responsiveWidth
* @type string
* @default '800px'
*/
-->
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../polymer-ui-theme-aware/polymer-ui-theme-aware.html">
<link rel="import" href="../polymer-media-query/polymer-media-query.html">
<link rel="import" href="../polymer-flex-layout/polymer-flex-layout.html">
<polymer-element name="polymer-ui-toolbar" extends="polymer-ui-theme-aware" attributes="responsiveWidth">
<template>
<link rel="stylesheet" href="polymer-ui-toolbar.css">
<polymer-flex-layout align="center"></polymer-flex-layout>
<polymer-media-query query="max-width: {{responsiveWidth}}" queryMatches="{{queryMatches}}"></polymer-media-query>
<content></content>
</template>
<script>
Polymer('polymer-ui-toolbar', {
responsiveWidth: '800px',
queryMatches: false,
defaultTheme: 'polymer-ui-light-theme',
queryMatchesChanged: function() {
this.classList.toggle('narrow-layout', this.queryMatches);
}
});
</script>
</polymer-element>