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

Side by Side Diff: client/web/main.dart

Issue 149573008: Factor out the anchor prefix to easily allow switching to #! (Closed) Base URL: https://github.com/dart-lang/dartdoc-viewer.git@master
Patch Set: Accept the basic form (#) but allow the ajax form Created 6 years, 10 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 unified diff | Download patch
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 web.main; 5 library web.main;
6 6
7 import 'dart:html'; 7 import 'dart:html';
8 import 'package:dartdoc_viewer/item.dart'; 8 import 'package:dartdoc_viewer/item.dart';
9 import 'package:dartdoc_viewer/read_yaml.dart'; 9 import 'package:dartdoc_viewer/read_yaml.dart';
10 import 'package:polymer/polymer.dart'; 10 import 'package:polymer/polymer.dart';
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 list.classes.remove("open"); 141 list.classes.remove("open");
142 } 142 }
143 143
144 var _buildIdentifier; 144 var _buildIdentifier;
145 @observable get buildIdentifier { 145 @observable get buildIdentifier {
146 if (_buildIdentifier != null) return _buildIdentifier; 146 if (_buildIdentifier != null) return _buildIdentifier;
147 147
148 _buildIdentifier = ''; // Don't try twice. 148 _buildIdentifier = ''; // Don't try twice.
149 retrieveFileContents('docs/VERSION').then((version) { 149 retrieveFileContents('docs/VERSION').then((version) {
150 _buildIdentifier = notifyPropertyChange(#buildIdentifier, 150 _buildIdentifier = notifyPropertyChange(#buildIdentifier,
151 _buildIdentifier, "r $version"); 151 _buildIdentifier, version);
152 }).catchError((_) => null); 152 }).catchError((_) => null);
153 return ''; 153 return '';
154 } 154 }
155 155
156 /// Collapse/expand the navbar when in mobile. Workaround for something 156 /// Collapse/expand the navbar when in mobile. Workaround for something
157 /// that ought to happen magically with bootstrap, but fails in the 157 /// that ought to happen magically with bootstrap, but fails in the
158 /// presence of shadow DOM. 158 /// presence of shadow DOM.
159 void navHideShow(event, detail, target) { 159 void navHideShow(event, detail, target) {
160 var nav = shadowRoot.querySelector("#nav-collapse-content"); 160 var nav = shadowRoot.querySelector("#nav-collapse-content");
161 hideOrShowNavigation(hide: nav.classes.contains("in"), nav: nav); 161 hideOrShowNavigation(hide: nav.classes.contains("in"), nav: nav);
(...skipping 17 matching lines...) Expand all
179 Element body = shadowRoot.querySelector(".main-body"); 179 Element body = shadowRoot.querySelector(".main-body");
180 var height = navbar.marginEdge.height; 180 var height = navbar.marginEdge.height;
181 var positioning = navbar.getComputedStyle().position; 181 var positioning = navbar.getComputedStyle().position;
182 if (positioning == "fixed") { 182 if (positioning == "fixed") {
183 body.style.paddingTop = height.toString() + "px"; 183 body.style.paddingTop = height.toString() + "px";
184 } else { 184 } else {
185 body.style.removeProperty("padding-top"); 185 body.style.removeProperty("padding-top");
186 } 186 }
187 } 187 }
188 } 188 }
OLDNEW
« client/web/app.dart ('K') | « client/web/link.dart ('k') | client/web/method.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698