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

Unified Diff: bower_components/core-drag-drop/core-drag-drop.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, 11 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/core-drag-drop/.bower.json ('k') | bower_components/core-drag-drop/demo.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bower_components/core-drag-drop/core-drag-drop.html
diff --git a/bower_components/core-drag-drop/core-drag-drop.html b/bower_components/core-drag-drop/core-drag-drop.html
deleted file mode 100644
index 6ea1360f88694cabbbe35400923c6a59f529c50c..0000000000000000000000000000000000000000
--- a/bower_components/core-drag-drop/core-drag-drop.html
+++ /dev/null
@@ -1,114 +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
--->
-
-<link rel="import" href="../polymer/polymer.html">
-
-<style>
- core-drag-avatar {
- position: fixed;
- left: 0;
- top: 0;
- display: block;
- pointer-events: none;
- }
-</style>
-
-<!--
-@group Polymer Core Elements
-@element core-drag-drop
-@homepage github.io
--->
-
-<polymer-element name="core-drag-drop">
-<script>
-(function() {
- var avatar;
-
- Polymer('core-drag-drop', {
-
- observe: {
- 'x y': 'coordinatesChanged'
- },
-
- ready: function() {
- if (!avatar) {
- avatar = document.createElement('core-drag-avatar');
- document.body.appendChild(avatar);
- }
- this.avatar = avatar;
- this.dragging = false;
- },
-
- draggingChanged: function() {
- this.avatar.style.display = this.dragging ? '' : 'none';
- },
-
- coordinatesChanged: function() {
- var x = this.x, y = this.y;
- this.avatar.style.transform =
- this.avatar.style.webkitTransform =
- 'translate(' + x + 'px, ' + y + 'px)';
- },
-
- attached: function() {
- var listen = function(event, handler) {
- Polymer.addEventListener(this.parentNode, event, this[handler].bind(this));
- }.bind(this);
- //
- listen('trackstart', 'trackStart');
- listen('track', 'track');
- listen('trackend', 'trackEnd');
- //
- var host = this.parentNode.host || this.parentNode;
- host.style.cssText += '; user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none;';
- },
-
- trackStart: function(event) {
- this.avatar.style.cssText = '';
- this.dragInfo = {
- event: event,
- avatar: this.avatar
- };
- this.fire('drag-start', this.dragInfo);
- // flaw #1: what if user doesn't need `drag()`?
- this.dragging = Boolean(this.dragInfo.drag);
- },
-
- track: function(event) {
- if (this.dragging) {
- this.x = event.pageX;
- this.y = event.pageY;
- this.dragInfo.event = event;
- this.dragInfo.p = {x : this.x, y: this.y};
- this.dragInfo.drag(this.dragInfo);
- }
- },
-
- trackEnd: function(event) {
- if (this.dragging) {
- this.dragging = false;
- if (this.dragInfo.drop) {
- this.dragInfo.framed = this.framed(event.relatedTarget);
- this.dragInfo.event = event;
- this.dragInfo.drop(this.dragInfo);
- }
- }
- this.dragInfo = null;
- },
-
- framed: function(node) {
- var local = node.getBoundingClientRect();
- return {x: this.x - local.left, y: this.y - local.top};
- }
-
- });
-
-})();
-</script>
-</polymer-element>
« no previous file with comments | « bower_components/core-drag-drop/.bower.json ('k') | bower_components/core-drag-drop/demo.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698