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

Unified Diff: samples/third_party/todomvc_performance/js_todomvc/components/flatiron-director/flatiron-director.html

Issue 204733004: Added TodoMVC startup benchmarks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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: samples/third_party/todomvc_performance/js_todomvc/components/flatiron-director/flatiron-director.html
diff --git a/samples/third_party/todomvc_performance/js_todomvc/components/flatiron-director/flatiron-director.html b/samples/third_party/todomvc_performance/js_todomvc/components/flatiron-director/flatiron-director.html
new file mode 100644
index 0000000000000000000000000000000000000000..f0538cd896b6f7cd37b5cc4173b4bf81456ceef1
--- /dev/null
+++ b/samples/third_party/todomvc_performance/js_todomvc/components/flatiron-director/flatiron-director.html
@@ -0,0 +1,37 @@
+<!--
+Copyright 2013 The Polymer Authors. All rights reserved.
+Use of this source code is governed by a BSD-style
+license that can be found in the LICENSE file.
+-->
+<link rel="import" href="../polymer/polymer.html">
+<script src="director/director.min.js"></script>
+
+<polymer-element name="flatiron-director" attributes="route autoHash">
+ <script>
+ (function() {
+ var private_router;
+ Polymer('flatiron-director', {
+ autoHash: false,
+ ready: function() {
+ this.router.on(/(.*)/, function(route) {
+ this.route = route;
+ }.bind(this));
+ this.route = this.router.getRoute(0) || '';
+ },
+ routeChanged: function() {
+ if (this.autoHash) {
+ window.location.hash = this.route;
+ }
+ this.fire('director-route', this.route);
+ },
+ get router() {
+ if (!private_router) {
+ private_router = new Router();
+ private_router.init();
+ }
+ return private_router;
+ }
+ });
+ })();
+ </script>
+</polymer-element>

Powered by Google App Engine
This is Rietveld 408576698