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

Side by Side Diff: chrome/browser/resources/md_bookmarks/toolbar.js

Issue 2745593004: [MD Bookmarks] Add draggable sidebar. (Closed)
Patch Set: Created 3 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 Polymer({ 5 Polymer({
6 is: 'bookmarks-toolbar', 6 is: 'bookmarks-toolbar',
7 7
8 properties: { 8 properties: {
9 searchTerm: { 9 searchTerm: {
10 type: String, 10 type: String,
11 observer: 'onSearchTermChanged_', 11 observer: 'onSearchTermChanged_',
12 }, 12 },
13
14 sidebarWidth: {
15 type: String,
16 observer: 'onSidebarWidthChanged_',
17 },
13 }, 18 },
14 19
15 /** @return {CrToolbarSearchFieldElement} */ 20 /** @return {CrToolbarSearchFieldElement} */
16 get searchField() { 21 get searchField() {
17 return /** @type {CrToolbarElement} */ (this.$$('cr-toolbar')) 22 return /** @type {CrToolbarElement} */ (this.$$('cr-toolbar'))
18 .getSearchField(); 23 .getSearchField();
19 }, 24 },
20 25
21 /** 26 /**
22 * @param {Event} e 27 * @param {Event} e
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 67
63 /** 68 /**
64 * @param {Event} e 69 * @param {Event} e
65 * @private 70 * @private
66 */ 71 */
67 onSearchChanged_: function(e) { 72 onSearchChanged_: function(e) {
68 var searchTerm = /** @type {string} */ (e.detail); 73 var searchTerm = /** @type {string} */ (e.detail);
69 this.fire('search-term-changed', searchTerm); 74 this.fire('search-term-changed', searchTerm);
70 }, 75 },
71 76
77 onSidebarWidthChanged_: function() {
78 this.style.setProperty('--sidebar-width', this.sidebarWidth);
79 },
80
72 /** @private */ 81 /** @private */
73 onSearchTermChanged_: function() { 82 onSearchTermChanged_: function() {
74 this.searchField.setValue(this.searchTerm || ''); 83 this.searchField.setValue(this.searchTerm || '');
75 }, 84 },
76 }); 85 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698