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

Unified Diff: Tools/GardeningServer/ui/ct-view-handler.html

Issue 728023004: Remove GardeningServer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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: Tools/GardeningServer/ui/ct-view-handler.html
diff --git a/Tools/GardeningServer/ui/ct-view-handler.html b/Tools/GardeningServer/ui/ct-view-handler.html
deleted file mode 100644
index 61147d551e982bb483c17e2746924dd8861e5c02..0000000000000000000000000000000000000000
--- a/Tools/GardeningServer/ui/ct-view-handler.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!--
-Copyright 2014 The Chromium Authors. All rights reserved.
-Use of this source code is governed by a BSD-style license that can be
-found in the LICENSE file.
--->
-
-<!--
-Makes all links in a component view navigation aware. This will trap
-clicks to links in that component and then redirect the navigation to the
-<ct-router> component by dispatching a "navigate" event.
-
-To use, just add the component to the <template> inside all components that
-use <a href> where the link should switch to a different view.
-
-ex.
- <ct-view-handler></ct-view-handler>
--->
-<polymer-element name="ct-view-handler">
- <template>
- <style>
- :host { display: none; }
- </style>
- </template>
- <script>
- Polymer("ct-view-handler", {
- created: function() {
- this.handleClick = this.handleClick.bind(this);
- },
-
- attached: function() {
- this.scope = this.enclosingTreeScope();
- this.scope.addEventListener("click", this.handleClick);
- },
-
- detached: function() {
- this.scope.removeEventListener("click", this.handleClick);
- },
-
- handleClick: function(event) {
- if (event.metaKey || event.ctrlKey || event.button == 1)
- return;
- var a = this.findEnclosingLink(event.target);
- if (!a)
- return;
- if (!a.href.startsWith(window.location.origin))
- return;
- event.preventDefault();
- this.asyncFire("navigate", {
- url: a.pathname + a.search + a.hash
- });
- },
-
- findEnclosingLink: function(node) {
- while (node && node.nodeName != "A")
- node = node.parentNode;
- return node;
- },
-
- enclosingTreeScope: function() {
- var scope = this;
- while (scope.parentNode)
- scope = scope.parentNode;
- return scope;
- },
- });
- </script>
-</polymer-element>
« no previous file with comments | « Tools/GardeningServer/ui/ct-view.html ('k') | Tools/GardeningServer/ui/test/ct-builder-failure-card-tests.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698