Index: appengine/chromium_rietveld/new_static/components/cr-hash-observer.html |
diff --git a/appengine/chromium_rietveld/new_static/components/cr-hash-observer.html b/appengine/chromium_rietveld/new_static/components/cr-hash-observer.html |
deleted file mode 100644 |
index 2ade1b746ed78cb2cb8abb5fa23c780470594306..0000000000000000000000000000000000000000 |
--- a/appengine/chromium_rietveld/new_static/components/cr-hash-observer.html |
+++ /dev/null |
@@ -1,50 +0,0 @@ |
-<!-- Copyright (c) 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. --> |
- |
-<!-- |
- Use to observe to dynamically observe changes to the hash in the url. |
- |
- ex. |
- <cr-hash-observer on-hash-changed="{{ handleHashChange }}"></cr-hash-observer> |
---> |
-<polymer-element name="cr-hash-observer"> |
- <template> |
- <style> |
- :host { display: none; } |
- </style> |
- </template> |
- <script> |
- (function() { |
- var instances = []; |
- |
- Polymer("cr-hash-observer", { |
- attached: function() { |
- instances.push(this); |
- }, |
- detached: function() { |
- var i = instances.indexOf(this); |
- if (i >= 0) |
- instances.splice(i, 1); |
- }, |
- }); |
- |
- var currentHash = ""; |
- function notifyInstancesIfNeeded() { |
- if (window.location.hash == currentHash) |
- return; |
- currentHash = window.location.hash; |
- instances.forEach(function(instance) { |
- instance.asyncFire("hash-changed"); |
- }); |
- } |
- |
- function handleHashChange() { |
- setTimeout(notifyInstancesIfNeeded); |
- } |
- |
- document.addEventListener("navigate", handleHashChange); |
- window.addEventListener("hashchange", handleHashChange); |
- })(); |
- </script> |
-</polymer-element> |