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

Unified Diff: third_party/polymer/components/core-drag-drop/core-drag-drop.html

Issue 592603004: Revert "Polymer elements added to third_party/polymer." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/components/core-drag-drop/core-drag-drop.html
diff --git a/third_party/polymer/components/core-drag-drop/core-drag-drop.html b/third_party/polymer/components/core-drag-drop/core-drag-drop.html
deleted file mode 100644
index ec3a3cde7af6841ec6d2c9cf31838af24cdeab51..0000000000000000000000000000000000000000
--- a/third_party/polymer/components/core-drag-drop/core-drag-drop.html
+++ /dev/null
@@ -1,110 +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>
-
- Polymer('core-drag-drop', {
-
- observe: {
- 'x y': 'coordinatesChanged'
- },
-
- ready: function() {
- if (!this.__proto__.avatar) {
- this.__proto__.avatar = document.createElement('core-drag-avatar');
- document.body.appendChild(this.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 | « third_party/polymer/components/core-drag-drop/.bower.json ('k') | third_party/polymer/components/core-drag-drop/demo.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698