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

Unified Diff: appengine/chromium_rietveld/new_static/components/cr-hash-observer.html

Issue 1001723003: Create a common directory of widgets and css. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 5 years, 9 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: 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>

Powered by Google App Engine
This is Rietveld 408576698