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

Side by Side Diff: appengine/chromium_rietveld/new_static/components/cr-title-handler.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 unified diff | Download patch
OLDNEW
(Empty)
1 <!-- Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 Use of this source code is governed by a BSD-style license that can be
3 found in the LICENSE file. -->
4
5 <polymer-element name="cr-title-handler" attributes="titlePrefix titleSuffix">
6 <template>
7 <style>
8 :host { display: none; }
9 </style>
10 </template>
11 <script>
12 Polymer("cr-title-handler", {
13 created: function() {
14 this.titlePrefix = "";
15 this.titleSuffix = "";
16 this.handleTitleChange = this.handleTitleChange.bind(this);
17 },
18 attached: function() {
19 document.addEventListener("title-change", this.handleTitleChange );
20 },
21 detached: function() {
22 document.removeEventListener("title-change", this.handleTitleCha nge);
23 },
24 handleTitleChange: function(event) {
25 var value = event.detail.value || "";
26 var title = this.titlePrefix;
27 if (title.length && value.length)
28 title += ": ";
29 if (value.length)
30 title += value;
31 if (this.titleSuffix)
32 title += " - " + this.titleSuffix;
33 document.title = title;
34 },
35 });
36 </script>
37 </polymer-element>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698