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

Unified Diff: bower_components/paper-toggle-button/paper-toggle-button.html

Issue 786953007: npm_modules: Fork bower_components into Polymer 0.4.0 and 0.5.0 versions (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 12 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
« no previous file with comments | « bower_components/paper-toggle-button/paper-toggle-button.css ('k') | bower_components/platform/.bower.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bower_components/paper-toggle-button/paper-toggle-button.html
diff --git a/bower_components/paper-toggle-button/paper-toggle-button.html b/bower_components/paper-toggle-button/paper-toggle-button.html
deleted file mode 100644
index 06fff86c78e2635fb076eeab5814db5c80a81a55..0000000000000000000000000000000000000000
--- a/bower_components/paper-toggle-button/paper-toggle-button.html
+++ /dev/null
@@ -1,144 +0,0 @@
-<!--
-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
--->
-
-<!--
-`paper-toggle-button` provides a ON/OFF switch that user can toggle the state
-by tapping or by dragging the swtich.
-
-Example:
-
- <paper-toggle-button></paper-toggle-button>
-
-Styling toggle button:
-
-To change the ink color for checked state:
-
- paper-toggle-button::shadow paper-radio-button::shadow #ink[checked] {
- color: #4285f4;
- }
-
-To change the radio checked color:
-
- paper-toggle-button::shadow paper-radio-button::shadow #onRadio {
- background-color: #4285f4;
- }
-
-To change the bar color for checked state:
-
- paper-toggle-button::shadow #toggleBar[checked] {
- background-color: #4285f4;
- }
-
-To change the ink color for unchecked state:
-
- paper-toggle-button::shadow paper-radio-button::shadow #ink {
- color: #b5b5b5;
- }
-
-To change the radio unchecked color:
-
- paper-toggle-button::shadow paper-radio-button::shadow #offRadio {
- border-color: #b5b5b5;
- }
-
-To change the bar color for unchecked state:
-
- paper-toggle-button::shadow #toggleBar {
- background-color: red;
- }
-
-@group Paper Elements
-@element paper-toggle-button
-@homepage github.io
--->
-
-<link rel="import" href="../paper-radio-button/paper-radio-button.html">
-
-<polymer-element name="paper-toggle-button" attributes="checked" role="button" aria-pressed="false" tabindex="0">
-<template>
-
- <link rel="stylesheet" href="paper-toggle-button.css">
-
- <div id="toggleContainer">
-
- <div id="toggleBar" checked?="{{checked}}"></div>
-
- <paper-radio-button id="toggleRadio" toggles checked="{{checked}}" on-change="{{changeAction}}" on-core-change="{{stopPropagation}}"
- on-trackstart="{{trackStart}}" on-trackx="{{trackx}}" on-trackend="{{trackEnd}}"></paper-radio-button>
-
- </div>
-
-</template>
-<script>
-
- Polymer('paper-toggle-button', {
-
- /**
- * Fired when the checked state changes due to user interaction.
- *
- * @event change
- */
-
- /**
- * Fired when the checked state changes.
- *
- * @event core-change
- */
-
- /**
- * Gets or sets the state, `true` is checked and `false` is unchecked.
- *
- * @attribute checked
- * @type boolean
- * @default false
- */
- checked: false,
-
- trackStart: function(e) {
- this._w = this.$.toggleBar.offsetLeft + this.$.toggleBar.offsetWidth;
- e.preventTap();
- },
-
- trackx: function(e) {
- this._x = Math.min(this._w,
- Math.max(0, this.checked ? this._w + e.dx : e.dx));
- this.$.toggleRadio.classList.add('dragging');
- var s = this.$.toggleRadio.style;
- s.webkitTransform = s.transform = 'translate3d(' + this._x + 'px,0,0)';
- },
-
- trackEnd: function() {
- var s = this.$.toggleRadio.style;
- s.transform = s.webkitTransform = '';
- this.$.toggleRadio.classList.remove('dragging');
- var old = this.checked;
- this.checked = Math.abs(this._x) > this._w / 2;
- if (this.checked !== old) {
- this.fire('change');
- }
- },
-
- checkedChanged: function() {
- this.setAttribute('aria-pressed', Boolean(this.checked));
- this.fire('core-change');
- },
-
- changeAction: function(e) {
- e.stopPropagation();
- this.fire('change');
- },
-
- stopPropagation: function(e) {
- e.stopPropagation();
- }
-
- });
-
-</script>
-</polymer-element>
« no previous file with comments | « bower_components/paper-toggle-button/paper-toggle-button.css ('k') | bower_components/platform/.bower.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698