mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
update buttons
This commit is contained in:
parent
939e545723
commit
c4dadd58bd
@ -85,12 +85,11 @@
|
||||
<br />
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check">
|
||||
${ButtonSave}
|
||||
</button>
|
||||
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete">
|
||||
${ButtonCancel}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -169,12 +169,11 @@
|
||||
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
|
||||
${ButtonSave}
|
||||
</button>
|
||||
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete" data-mini="true">
|
||||
${ButtonCancel}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
48
dashboard-ui/bower_components/paper-tabs/.bower.json
vendored
Normal file
48
dashboard-ui/bower_components/paper-tabs/.bower.json
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "paper-tabs",
|
||||
"version": "1.0.0",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Material design tabs",
|
||||
"private": true,
|
||||
"main": "paper-tabs.html",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"tabs",
|
||||
"control"
|
||||
],
|
||||
"repository": "https://github.com/PolymerElements/paper-tabs.git",
|
||||
"dependencies": {
|
||||
"iron-behaviors": "polymerelements/iron-behaviors#^1.0.0",
|
||||
"iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
|
||||
"iron-icon": "polymerelements/iron-icon#^1.0.0",
|
||||
"iron-iconset-svg": "polymerelements/iron-iconset-svg#^1.0.0",
|
||||
"iron-menu-behavior": "polymerelements/iron-menu-behavior#^1.0.0",
|
||||
"iron-resizable-behavior": "polymerelements/iron-resizable-behavior#^1.0.0",
|
||||
"paper-ripple": "polymerelements/paper-ripple#^1.0.0",
|
||||
"paper-styles": "polymerelements/paper-styles#^1.0.0",
|
||||
"polymer": "Polymer/polymer#^1.0.0",
|
||||
"paper-icon-button": "polymerelements/paper-icon-button#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"paper-toolbar": "polymerelements/paper-toolbar#^1.0.0",
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||
"web-component-tester": "*"
|
||||
},
|
||||
"homepage": "https://github.com/PolymerElements/paper-tabs",
|
||||
"_release": "1.0.0",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.0",
|
||||
"commit": "af6820e55f73fc5aa8c8e4d5294085e46374c7ca"
|
||||
},
|
||||
"_source": "git://github.com/PolymerElements/paper-tabs.git",
|
||||
"_target": "~1.0.0",
|
||||
"_originalSource": "PolymerElements/paper-tabs",
|
||||
"_direct": true
|
||||
}
|
1
dashboard-ui/bower_components/paper-tabs/.gitignore
vendored
Normal file
1
dashboard-ui/bower_components/paper-tabs/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
bower_components/
|
37
dashboard-ui/bower_components/paper-tabs/bower.json
vendored
Normal file
37
dashboard-ui/bower_components/paper-tabs/bower.json
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "paper-tabs",
|
||||
"version": "1.0.0",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "Material design tabs",
|
||||
"private": true,
|
||||
"main": "paper-tabs.html",
|
||||
"authors": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"tabs",
|
||||
"control"
|
||||
],
|
||||
"repository": "https://github.com/PolymerElements/paper-tabs.git",
|
||||
"dependencies": {
|
||||
"iron-behaviors": "polymerelements/iron-behaviors#^1.0.0",
|
||||
"iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
|
||||
"iron-icon": "polymerelements/iron-icon#^1.0.0",
|
||||
"iron-iconset-svg": "polymerelements/iron-iconset-svg#^1.0.0",
|
||||
"iron-menu-behavior": "polymerelements/iron-menu-behavior#^1.0.0",
|
||||
"iron-resizable-behavior": "polymerelements/iron-resizable-behavior#^1.0.0",
|
||||
"paper-ripple": "polymerelements/paper-ripple#^1.0.0",
|
||||
"paper-styles": "polymerelements/paper-styles#^1.0.0",
|
||||
"polymer": "Polymer/polymer#^1.0.0",
|
||||
"paper-icon-button": "polymerelements/paper-icon-button#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
|
||||
"paper-toolbar": "polymerelements/paper-toolbar#^1.0.0",
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
|
||||
"web-component-tester": "*"
|
||||
}
|
||||
}
|
177
dashboard-ui/bower_components/paper-tabs/demo/index.html
vendored
Normal file
177
dashboard-ui/bower_components/paper-tabs/demo/index.html
vendored
Normal file
@ -0,0 +1,177 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 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
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
|
||||
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
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<title>paper-tabs</title>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
|
||||
<link rel="import" href="../../iron-flex-layout/classes/iron-flex-layout.html">
|
||||
|
||||
<link rel="import" href="../../paper-toolbar/paper-toolbar.html">
|
||||
|
||||
<link rel="import" href="../paper-tabs.html">
|
||||
<link rel="import" href="../paper-tab.html">
|
||||
<style is="custom-style">
|
||||
:root {
|
||||
--paper-toolbar-background: #00bcd4;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
margin: 0;
|
||||
padding: 24px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
paper-tabs, paper-toolbar {
|
||||
background-color: #00bcd4;
|
||||
color: #fff;
|
||||
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
paper-toolbar paper-tabs {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
paper-tabs[noink][no-bar] paper-tab.iron-selected {
|
||||
color: #ffff8d;
|
||||
}
|
||||
|
||||
paper-tabs[alignBottom] {
|
||||
box-shadow: 0px -2px 6px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h3>A. No ink effect and no sliding bar</h3>
|
||||
|
||||
<paper-tabs selected="0" noink no-bar>
|
||||
|
||||
<paper-tab>ITEM ONE</paper-tab>
|
||||
<paper-tab>ITEM TWO</paper-tab>
|
||||
<paper-tab>ITEM THREE</paper-tab>
|
||||
|
||||
</paper-tabs>
|
||||
|
||||
<h3>B. The bottom bar appears to indicate the selected tab, but without sliding effect.</h3>
|
||||
|
||||
<paper-tabs selected="0" noink no-slide>
|
||||
|
||||
<paper-tab>ITEM ONE</paper-tab>
|
||||
<paper-tab>ITEM TWO</paper-tab>
|
||||
<paper-tab>ITEM THREE</paper-tab>
|
||||
|
||||
</paper-tabs>
|
||||
|
||||
<h3>C. The bar slides to the selected tab</h3>
|
||||
|
||||
<paper-tabs selected="0" noink>
|
||||
|
||||
<paper-tab>ITEM ONE</paper-tab>
|
||||
<paper-tab>ITEM TWO</paper-tab>
|
||||
<paper-tab>ITEM THREE</paper-tab>
|
||||
|
||||
</paper-tabs>
|
||||
|
||||
<h3>D. Inky Tabs</h3>
|
||||
|
||||
<paper-tabs selected="0">
|
||||
|
||||
<paper-tab>ITEM ONE</paper-tab>
|
||||
<paper-tab>ITEM TWO</paper-tab>
|
||||
<paper-tab>ITEM THREE</paper-tab>
|
||||
|
||||
</paper-tabs>
|
||||
|
||||
<h3>E. Scrollable Tabs</h3>
|
||||
|
||||
<paper-tabs id="scrollableTabs" selected="0" scrollable>
|
||||
|
||||
<paper-tab>NUMBER ONE ITEM</paper-tab>
|
||||
<paper-tab>ITEM TWO</paper-tab>
|
||||
<paper-tab>THE THIRD ITEM</paper-tab>
|
||||
<paper-tab>THE ITEM FOUR</paper-tab>
|
||||
<paper-tab>FIFTH</paper-tab>
|
||||
<paper-tab>THE SIXTH TAB</paper-tab>
|
||||
<paper-tab>NUMBER SEVEN</paper-tab>
|
||||
<paper-tab>EIGHT</paper-tab>
|
||||
<paper-tab>NUMBER NINE</paper-tab>
|
||||
<paper-tab>THE TENTH</paper-tab>
|
||||
<paper-tab>THE ITEM ELEVEN</paper-tab>
|
||||
<paper-tab>TWELFTH ITEM</paper-tab>
|
||||
|
||||
</paper-tabs>
|
||||
|
||||
<h3>F. Link Tabs</h3>
|
||||
|
||||
<paper-tabs selected="0">
|
||||
|
||||
<paper-tab link><a href="#item1" class="horizontal center-center layout">ITEM ONE</a></paper-tab>
|
||||
<paper-tab link><a href="#item2" class="horizontal center-center layout">ITEM TWO</a></paper-tab>
|
||||
<paper-tab link><a href="#item3" class="horizontal center-center layout">ITEM THREE</a></paper-tab>
|
||||
|
||||
</paper-tabs>
|
||||
|
||||
<h3>G. Tabs in Toolbar</h3>
|
||||
|
||||
<paper-toolbar class="tall">
|
||||
|
||||
<paper-tabs selected="0" class="bottom self-end" style="width: 300px;">
|
||||
|
||||
<paper-tab>ITEM ONE</paper-tab>
|
||||
<paper-tab>ITEM TWO</paper-tab>
|
||||
|
||||
</paper-tabs>
|
||||
|
||||
<div class="bottom flex"></div>
|
||||
|
||||
</paper-toolbar>
|
||||
|
||||
<h3>H. Tabs aligned to bottom</h3>
|
||||
|
||||
<paper-tabs selected="0" alignBottom>
|
||||
|
||||
<paper-tab>ITEM ONE</paper-tab>
|
||||
<paper-tab>ITEM TWO</paper-tab>
|
||||
<paper-tab>ITEM THREE</paper-tab>
|
||||
|
||||
</paper-tabs>
|
||||
|
||||
<h3>I. Bound Selection</h3>
|
||||
|
||||
<template is="dom-bind">
|
||||
<h2>Current Tab: <span>[[selected]]</span></h2>
|
||||
<paper-tabs selected="{{selected}}">
|
||||
|
||||
<paper-tab>ITEM ONE</paper-tab>
|
||||
<paper-tab>ITEM TWO</paper-tab>
|
||||
<paper-tab>ITEM THREE</paper-tab>
|
||||
|
||||
</paper-tabs>
|
||||
</template>
|
||||
|
||||
</body>
|
||||
</html>
|
23
dashboard-ui/bower_components/paper-tabs/hero.svg
vendored
Normal file
23
dashboard-ui/bower_components/paper-tabs/hero.svg
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 225 126" enable-background="new 0 0 225 126" xml:space="preserve">
|
||||
<g id="background" display="none">
|
||||
<rect display="inline" fill="#B0BEC5" width="225" height="126"/>
|
||||
</g>
|
||||
<g id="label">
|
||||
</g>
|
||||
<g id="art">
|
||||
<path d="M188,78H37V44h151V78z M39,76h147V46H39V76z"/>
|
||||
<polygon points="66,64.8 60.6,56.8 55.3,64.8 49.2,55.6 50.8,54.4 55.3,61.2 60.6,53.2 66,61.2 71.3,53.2 77.4,62.4 75.8,63.6
|
||||
71.3,56.8 "/>
|
||||
<rect x="149" y="58" width="26" height="2"/>
|
||||
<rect x="99" y="58" width="26" height="2"/>
|
||||
<rect x="38" y="72" width="50" height="4"/>
|
||||
<g id="ic_x5F_add_x0D_">
|
||||
</g>
|
||||
</g>
|
||||
<g id="Guides">
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 966 B |
25
dashboard-ui/bower_components/paper-tabs/index.html
vendored
Normal file
25
dashboard-ui/bower_components/paper-tabs/index.html
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 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
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
|
||||
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
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<title>paper-tabs</title>
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<link rel="import" href="../iron-component-page/iron-component-page.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<iron-component-page sources='["paper-tabs.html", "paper-tab.html"]'></iron-component-page>
|
||||
|
||||
</body>
|
||||
</html>
|
158
dashboard-ui/bower_components/paper-tabs/paper-tab.html
vendored
Normal file
158
dashboard-ui/bower_components/paper-tabs/paper-tab.html
vendored
Normal file
@ -0,0 +1,158 @@
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 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
|
||||
-->
|
||||
|
||||
<link rel="import" href="../polymer/polymer.html">
|
||||
<link rel="import" href="../iron-flex-layout/classes/iron-flex-layout.html">
|
||||
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
|
||||
<link rel="import" href="../iron-behaviors/iron-control-state.html">
|
||||
<link rel="import" href="../paper-ripple/paper-ripple.html">
|
||||
|
||||
<!--
|
||||
`paper-tab` is styled to look like a tab. It should be used in conjunction with
|
||||
`paper-tabs`.
|
||||
|
||||
Example:
|
||||
|
||||
<paper-tabs selected="0">
|
||||
<paper-tab>TAB 1</paper-tab>
|
||||
<paper-tab>TAB 2</paper-tab>
|
||||
<paper-tab>TAB 3</paper-tab>
|
||||
</paper-tabs>
|
||||
|
||||
### Styling
|
||||
|
||||
The following custom properties and mixins are available for styling:
|
||||
|
||||
Custom property | Description | Default
|
||||
----------------|-------------|----------
|
||||
`--paper-tab-ink` | Ink color | `--paper-yellow-a100`
|
||||
`--paper-tab` | Mixin applied to the tab | `{}`
|
||||
`--paper-tab-content` | Mixin applied to the tab content | `{}`
|
||||
|
||||
-->
|
||||
|
||||
<dom-module id="paper-tab">
|
||||
|
||||
<style>
|
||||
|
||||
:host {
|
||||
@apply(--layout-inline);
|
||||
@apply(--layout-center);
|
||||
@apply(--layout-center-justified);
|
||||
@apply(--layout-flex);
|
||||
|
||||
position: relative;
|
||||
padding: 0 12px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
|
||||
@apply(--paper-tab);
|
||||
}
|
||||
|
||||
:host(:focus) {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
:host([link]) {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.tab-content {
|
||||
height: 100%;
|
||||
-webkit-transform: translateZ(0);
|
||||
transform: translateZ(0);
|
||||
transition: opacity 0.1s cubic-bezier(0.4, 0.0, 1, 1);
|
||||
|
||||
@apply(--paper-tab-content);
|
||||
}
|
||||
|
||||
:host(:not(.iron-selected)) > .tab-content {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
:host(:focus) .tab-content {
|
||||
opacity: 1;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
#ink {
|
||||
color: var(--paper-tab-ink, --paper-yellow-a100);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.tab-content > ::content > a {
|
||||
height: 100%;
|
||||
/* flex */
|
||||
-ms-flex: 1 1 0.000000001px;
|
||||
-webkit-flex: 1;
|
||||
flex: 1;
|
||||
-webkit-flex-basis: 0.000000001px;
|
||||
flex-basis: 0.000000001px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
|
||||
<div class="tab-content flex-auto center-center horizontal layout">
|
||||
<content></content>
|
||||
</div>
|
||||
|
||||
<template is="dom-if" if="[[!noink]]">
|
||||
<paper-ripple id="ink" initial-opacity="0.95" opacity-decay-velocity="0.98"></paper-ripple>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
|
||||
</dom-module>
|
||||
|
||||
<script>
|
||||
|
||||
Polymer({
|
||||
|
||||
is: 'paper-tab',
|
||||
|
||||
behaviors: [
|
||||
Polymer.IronControlState
|
||||
],
|
||||
|
||||
properties: {
|
||||
|
||||
/**
|
||||
* If true, ink ripple effect is disabled.
|
||||
*
|
||||
* @attribute noink
|
||||
*/
|
||||
noink: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
hostAttributes: {
|
||||
role: 'tab'
|
||||
},
|
||||
|
||||
listeners: {
|
||||
down: '_onDown'
|
||||
},
|
||||
|
||||
get _parentNoink () {
|
||||
var parent = Polymer.dom(this).parentNode;
|
||||
return !!parent && !!parent.noink;
|
||||
},
|
||||
|
||||
_onDown: function(e) {
|
||||
this.noink = !!this.noink || !!this._parentNoink;
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
18
dashboard-ui/bower_components/paper-tabs/paper-tabs-icons.html
vendored
Normal file
18
dashboard-ui/bower_components/paper-tabs/paper-tabs-icons.html
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 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
|
||||
-->
|
||||
|
||||
<link rel="import" href="../iron-iconset-svg/iron-iconset-svg.html">
|
||||
|
||||
<iron-iconset-svg name="paper-tabs" size="24">
|
||||
<svg><defs>
|
||||
<g id="chevron-left"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></g>
|
||||
<g id="chevron-right"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></g>
|
||||
</defs></svg>
|
||||
</iron-iconset-svg>
|
483
dashboard-ui/bower_components/paper-tabs/paper-tabs.html
vendored
Normal file
483
dashboard-ui/bower_components/paper-tabs/paper-tabs.html
vendored
Normal file
@ -0,0 +1,483 @@
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 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
|
||||
-->
|
||||
|
||||
<link rel="import" href="../polymer/polymer.html">
|
||||
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
|
||||
<link rel="import" href="../iron-flex-layout/classes/iron-flex-layout.html">
|
||||
<link rel="import" href="../iron-resizable-behavior/iron-resizable-behavior.html">
|
||||
<link rel="import" href="../iron-menu-behavior/iron-menubar-behavior.html">
|
||||
<link rel="import" href="../iron-icon/iron-icon.html">
|
||||
<link rel="import" href="../paper-icon-button/paper-icon-button.html">
|
||||
<link rel="import" href="../paper-styles/color.html">
|
||||
<link rel="import" href="paper-tabs-icons.html">
|
||||
<link rel="import" href="paper-tab.html">
|
||||
|
||||
<!--
|
||||
`paper-tabs` makes it easy to explore and switch between different views or functional aspects of
|
||||
an app, or to browse categorized data sets.
|
||||
|
||||
Use `selected` property to get or set the selected tab.
|
||||
|
||||
Example:
|
||||
|
||||
<paper-tabs selected="0">
|
||||
<paper-tab>TAB 1</paper-tab>
|
||||
<paper-tab>TAB 2</paper-tab>
|
||||
<paper-tab>TAB 3</paper-tab>
|
||||
</paper-tabs>
|
||||
|
||||
See <a href="#paper-tab">paper-tab</a> for more information about
|
||||
`paper-tab`.
|
||||
|
||||
A common usage for `paper-tabs` is to use it along with `iron-pages` to switch
|
||||
between different views.
|
||||
|
||||
<paper-tabs selected="{{selected}}">
|
||||
<paper-tab>Tab 1</paper-tab>
|
||||
<paper-tab>Tab 2</paper-tab>
|
||||
<paper-tab>Tab 3</paper-tab>
|
||||
</paper-tabs>
|
||||
|
||||
<iron-pages selected="{{selected}}">
|
||||
<div>Page 1</div>
|
||||
<div>Page 2</div>
|
||||
<div>Page 3</div>
|
||||
</iron-pages>
|
||||
|
||||
|
||||
To use links in tabs, add `link` attribute to `paper-tab` and put an `<a>`
|
||||
element in `paper-tab`.
|
||||
|
||||
Example:
|
||||
|
||||
<paper-tabs selected="0">
|
||||
<paper-tab link>
|
||||
<a href="#link1" class="horizontal center-center layout">TAB ONE</a>
|
||||
</paper-tab>
|
||||
<paper-tab link>
|
||||
<a href="#link2" class="horizontal center-center layout">TAB TWO</a>
|
||||
</paper-tab>
|
||||
<paper-tab link>
|
||||
<a href="#link3" class="horizontal center-center layout">TAB THREE</a>
|
||||
</paper-tab>
|
||||
</paper-tabs>
|
||||
|
||||
### Styling
|
||||
|
||||
The following custom properties and mixins are available for styling:
|
||||
|
||||
Custom property | Description | Default
|
||||
----------------|-------------|----------
|
||||
`--paper-tabs-selection-bar-color` | Color for the selection bar | `--paper-yellow-a100`
|
||||
`--paper-tabs` | Mixin applied to the tabs | `{}`
|
||||
|
||||
@hero hero.svg
|
||||
@demo demo/index.html
|
||||
-->
|
||||
|
||||
<dom-module id="paper-tabs">
|
||||
|
||||
<style>
|
||||
|
||||
:host {
|
||||
@apply(--layout);
|
||||
@apply(--layout-center);
|
||||
|
||||
height: 48px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
overflow: hidden;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
|
||||
@apply(--paper-tabs);
|
||||
}
|
||||
|
||||
#tabsContainer {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#tabsContent {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#tabsContent.scrollable {
|
||||
position: absolute;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.not-visible {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
paper-icon-button {
|
||||
width: 24px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
#selectionBar {
|
||||
position: absolute;
|
||||
height: 2px;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: var(--paper-tabs-selection-bar-color, --paper-yellow-a100);
|
||||
-webkit-transform-origin: left center;
|
||||
transform-origin: left center;
|
||||
-webkit-transform: scale(0);
|
||||
transform: scale(0);
|
||||
transition: -webkit-transform;
|
||||
transition: transform;
|
||||
|
||||
@apply(--paper-tabs-selection-bar);
|
||||
}
|
||||
|
||||
#selectionBar.align-bottom {
|
||||
top: 0;
|
||||
bottom: auto;
|
||||
}
|
||||
|
||||
#selectionBar.expand {
|
||||
transition-duration: 0.15s;
|
||||
transition-timing-function: cubic-bezier(0.4, 0.0, 1, 1);
|
||||
}
|
||||
|
||||
#selectionBar.contract {
|
||||
transition-duration: 0.18s;
|
||||
transition-timing-function: cubic-bezier(0.0, 0.0, 0.2, 1);
|
||||
}
|
||||
|
||||
#tabsContent > ::content > *:not(#selectionBar) {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
|
||||
<paper-icon-button icon="paper-tabs:chevron-left" class$="[[_computeScrollButtonClass(_leftHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-down="_onLeftScrollButtonDown"></paper-icon-button>
|
||||
|
||||
<div id="tabsContainer" class="flex" on-scroll="_scroll">
|
||||
|
||||
<div id="tabsContent" class$="[[_computeTabsContentClass(scrollable)]]">
|
||||
|
||||
<content select="*"></content>
|
||||
|
||||
<div id="selectionBar" class$="[[_computeSelectionBarClass(noBar, alignBottom)]]"
|
||||
on-transitionend="_onBarTransitionEnd"></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<paper-icon-button icon="paper-tabs:chevron-right" class$="[[_computeScrollButtonClass(_rightHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-down="_onRightScrollButtonDown"></paper-icon-button>
|
||||
|
||||
</template>
|
||||
|
||||
</dom-module>
|
||||
|
||||
<script>
|
||||
|
||||
Polymer({
|
||||
|
||||
is: 'paper-tabs',
|
||||
|
||||
behaviors: [
|
||||
Polymer.IronResizableBehavior,
|
||||
Polymer.IronMenubarBehavior
|
||||
],
|
||||
|
||||
properties: {
|
||||
|
||||
/**
|
||||
* If true, ink ripple effect is disabled.
|
||||
*/
|
||||
noink: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
/**
|
||||
* If true, the bottom bar to indicate the selected tab will not be shown.
|
||||
*/
|
||||
noBar: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
/**
|
||||
* If true, the slide effect for the bottom bar is disabled.
|
||||
*/
|
||||
noSlide: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
/**
|
||||
* If true, tabs are scrollable and the tab width is based on the label width.
|
||||
*/
|
||||
scrollable: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
/**
|
||||
* If true, dragging on the tabs to scroll is disabled.
|
||||
*/
|
||||
disableDrag: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
/**
|
||||
* If true, scroll buttons (left/right arrow) will be hidden for scrollable tabs.
|
||||
*/
|
||||
hideScrollButtons: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
/**
|
||||
* If true, the tabs are aligned to bottom (the selection bar appears at the top).
|
||||
*/
|
||||
alignBottom: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets or sets the selected element. The default is to use the index of the item.
|
||||
*/
|
||||
selected: {
|
||||
type: String,
|
||||
notify: true
|
||||
},
|
||||
|
||||
selectable: {
|
||||
type: String,
|
||||
value: 'paper-tab'
|
||||
},
|
||||
|
||||
_step: {
|
||||
type: Number,
|
||||
value: 10
|
||||
},
|
||||
|
||||
_holdDelay: {
|
||||
type: Number,
|
||||
value: 1
|
||||
},
|
||||
|
||||
_leftHidden: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
_rightHidden: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
_previousTab: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
|
||||
hostAttributes: {
|
||||
role: 'tablist'
|
||||
},
|
||||
|
||||
listeners: {
|
||||
'iron-resize': '_onResize',
|
||||
'iron-select': '_onIronSelect',
|
||||
'iron-deselect': '_onIronDeselect'
|
||||
},
|
||||
|
||||
_computeScrollButtonClass: function(hideThisButton, scrollable, hideScrollButtons) {
|
||||
if (!scrollable || hideScrollButtons) {
|
||||
return 'hidden';
|
||||
}
|
||||
|
||||
if (hideThisButton) {
|
||||
return 'not-visible';
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
|
||||
_computeTabsContentClass: function(scrollable) {
|
||||
return scrollable ? 'scrollable' : 'horizontal layout';
|
||||
},
|
||||
|
||||
_computeSelectionBarClass: function(noBar, alignBottom) {
|
||||
if (noBar) {
|
||||
return 'hidden';
|
||||
} else if (alignBottom) {
|
||||
return 'align-bottom';
|
||||
}
|
||||
},
|
||||
|
||||
// TODO(cdata): Add `track` response back in when gesture lands.
|
||||
|
||||
_onResize: function() {
|
||||
this.debounce('_onResize', function() {
|
||||
this._scroll();
|
||||
this._tabChanged(this.selectedItem);
|
||||
}, 10);
|
||||
},
|
||||
|
||||
_onIronSelect: function(event) {
|
||||
this._tabChanged(event.detail.item, this._previousTab);
|
||||
this._previousTab = event.detail.item;
|
||||
this.cancelDebouncer('tab-changed');
|
||||
},
|
||||
|
||||
_onIronDeselect: function(event) {
|
||||
this.debounce('tab-changed', function() {
|
||||
this._tabChanged(null, this._previousTab);
|
||||
// See polymer/polymer#1305
|
||||
}, 1);
|
||||
},
|
||||
|
||||
get _tabContainerScrollSize () {
|
||||
return Math.max(
|
||||
0,
|
||||
this.$.tabsContainer.scrollWidth -
|
||||
this.$.tabsContainer.offsetWidth
|
||||
);
|
||||
},
|
||||
|
||||
_scroll: function() {
|
||||
var scrollLeft;
|
||||
|
||||
if (!this.scrollable) {
|
||||
return;
|
||||
}
|
||||
|
||||
scrollLeft = this.$.tabsContainer.scrollLeft;
|
||||
|
||||
this._leftHidden = scrollLeft === 0;
|
||||
this._rightHidden = scrollLeft === this._tabContainerScrollSize;
|
||||
},
|
||||
|
||||
_onLeftScrollButtonDown: function() {
|
||||
this._holdJob = setInterval(this._scrollToLeft.bind(this), this._holdDelay);
|
||||
},
|
||||
|
||||
_onRightScrollButtonDown: function() {
|
||||
this._holdJob = setInterval(this._scrollToRight.bind(this), this._holdDelay);
|
||||
},
|
||||
|
||||
_onScrollButtonUp: function() {
|
||||
clearInterval(this._holdJob);
|
||||
this._holdJob = null;
|
||||
},
|
||||
|
||||
_scrollToLeft: function() {
|
||||
this.$.tabsContainer.scrollLeft -= this._step;
|
||||
},
|
||||
|
||||
_scrollToRight: function() {
|
||||
this.$.tabsContainer.scrollLeft += this._step;
|
||||
},
|
||||
|
||||
_tabChanged: function(tab, old) {
|
||||
if (!tab) {
|
||||
this._positionBar(0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
var r = this.$.tabsContent.getBoundingClientRect();
|
||||
var w = r.width;
|
||||
var tabRect = tab.getBoundingClientRect();
|
||||
var tabOffsetLeft = tabRect.left - r.left;
|
||||
|
||||
this._pos = {
|
||||
width: this._calcPercent(tabRect.width, w),
|
||||
left: this._calcPercent(tabOffsetLeft, w)
|
||||
};
|
||||
|
||||
if (this.noSlide || old == null) {
|
||||
// position bar directly without animation
|
||||
this._positionBar(this._pos.width, this._pos.left);
|
||||
return;
|
||||
}
|
||||
|
||||
var oldRect = old.getBoundingClientRect();
|
||||
var oldIndex = this.items.indexOf(old);
|
||||
var index = this.items.indexOf(tab);
|
||||
var m = 5;
|
||||
|
||||
// bar animation: expand
|
||||
this.$.selectionBar.classList.add('expand');
|
||||
|
||||
if (oldIndex < index) {
|
||||
this._positionBar(this._calcPercent(tabRect.left + tabRect.width - oldRect.left, w) - m,
|
||||
this._left);
|
||||
} else {
|
||||
this._positionBar(this._calcPercent(oldRect.left + oldRect.width - tabRect.left, w) - m,
|
||||
this._calcPercent(tabOffsetLeft, w) + m);
|
||||
}
|
||||
|
||||
if (this.scrollable) {
|
||||
this._scrollToSelectedIfNeeded(tabRect.width, tabOffsetLeft);
|
||||
}
|
||||
},
|
||||
|
||||
_scrollToSelectedIfNeeded: function(tabWidth, tabOffsetLeft) {
|
||||
var l = tabOffsetLeft - this.$.tabsContainer.scrollLeft;
|
||||
if (l < 0) {
|
||||
this.$.tabsContainer.scrollLeft += l;
|
||||
} else {
|
||||
l += (tabWidth - this.$.tabsContainer.offsetWidth);
|
||||
if (l > 0) {
|
||||
this.$.tabsContainer.scrollLeft += l;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_calcPercent: function(w, w0) {
|
||||
return 100 * w / w0;
|
||||
},
|
||||
|
||||
_positionBar: function(width, left) {
|
||||
this._width = width;
|
||||
this._left = left;
|
||||
this.transform(
|
||||
'translate3d(' + left + '%, 0, 0) scaleX(' + (width / 100) + ')',
|
||||
this.$.selectionBar);
|
||||
},
|
||||
|
||||
_onBarTransitionEnd: function(e) {
|
||||
var cl = this.$.selectionBar.classList;
|
||||
// bar animation: expand -> contract
|
||||
if (cl.contains('expand')) {
|
||||
cl.remove('expand');
|
||||
cl.add('contract');
|
||||
this._positionBar(this._pos.width, this._pos.left);
|
||||
// bar animation done
|
||||
} else if (cl.contains('contract')) {
|
||||
cl.remove('contract');
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
82
dashboard-ui/bower_components/paper-tabs/test/attr-for-selected.html
vendored
Normal file
82
dashboard-ui/bower_components/paper-tabs/test/attr-for-selected.html
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 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
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<title>paper-tabs-attr-for-selected</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
|
||||
<link rel="import" href="../paper-tabs.html">
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="basic">
|
||||
<template>
|
||||
<paper-tabs attr-for-selected="name" selected="bar">
|
||||
<paper-tab name="foo">ITEM FOO</paper-tab>
|
||||
<paper-tab name="bar">ITEM BAR</paper-tab>
|
||||
<paper-tab name="zot">ITEM ZOT</paper-tab>
|
||||
</paper-tabs>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
|
||||
suite('set the selected attribute', function() {
|
||||
|
||||
var tabs;
|
||||
|
||||
setup(function () {
|
||||
tabs = fixture('basic');
|
||||
});
|
||||
|
||||
test('selected value', function() {
|
||||
assert.equal(tabs.selected, 'bar');
|
||||
});
|
||||
|
||||
test('selected tab has iron-selected class', function() {
|
||||
assert.isTrue(tabs.querySelector('[name=bar]').classList.contains('iron-selected'));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
suite('select tab via click', function() {
|
||||
|
||||
var tabs, tab;
|
||||
|
||||
setup(function () {
|
||||
tabs = fixture('basic');
|
||||
tab = tabs.querySelector('[name=zot]');
|
||||
tab.dispatchEvent(new CustomEvent('click', {bubbles: true}));
|
||||
});
|
||||
|
||||
test('selected value', function() {
|
||||
assert.equal(tabs.selected, 'zot');
|
||||
});
|
||||
|
||||
test('selected tab has iron-selected class', function() {
|
||||
assert.isTrue(tab.classList.contains('iron-selected'));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
157
dashboard-ui/bower_components/paper-tabs/test/basic.html
vendored
Normal file
157
dashboard-ui/bower_components/paper-tabs/test/basic.html
vendored
Normal file
@ -0,0 +1,157 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 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
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<title>paper-tabs-basic</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
|
||||
<link rel="import" href="../paper-tabs.html">
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="basic">
|
||||
<template>
|
||||
<paper-tabs>
|
||||
<paper-tab>ITEM ONE</paper-tab>
|
||||
<paper-tab>ITEM TWO</paper-tab>
|
||||
<paper-tab>ITEM THREE</paper-tab>
|
||||
</paper-tabs>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
|
||||
function checkSelectionBar(tabs, tab) {
|
||||
var tabRect = tab.getBoundingClientRect();
|
||||
var rect = Polymer.dom(tabs.root).querySelector('#selectionBar').getBoundingClientRect();
|
||||
assert.equal(Math.round(tabRect.left), Math.round(rect.left));
|
||||
}
|
||||
|
||||
suite('defaults', function() {
|
||||
|
||||
var tabs;
|
||||
|
||||
setup(function () {
|
||||
tabs = fixture('basic');
|
||||
});
|
||||
|
||||
test('to nothing selected', function() {
|
||||
assert.equal(tabs.selected, undefined);
|
||||
});
|
||||
|
||||
test('no tabs have iron-selected class', function() {
|
||||
Array.prototype.forEach.call(tabs.querySelectorAll('paper-tab'), function(tab) {
|
||||
assert.isFalse(tab.classList.contains('iron-selected'));
|
||||
});
|
||||
});
|
||||
|
||||
test('to false as noink', function() {
|
||||
assert.equal(tabs.noink, false);
|
||||
});
|
||||
|
||||
test('to false as noBar', function() {
|
||||
assert.equal(tabs.noBar, false);
|
||||
});
|
||||
|
||||
test('to false as noSlide', function() {
|
||||
assert.equal(tabs.noSlide, false);
|
||||
});
|
||||
|
||||
test('to false as scrollable', function() {
|
||||
assert.equal(tabs.scrollable, false);
|
||||
});
|
||||
|
||||
test('to false as disableDrag', function() {
|
||||
assert.equal(tabs.disableDrag, false);
|
||||
});
|
||||
|
||||
test('to false as hideScrollButtons', function() {
|
||||
assert.equal(tabs.hideScrollButtons, false);
|
||||
});
|
||||
|
||||
test('to false as alignBottom', function() {
|
||||
assert.equal(tabs.alignBottom, false);
|
||||
});
|
||||
|
||||
test('has role tablist', function() {
|
||||
assert.equal(tabs.getAttribute('role'), 'tablist');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
suite('set the selected attribute', function() {
|
||||
|
||||
var tabs, index = 0;
|
||||
|
||||
setup(function () {
|
||||
tabs = fixture('basic');
|
||||
tabs.selected = index;
|
||||
});
|
||||
|
||||
test('selected value', function() {
|
||||
assert.equal(tabs.selected, index);
|
||||
});
|
||||
|
||||
test('selected tab has iron-selected class', function() {
|
||||
var tab = tabs.querySelectorAll('paper-tab')[index];
|
||||
assert.isTrue(tab.classList.contains('iron-selected'));
|
||||
});
|
||||
|
||||
test('selected tab has selection bar position at the bottom of the tab', function(done) {
|
||||
setTimeout(function() {
|
||||
checkSelectionBar(tabs, tabs.querySelectorAll('paper-tab')[index]);
|
||||
done();
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
suite('select tab via click', function() {
|
||||
|
||||
var tabs, index = 1;
|
||||
|
||||
setup(function () {
|
||||
tabs = fixture('basic');
|
||||
var tab = tabs.querySelectorAll('paper-tab')[index];
|
||||
tab.dispatchEvent(new CustomEvent('click', {bubbles: true}));
|
||||
});
|
||||
|
||||
test('selected value', function() {
|
||||
assert.equal(tabs.selected, index);
|
||||
});
|
||||
|
||||
test('selected tab has iron-selected class', function() {
|
||||
var tab = tabs.querySelectorAll('paper-tab')[index];
|
||||
assert.isTrue(tab.classList.contains('iron-selected'));
|
||||
});
|
||||
|
||||
test('selected tab has selection bar position at the bottom of the tab', function(done) {
|
||||
setTimeout(function() {
|
||||
checkSelectionBar(tabs, tabs.querySelectorAll('paper-tab')[index]);
|
||||
done();
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
32
dashboard-ui/bower_components/paper-tabs/test/index.html
vendored
Normal file
32
dashboard-ui/bower_components/paper-tabs/test/index.html
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 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
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<title>Tests</title>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script>
|
||||
|
||||
WCT.loadSuites([
|
||||
'basic.html',
|
||||
'attr-for-selected.html'
|
||||
]);
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -61,12 +61,11 @@
|
||||
</div>
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check">
|
||||
${ButtonSave}
|
||||
</button>
|
||||
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete">
|
||||
${ButtonCancel}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
|
@ -74,12 +74,12 @@
|
||||
<p>${CinemaModeConfigurationHelp2}</p>
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check">
|
||||
${ButtonSave}
|
||||
</button>
|
||||
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete">
|
||||
${ButtonCancel}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -1434,11 +1434,15 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.listViewMoreButton {
|
||||
button.listviewMenuButton {
|
||||
padding-left: 20px !important;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
paper-icon-button.listviewMenuButton {
|
||||
margin-left: 20px !important;
|
||||
}
|
||||
|
||||
.ui-li-has-icon > .ui-btn {
|
||||
padding-left: 5.25em !important;
|
||||
padding-top: 5px !important;
|
||||
|
@ -4,7 +4,7 @@
|
||||
<title>${TitleServer}</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="dashboardPage" data-role="page" class="page type-interior dashboardHomePage" data-require="scripts/dashboardpage">
|
||||
<div id="dashboardPage" data-role="page" class="page type-interior dashboardHomePage" data-require="scripts/dashboardpage,paperbuttonstyle">
|
||||
|
||||
<div data-role="content">
|
||||
<div class="content-primary">
|
||||
@ -49,8 +49,8 @@
|
||||
<p class="externalUrl"></p>
|
||||
|
||||
<div style="margin-top: 1em;">
|
||||
<button class="btnRestartContainer hide" id="btnRestartServer" type="button" data-icon="refresh" data-mini="true" data-inline="true" onclick="DashboardPage.restart();">${ButtonRestart}</button>
|
||||
<button id="btnShutdown" type="button" data-icon="delete" data-mini="true" data-inline="true" onclick="DashboardPage.shutdown();">${ButtonShutdown}</button>
|
||||
<paper-button raised class="subdued btnRestartContainer hide"><iron-icon icon="refresh" onclick="DashboardPage.restart();"></iron-icon><span>${ButtonRestart}</span></paper-button>
|
||||
<paper-button id="btnShutdown" raised class="subdued"><iron-icon icon="close" onclick="DashboardPage.shutdown();"></iron-icon><span>${ButtonShutdown}</span></paper-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -131,7 +131,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -75,12 +75,11 @@
|
||||
<br />
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
|
||||
${ButtonSave}
|
||||
</button>
|
||||
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete" data-mini="true">
|
||||
${ButtonCancel}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -65,12 +65,11 @@
|
||||
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
|
||||
${ButtonSave}
|
||||
</button>
|
||||
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete" data-mini="true">
|
||||
${ButtonCancel}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -40,12 +40,11 @@
|
||||
</ul><br />
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check">
|
||||
${ButtonSave}
|
||||
</button>
|
||||
<button type="button" onclick="Dashboard.navigate('devices.html');" data-icon="delete">
|
||||
${ButtonCancel}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -47,12 +47,11 @@
|
||||
</ul><br />
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check">
|
||||
${ButtonSave}
|
||||
</button>
|
||||
<button type="button" onclick="Dashboard.navigate('devices.html');" data-icon="delete">
|
||||
${ButtonCancel}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -46,12 +46,11 @@
|
||||
</ul>
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check">
|
||||
${ButtonSave}
|
||||
</button>
|
||||
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete">
|
||||
${ButtonCancel}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
|
@ -36,12 +36,11 @@
|
||||
</ul>
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check">
|
||||
${ButtonSave}
|
||||
</button>
|
||||
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete">
|
||||
${ButtonCancel}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
|
@ -73,12 +73,11 @@
|
||||
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
|
||||
${ButtonSave}
|
||||
</button>
|
||||
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete" data-mini="true">
|
||||
${ButtonCancel}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
|
@ -78,12 +78,11 @@
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check">
|
||||
${ButtonSave}
|
||||
</button>
|
||||
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete">
|
||||
${ButtonCancel}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -51,12 +51,11 @@
|
||||
<br />
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check">
|
||||
${ButtonSave}
|
||||
</button>
|
||||
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete">
|
||||
${ButtonCancel}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<title>Emby</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="displayPreferencesPage" data-role="page" class="page libraryPage userPreferencesPage" data-contextname="${HeaderPreferences}" data-require="scripts/mypreferencesdisplay,scripts/mypreferencescommon,paperbuttonstyle,jqmicons">
|
||||
<div id="displayPreferencesPage" data-role="page" class="page libraryPage userPreferencesPage" data-contextname="${HeaderSettings}" data-require="scripts/mypreferencesdisplay,scripts/mypreferencescommon,paperbuttonstyle,jqmicons">
|
||||
|
||||
<div class="libraryViewNav">
|
||||
<a href="#" class="ui-btn-active lnkDisplayPreferences">${TabDisplay}</a>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<title>Emby</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="languagePreferencesPage" data-role="page" class="page libraryPage userPreferencesPage" data-contextname="${HeaderPreferences}" data-require="scripts/mypreferenceslanguages,scripts/mypreferencescommon,paperbuttonstyle,jqmicons">
|
||||
<div id="languagePreferencesPage" data-role="page" class="page libraryPage userPreferencesPage" data-contextname="${HeaderSettings}" data-require="scripts/mypreferenceslanguages,scripts/mypreferencescommon,paperbuttonstyle,jqmicons">
|
||||
|
||||
<div class="libraryViewNav">
|
||||
<a href="#" class="lnkDisplayPreferences">${TabDisplay}</a>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<title>Emby</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="webClientPreferencesPage" data-role="page" class="page libraryPage userPreferencesPage" data-contextname="${HeaderPreferences}" data-require="scripts/mypreferenceswebclient,scripts/mypreferencescommon,paperbuttonstyle,jqmicons">
|
||||
<div id="webClientPreferencesPage" data-role="page" class="page libraryPage userPreferencesPage" data-contextname="${HeaderSettings}" data-require="scripts/mypreferenceswebclient,scripts/mypreferencescommon,paperbuttonstyle,jqmicons">
|
||||
|
||||
<div class="libraryViewNav">
|
||||
<a href="#" class="lnkDisplayPreferences">${TabDisplay}</a>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<title>Emby</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="userImagePage" data-role="page" class="page libraryPage userPreferencesPage userPasswordPage" data-contextname="${HeaderPreferences}" data-require="scripts/myprofile,scripts/mypreferencescommon,paperbuttonstyle,jqmicons">
|
||||
<div id="userImagePage" data-role="page" class="page libraryPage userPreferencesPage userPasswordPage" data-contextname="${HeaderSettings}" data-require="scripts/myprofile,scripts/mypreferencescommon,paperbuttonstyle,jqmicons">
|
||||
|
||||
<div class="libraryViewNav">
|
||||
<a href="#" class="lnkDisplayPreferences">${TabDisplay}</a>
|
||||
|
@ -72,12 +72,11 @@
|
||||
</li>
|
||||
<li>
|
||||
<br />
|
||||
<button type="submit" data-theme="b" data-icon="check">
|
||||
${ButtonSave}
|
||||
</button>
|
||||
<button type="button" onclick="Dashboard.navigate('notificationsettings.html');" data-icon="delete">
|
||||
${ButtonCancel}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -49,12 +49,11 @@
|
||||
<br />
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check">
|
||||
${ButtonSave}
|
||||
</button>
|
||||
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete">
|
||||
${ButtonCancel}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
@ -13,7 +13,7 @@
|
||||
case 2:
|
||||
return 'latestmedia';
|
||||
case 3:
|
||||
return '';
|
||||
return 'latesttvrecordings';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
|
@ -939,9 +939,10 @@
|
||||
html += '<span class="listViewAsideText">';
|
||||
html += textlines[verticalTextLines] || LibraryBrowser.getRatingHtml(item, false);
|
||||
html += '</span>';
|
||||
html += '<button type="button" data-role="none" class="listviewMenuButton imageButton listViewMoreButton" data-icon="none">';
|
||||
html += '<i class="material-icons">more_vert</i>';
|
||||
html += '</button>';
|
||||
//html += '<button type="button" data-role="none" class="listviewMenuButton imageButton listViewMoreButton" data-icon="none">';
|
||||
//html += '<i class="material-icons">more_vert</i>';
|
||||
//html += '</button>';
|
||||
html += '<paper-icon-button icon="more-vert" class="listviewMenuButton"></paper-icon-button>';
|
||||
html += '<span class="listViewUserDataButtons">';
|
||||
html += LibraryBrowser.getUserDataIconsHtml(item);
|
||||
html += '</span>';
|
||||
@ -1643,7 +1644,8 @@
|
||||
|
||||
if (options.cardLayout) {
|
||||
html += '<div class="cardButtonContainer">';
|
||||
html += '<button class="listviewMenuButton imageButton btnCardOptions" type="button" data-role="none" style="margin: 4px 0 0;"><i class="material-icons">more_vert</i></button>';
|
||||
//html += '<button class="listviewMenuButton imageButton btnCardOptions" type="button" data-role="none" style="margin: 4px 0 0;"><i class="material-icons">more_vert</i></button>';
|
||||
html += '<paper-icon-button icon="more-vert" class="listviewMenuButton btnCardOptions"></paper-icon-button>';
|
||||
html += "</div>";
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@
|
||||
|
||||
var limit = AppInfo.hasLowImageBandwidth ?
|
||||
16 :
|
||||
24;
|
||||
20;
|
||||
|
||||
var options = {
|
||||
|
||||
|
@ -28,12 +28,11 @@
|
||||
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check" data-mini="true">
|
||||
${ButtonSave}
|
||||
</button>
|
||||
<button type="button" onclick="Dashboard.navigate('dashboard.html');" data-icon="delete" data-mini="true">
|
||||
${ButtonCancel}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
</div>
|
||||
<p>
|
||||
<button type="submit" id="mbLegacyKeyBtn" data-theme="b" data-icon="check">Save</button>
|
||||
<button type="submit" id="mbLegacyKeyBtn" data-theme="b" data-icon="check">${ButtonSave}</button>
|
||||
</p>
|
||||
</form>
|
||||
<br />
|
||||
|
@ -50,9 +50,11 @@
|
||||
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check">
|
||||
${ButtonSave}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
|
@ -13,3 +13,7 @@
|
||||
.defaultBackground .cardImage {
|
||||
background-color: #383838;
|
||||
}
|
||||
|
||||
.ui-page-theme-b .visualCardBox {
|
||||
background: rgba(56,56,56,.85);
|
||||
}
|
||||
|
@ -122,9 +122,11 @@
|
||||
<br />
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check">
|
||||
${ButtonSave}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
|
@ -63,9 +63,11 @@
|
||||
<br />
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check">
|
||||
${ButtonSave}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
|
@ -51,12 +51,11 @@
|
||||
<br />
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check">
|
||||
${ButtonSave}
|
||||
</button>
|
||||
<button type="button" onclick="history.back();" data-icon="delete">
|
||||
${ButtonCancel}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
|
@ -58,9 +58,11 @@
|
||||
</div>
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="b" data-icon="check">
|
||||
${ButtonSave}
|
||||
<button type="submit" data-role="none" class="clearButton">
|
||||
<paper-button raised class="submit block"><iron-icon icon="check"></iron-icon><span>${ButtonSave}</span></paper-button>
|
||||
</button>
|
||||
|
||||
<paper-button raised class="cancel block btnCancel" onclick="history.back();"><iron-icon icon="close"></iron-icon><span>${ButtonCancel}</span></paper-button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -9,4 +9,5 @@
|
||||
<link rel="import" href="bower_components/neon-animation/animations/fade-in-animation.html">
|
||||
<link rel="import" href="bower_components/paper-icon-button/paper-icon-button.html">
|
||||
<link rel="import" href="bower_components/paper-drawer-panel/paper-drawer-panel.html">
|
||||
<link rel="import" href="bower_components/paper-tabs/paper-tabs.html">
|
||||
<link rel="import" href="thirdparty/emby-icons.html">
|
@ -10492,6 +10492,258 @@ The `aria-labelledby` attribute will be set to the header element, if one exists
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
/**
|
||||
* `Polymer.IronMenuBehavior` implements accessible menu behavior.
|
||||
*
|
||||
* @demo demo/index.html
|
||||
* @polymerBehavior Polymer.IronMenuBehavior
|
||||
*/
|
||||
Polymer.IronMenuBehaviorImpl = {
|
||||
|
||||
properties: {
|
||||
|
||||
/**
|
||||
* Returns the currently focused item.
|
||||
*
|
||||
* @attribute focusedItem
|
||||
* @type Object
|
||||
*/
|
||||
focusedItem: {
|
||||
observer: '_focusedItemChanged',
|
||||
readOnly: true,
|
||||
type: Object
|
||||
},
|
||||
|
||||
/**
|
||||
* The attribute to use on menu items to look up the item title. Typing the first
|
||||
* letter of an item when the menu is open focuses that item. If unset, `textContent`
|
||||
* will be used.
|
||||
*
|
||||
* @attribute attrForItemTitle
|
||||
* @type String
|
||||
*/
|
||||
attrForItemTitle: {
|
||||
type: String
|
||||
}
|
||||
},
|
||||
|
||||
hostAttributes: {
|
||||
'role': 'menu',
|
||||
'tabindex': '0'
|
||||
},
|
||||
|
||||
observers: [
|
||||
'_updateMultiselectable(multi)'
|
||||
],
|
||||
|
||||
listeners: {
|
||||
'focus': '_onFocus',
|
||||
'keydown': '_onKeydown'
|
||||
},
|
||||
|
||||
keyBindings: {
|
||||
'up': '_onUpKey',
|
||||
'down': '_onDownKey',
|
||||
'esc': '_onEscKey',
|
||||
'enter': '_onEnterKey',
|
||||
'shift+tab:keydown': '_onShiftTabDown'
|
||||
},
|
||||
|
||||
_updateMultiselectable: function(multi) {
|
||||
if (multi) {
|
||||
this.setAttribute('aria-multiselectable', 'true');
|
||||
} else {
|
||||
this.removeAttribute('aria-multiselectable');
|
||||
}
|
||||
},
|
||||
|
||||
_onShiftTabDown: function() {
|
||||
var oldTabIndex;
|
||||
|
||||
Polymer.IronMenuBehaviorImpl._shiftTabPressed = true;
|
||||
|
||||
oldTabIndex = this.getAttribute('tabindex');
|
||||
|
||||
this.setAttribute('tabindex', '-1');
|
||||
|
||||
this.async(function() {
|
||||
this.setAttribute('tabindex', oldTabIndex);
|
||||
Polymer.IronMenuBehaviorImpl._shiftTabPressed = false;
|
||||
// Note: polymer/polymer#1305
|
||||
}, 1);
|
||||
},
|
||||
|
||||
_applySelection: function(item, isSelected) {
|
||||
if (isSelected) {
|
||||
item.setAttribute('aria-selected', 'true');
|
||||
} else {
|
||||
item.removeAttribute('aria-selected');
|
||||
}
|
||||
|
||||
Polymer.IronSelectableBehavior._applySelection.apply(this, arguments);
|
||||
},
|
||||
|
||||
_focusedItemChanged: function(focusedItem, old) {
|
||||
old && old.setAttribute('tabindex', '-1');
|
||||
if (focusedItem) {
|
||||
focusedItem.setAttribute('tabindex', '0');
|
||||
focusedItem.focus();
|
||||
}
|
||||
},
|
||||
|
||||
select: function(value) {
|
||||
if (this._defaultFocusAsync) {
|
||||
this.cancelAsync(this._defaultFocusAsync);
|
||||
this._defaultFocusAsync = null;
|
||||
}
|
||||
var item = this._valueToItem(value);
|
||||
this._setFocusedItem(item);
|
||||
Polymer.IronMultiSelectableBehaviorImpl.select.apply(this, arguments);
|
||||
},
|
||||
|
||||
_onFocus: function(event) {
|
||||
if (Polymer.IronMenuBehaviorImpl._shiftTabPressed) {
|
||||
return;
|
||||
}
|
||||
// do not focus the menu itself
|
||||
this.blur();
|
||||
// clear the cached focus item
|
||||
this._setFocusedItem(null);
|
||||
this._defaultFocusAsync = this.async(function() {
|
||||
// focus the selected item when the menu receives focus, or the first item
|
||||
// if no item is selected
|
||||
var selectedItem = this.multi ? (this.selectedItems && this.selectedItems[0]) : this.selectedItem;
|
||||
if (selectedItem) {
|
||||
this._setFocusedItem(selectedItem);
|
||||
} else {
|
||||
this._setFocusedItem(this.items[0]);
|
||||
}
|
||||
// async 100ms to wait for `select` to get called from `_itemActivate`
|
||||
}, 100);
|
||||
},
|
||||
|
||||
_onUpKey: function() {
|
||||
// up and down arrows moves the focus
|
||||
this._focusPrevious();
|
||||
},
|
||||
|
||||
_onDownKey: function() {
|
||||
this._focusNext();
|
||||
},
|
||||
|
||||
_onEscKey: function() {
|
||||
// esc blurs the control
|
||||
this.focusedItem.blur();
|
||||
},
|
||||
|
||||
_onEnterKey: function(event) {
|
||||
// enter activates the item unless it is disabled
|
||||
this._activateFocused(event.detail.keyboardEvent);
|
||||
},
|
||||
|
||||
_onKeydown: function(event) {
|
||||
if (this.keyboardEventMatchesKeys(event, 'up down esc enter')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// all other keys focus the menu item starting with that character
|
||||
this._focusWithKeyboardEvent(event);
|
||||
},
|
||||
|
||||
_focusWithKeyboardEvent: function(event) {
|
||||
for (var i = 0, item; item = this.items[i]; i++) {
|
||||
var attr = this.attrForItemTitle || 'textContent';
|
||||
var title = item[attr] || item.getAttribute(attr);
|
||||
if (title && title.trim().charAt(0).toLowerCase() === String.fromCharCode(event.keyCode).toLowerCase()) {
|
||||
this._setFocusedItem(item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_activateFocused: function(event) {
|
||||
if (!this.focusedItem.hasAttribute('disabled')) {
|
||||
this._activateHandler(event);
|
||||
}
|
||||
},
|
||||
|
||||
_focusPrevious: function() {
|
||||
var length = this.items.length;
|
||||
var index = (Number(this.indexOf(this.focusedItem)) - 1 + length) % length;
|
||||
this._setFocusedItem(this.items[index]);
|
||||
},
|
||||
|
||||
_focusNext: function() {
|
||||
var index = (Number(this.indexOf(this.focusedItem)) + 1) % this.items.length;
|
||||
this._setFocusedItem(this.items[index]);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Polymer.IronMenuBehaviorImpl._shiftTabPressed = false;
|
||||
|
||||
/** @polymerBehavior Polymer.IronMenuBehavior */
|
||||
Polymer.IronMenuBehavior = [
|
||||
Polymer.IronMultiSelectableBehavior,
|
||||
Polymer.IronA11yKeysBehavior,
|
||||
Polymer.IronMenuBehaviorImpl
|
||||
];
|
||||
|
||||
</script>
|
||||
<script>
|
||||
|
||||
/**
|
||||
* `Polymer.IronMenubarBehavior` implements accessible menubar behavior.
|
||||
*
|
||||
* @polymerBehavior Polymer.IronMenubarBehavior
|
||||
*/
|
||||
Polymer.IronMenubarBehaviorImpl = {
|
||||
|
||||
hostAttributes: {
|
||||
'role': 'menubar'
|
||||
},
|
||||
|
||||
keyBindings: {
|
||||
'left': '_onLeftKey',
|
||||
'right': '_onRightKey'
|
||||
},
|
||||
|
||||
_onUpKey: function(event) {
|
||||
this._activateFocused(event.detail.keyboardEvent);
|
||||
},
|
||||
|
||||
_onDownKey: function(event) {
|
||||
this._activateFocused(event.detail.keyboardEvent);
|
||||
},
|
||||
|
||||
_onLeftKey: function() {
|
||||
this._focusPrevious();
|
||||
},
|
||||
|
||||
_onRightKey: function() {
|
||||
this._focusNext();
|
||||
},
|
||||
|
||||
_onKeydown: function(event) {
|
||||
if (this.keyboardEventMatchesKeys(event, 'up down left right esc enter')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// all other keys focus the menu item starting with that character
|
||||
this._focusWithKeyboardEvent(event);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/** @polymerBehavior Polymer.IronMenubarBehavior */
|
||||
Polymer.IronMenubarBehavior = [
|
||||
Polymer.IronMenuBehavior,
|
||||
Polymer.IronMenubarBehaviorImpl
|
||||
];
|
||||
|
||||
</script>
|
||||
<script>
|
||||
/**
|
||||
* The `iron-iconset-svg` element allows users to define their own icon sets
|
||||
@ -10671,6 +10923,10 @@ The `aria-labelledby` attribute will be set to the header element, if one exists
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
</head><body><div hidden="" by-vulcanize=""><dom-module id="paper-material" assetpath="bower_components/paper-material/">
|
||||
<style>
|
||||
:host {
|
||||
@ -13489,7 +13745,529 @@ iron-selector:not(.narrow-layout) #main ::content [paper-drawer-toggle] {
|
||||
|
||||
}());
|
||||
|
||||
</script><iron-iconset-svg name="icons" size="24">
|
||||
</script><iron-iconset-svg name="paper-tabs" size="24">
|
||||
<svg><defs>
|
||||
<g id="chevron-left"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"></path></g>
|
||||
<g id="chevron-right"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"></path></g>
|
||||
</defs></svg>
|
||||
</iron-iconset-svg>
|
||||
<dom-module id="paper-tab" assetpath="bower_components/paper-tabs/">
|
||||
|
||||
<style>
|
||||
|
||||
:host {
|
||||
@apply(--layout-inline);
|
||||
@apply(--layout-center);
|
||||
@apply(--layout-center-justified);
|
||||
@apply(--layout-flex);
|
||||
|
||||
position: relative;
|
||||
padding: 0 12px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
|
||||
@apply(--paper-tab);
|
||||
}
|
||||
|
||||
:host(:focus) {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
:host([link]) {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.tab-content {
|
||||
height: 100%;
|
||||
-webkit-transform: translateZ(0);
|
||||
transform: translateZ(0);
|
||||
transition: opacity 0.1s cubic-bezier(0.4, 0.0, 1, 1);
|
||||
|
||||
@apply(--paper-tab-content);
|
||||
}
|
||||
|
||||
:host(:not(.iron-selected)) > .tab-content {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
:host(:focus) .tab-content {
|
||||
opacity: 1;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
#ink {
|
||||
color: var(--paper-tab-ink, --paper-yellow-a100);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.tab-content > ::content > a {
|
||||
height: 100%;
|
||||
/* flex */
|
||||
-ms-flex: 1 1 0.000000001px;
|
||||
-webkit-flex: 1;
|
||||
flex: 1;
|
||||
-webkit-flex-basis: 0.000000001px;
|
||||
flex-basis: 0.000000001px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
|
||||
<div class="tab-content flex-auto center-center horizontal layout">
|
||||
<content></content>
|
||||
</div>
|
||||
|
||||
<template is="dom-if" if="[[!noink]]">
|
||||
<paper-ripple id="ink" initial-opacity="0.95" opacity-decay-velocity="0.98"></paper-ripple>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
|
||||
</dom-module>
|
||||
|
||||
<script>
|
||||
|
||||
Polymer({
|
||||
|
||||
is: 'paper-tab',
|
||||
|
||||
behaviors: [
|
||||
Polymer.IronControlState
|
||||
],
|
||||
|
||||
properties: {
|
||||
|
||||
/**
|
||||
* If true, ink ripple effect is disabled.
|
||||
*
|
||||
* @attribute noink
|
||||
*/
|
||||
noink: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
hostAttributes: {
|
||||
role: 'tab'
|
||||
},
|
||||
|
||||
listeners: {
|
||||
down: '_onDown'
|
||||
},
|
||||
|
||||
get _parentNoink () {
|
||||
var parent = Polymer.dom(this).parentNode;
|
||||
return !!parent && !!parent.noink;
|
||||
},
|
||||
|
||||
_onDown: function(e) {
|
||||
this.noink = !!this.noink || !!this._parentNoink;
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<dom-module id="paper-tabs" assetpath="bower_components/paper-tabs/">
|
||||
|
||||
<style>
|
||||
|
||||
:host {
|
||||
@apply(--layout);
|
||||
@apply(--layout-center);
|
||||
|
||||
height: 48px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
overflow: hidden;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
||||
|
||||
@apply(--paper-tabs);
|
||||
}
|
||||
|
||||
#tabsContainer {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#tabsContent {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#tabsContent.scrollable {
|
||||
position: absolute;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.not-visible {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
paper-icon-button {
|
||||
width: 24px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
#selectionBar {
|
||||
position: absolute;
|
||||
height: 2px;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: var(--paper-tabs-selection-bar-color, --paper-yellow-a100);
|
||||
-webkit-transform-origin: left center;
|
||||
transform-origin: left center;
|
||||
-webkit-transform: scale(0);
|
||||
transform: scale(0);
|
||||
transition: -webkit-transform;
|
||||
transition: transform;
|
||||
|
||||
@apply(--paper-tabs-selection-bar);
|
||||
}
|
||||
|
||||
#selectionBar.align-bottom {
|
||||
top: 0;
|
||||
bottom: auto;
|
||||
}
|
||||
|
||||
#selectionBar.expand {
|
||||
transition-duration: 0.15s;
|
||||
transition-timing-function: cubic-bezier(0.4, 0.0, 1, 1);
|
||||
}
|
||||
|
||||
#selectionBar.contract {
|
||||
transition-duration: 0.18s;
|
||||
transition-timing-function: cubic-bezier(0.0, 0.0, 0.2, 1);
|
||||
}
|
||||
|
||||
#tabsContent > ::content > *:not(#selectionBar) {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<template>
|
||||
|
||||
<paper-icon-button icon="paper-tabs:chevron-left" class$="[[_computeScrollButtonClass(_leftHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-down="_onLeftScrollButtonDown"></paper-icon-button>
|
||||
|
||||
<div id="tabsContainer" class="flex" on-scroll="_scroll">
|
||||
|
||||
<div id="tabsContent" class$="[[_computeTabsContentClass(scrollable)]]">
|
||||
|
||||
<content select="*"></content>
|
||||
|
||||
<div id="selectionBar" class$="[[_computeSelectionBarClass(noBar, alignBottom)]]" on-transitionend="_onBarTransitionEnd"></div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<paper-icon-button icon="paper-tabs:chevron-right" class$="[[_computeScrollButtonClass(_rightHidden, scrollable, hideScrollButtons)]]" on-up="_onScrollButtonUp" on-down="_onRightScrollButtonDown"></paper-icon-button>
|
||||
|
||||
</template>
|
||||
|
||||
</dom-module>
|
||||
|
||||
<script>
|
||||
|
||||
Polymer({
|
||||
|
||||
is: 'paper-tabs',
|
||||
|
||||
behaviors: [
|
||||
Polymer.IronResizableBehavior,
|
||||
Polymer.IronMenubarBehavior
|
||||
],
|
||||
|
||||
properties: {
|
||||
|
||||
/**
|
||||
* If true, ink ripple effect is disabled.
|
||||
*/
|
||||
noink: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
/**
|
||||
* If true, the bottom bar to indicate the selected tab will not be shown.
|
||||
*/
|
||||
noBar: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
/**
|
||||
* If true, the slide effect for the bottom bar is disabled.
|
||||
*/
|
||||
noSlide: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
/**
|
||||
* If true, tabs are scrollable and the tab width is based on the label width.
|
||||
*/
|
||||
scrollable: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
/**
|
||||
* If true, dragging on the tabs to scroll is disabled.
|
||||
*/
|
||||
disableDrag: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
/**
|
||||
* If true, scroll buttons (left/right arrow) will be hidden for scrollable tabs.
|
||||
*/
|
||||
hideScrollButtons: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
/**
|
||||
* If true, the tabs are aligned to bottom (the selection bar appears at the top).
|
||||
*/
|
||||
alignBottom: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets or sets the selected element. The default is to use the index of the item.
|
||||
*/
|
||||
selected: {
|
||||
type: String,
|
||||
notify: true
|
||||
},
|
||||
|
||||
selectable: {
|
||||
type: String,
|
||||
value: 'paper-tab'
|
||||
},
|
||||
|
||||
_step: {
|
||||
type: Number,
|
||||
value: 10
|
||||
},
|
||||
|
||||
_holdDelay: {
|
||||
type: Number,
|
||||
value: 1
|
||||
},
|
||||
|
||||
_leftHidden: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
_rightHidden: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
|
||||
_previousTab: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
|
||||
hostAttributes: {
|
||||
role: 'tablist'
|
||||
},
|
||||
|
||||
listeners: {
|
||||
'iron-resize': '_onResize',
|
||||
'iron-select': '_onIronSelect',
|
||||
'iron-deselect': '_onIronDeselect'
|
||||
},
|
||||
|
||||
_computeScrollButtonClass: function(hideThisButton, scrollable, hideScrollButtons) {
|
||||
if (!scrollable || hideScrollButtons) {
|
||||
return 'hidden';
|
||||
}
|
||||
|
||||
if (hideThisButton) {
|
||||
return 'not-visible';
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
|
||||
_computeTabsContentClass: function(scrollable) {
|
||||
return scrollable ? 'scrollable' : 'horizontal layout';
|
||||
},
|
||||
|
||||
_computeSelectionBarClass: function(noBar, alignBottom) {
|
||||
if (noBar) {
|
||||
return 'hidden';
|
||||
} else if (alignBottom) {
|
||||
return 'align-bottom';
|
||||
}
|
||||
},
|
||||
|
||||
// TODO(cdata): Add `track` response back in when gesture lands.
|
||||
|
||||
_onResize: function() {
|
||||
this.debounce('_onResize', function() {
|
||||
this._scroll();
|
||||
this._tabChanged(this.selectedItem);
|
||||
}, 10);
|
||||
},
|
||||
|
||||
_onIronSelect: function(event) {
|
||||
this._tabChanged(event.detail.item, this._previousTab);
|
||||
this._previousTab = event.detail.item;
|
||||
this.cancelDebouncer('tab-changed');
|
||||
},
|
||||
|
||||
_onIronDeselect: function(event) {
|
||||
this.debounce('tab-changed', function() {
|
||||
this._tabChanged(null, this._previousTab);
|
||||
// See polymer/polymer#1305
|
||||
}, 1);
|
||||
},
|
||||
|
||||
get _tabContainerScrollSize () {
|
||||
return Math.max(
|
||||
0,
|
||||
this.$.tabsContainer.scrollWidth -
|
||||
this.$.tabsContainer.offsetWidth
|
||||
);
|
||||
},
|
||||
|
||||
_scroll: function() {
|
||||
var scrollLeft;
|
||||
|
||||
if (!this.scrollable) {
|
||||
return;
|
||||
}
|
||||
|
||||
scrollLeft = this.$.tabsContainer.scrollLeft;
|
||||
|
||||
this._leftHidden = scrollLeft === 0;
|
||||
this._rightHidden = scrollLeft === this._tabContainerScrollSize;
|
||||
},
|
||||
|
||||
_onLeftScrollButtonDown: function() {
|
||||
this._holdJob = setInterval(this._scrollToLeft.bind(this), this._holdDelay);
|
||||
},
|
||||
|
||||
_onRightScrollButtonDown: function() {
|
||||
this._holdJob = setInterval(this._scrollToRight.bind(this), this._holdDelay);
|
||||
},
|
||||
|
||||
_onScrollButtonUp: function() {
|
||||
clearInterval(this._holdJob);
|
||||
this._holdJob = null;
|
||||
},
|
||||
|
||||
_scrollToLeft: function() {
|
||||
this.$.tabsContainer.scrollLeft -= this._step;
|
||||
},
|
||||
|
||||
_scrollToRight: function() {
|
||||
this.$.tabsContainer.scrollLeft += this._step;
|
||||
},
|
||||
|
||||
_tabChanged: function(tab, old) {
|
||||
if (!tab) {
|
||||
this._positionBar(0, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
var r = this.$.tabsContent.getBoundingClientRect();
|
||||
var w = r.width;
|
||||
var tabRect = tab.getBoundingClientRect();
|
||||
var tabOffsetLeft = tabRect.left - r.left;
|
||||
|
||||
this._pos = {
|
||||
width: this._calcPercent(tabRect.width, w),
|
||||
left: this._calcPercent(tabOffsetLeft, w)
|
||||
};
|
||||
|
||||
if (this.noSlide || old == null) {
|
||||
// position bar directly without animation
|
||||
this._positionBar(this._pos.width, this._pos.left);
|
||||
return;
|
||||
}
|
||||
|
||||
var oldRect = old.getBoundingClientRect();
|
||||
var oldIndex = this.items.indexOf(old);
|
||||
var index = this.items.indexOf(tab);
|
||||
var m = 5;
|
||||
|
||||
// bar animation: expand
|
||||
this.$.selectionBar.classList.add('expand');
|
||||
|
||||
if (oldIndex < index) {
|
||||
this._positionBar(this._calcPercent(tabRect.left + tabRect.width - oldRect.left, w) - m,
|
||||
this._left);
|
||||
} else {
|
||||
this._positionBar(this._calcPercent(oldRect.left + oldRect.width - tabRect.left, w) - m,
|
||||
this._calcPercent(tabOffsetLeft, w) + m);
|
||||
}
|
||||
|
||||
if (this.scrollable) {
|
||||
this._scrollToSelectedIfNeeded(tabRect.width, tabOffsetLeft);
|
||||
}
|
||||
},
|
||||
|
||||
_scrollToSelectedIfNeeded: function(tabWidth, tabOffsetLeft) {
|
||||
var l = tabOffsetLeft - this.$.tabsContainer.scrollLeft;
|
||||
if (l < 0) {
|
||||
this.$.tabsContainer.scrollLeft += l;
|
||||
} else {
|
||||
l += (tabWidth - this.$.tabsContainer.offsetWidth);
|
||||
if (l > 0) {
|
||||
this.$.tabsContainer.scrollLeft += l;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_calcPercent: function(w, w0) {
|
||||
return 100 * w / w0;
|
||||
},
|
||||
|
||||
_positionBar: function(width, left) {
|
||||
this._width = width;
|
||||
this._left = left;
|
||||
this.transform(
|
||||
'translate3d(' + left + '%, 0, 0) scaleX(' + (width / 100) + ')',
|
||||
this.$.selectionBar);
|
||||
},
|
||||
|
||||
_onBarTransitionEnd: function(e) {
|
||||
var cl = this.$.selectionBar.classList;
|
||||
// bar animation: expand -> contract
|
||||
if (cl.contains('expand')) {
|
||||
cl.remove('expand');
|
||||
cl.add('contract');
|
||||
this._positionBar(this._pos.width, this._pos.left);
|
||||
// bar animation done
|
||||
} else if (cl.contains('contract')) {
|
||||
cl.remove('contract');
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
<iron-iconset-svg name="icons" size="24">
|
||||
<svg>
|
||||
<defs>
|
||||
<g id="add"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"></path></g>
|
||||
|
Loading…
Reference in New Issue
Block a user