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

Side by Side Diff: dart/samples/third_party/todomvc/web/router_options.dart

Issue 66253002: Version 0.8.10.9 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library todomvc.web.router_options; 5 library todomvc.web.router_options;
6 6
7 import 'dart:html'; 7 import 'dart:html';
8 import 'package:polymer/polymer.dart'; 8 import 'package:polymer/polymer.dart';
9 9
10 /** 10 /**
(...skipping 11 matching lines...) Expand all
22 RouterOptions.created() : super.created() { 22 RouterOptions.created() : super.created() {
23 polymerCreated(); 23 polymerCreated();
24 } 24 }
25 25
26 bool get applyAuthorStyles => true; 26 bool get applyAuthorStyles => true;
27 var _sub; 27 var _sub;
28 28
29 void enteredView() { 29 void enteredView() {
30 super.enteredView(); 30 super.enteredView();
31 31
32 var anchors = this.queryAll('a'); 32 var anchors = this.querySelectorAll('a');
33 33
34 _updateHash(records) { 34 _updateHash(records) {
35 var hash = window.location.hash; 35 var hash = window.location.hash;
36 if (hash == '') hash = '#/'; 36 if (hash == '') hash = '#/';
37 for (var a in anchors) { 37 for (var a in anchors) {
38 if (a.hash == hash) { 38 if (a.hash == hash) {
39 a.classes.add('selected'); 39 a.classes.add('selected');
40 } else { 40 } else {
41 a.classes.remove('selected'); 41 a.classes.remove('selected');
42 } 42 }
43 } 43 }
44 } 44 }
45 45
46 _updateHash(null); 46 _updateHash(null);
47 _sub = windowLocation.changes.listen(_updateHash); 47 _sub = windowLocation.changes.listen(_updateHash);
48 } 48 }
49 49
50 void leftView() { 50 void leftView() {
51 _sub.cancel(); 51 _sub.cancel();
52 super.leftView(); 52 super.leftView();
53 } 53 }
54 } 54 }
OLDNEW
« no previous file with comments | « dart/samples/third_party/todomvc/web/editable_label.dart ('k') | dart/samples/third_party/todomvc/web/todo_row.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698