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

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

Issue 2745593004: [MD Bookmarks] Add draggable sidebar. (Closed)
Patch Set: rebase 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 behaviors: [ 8 behaviors: [
9 bookmarks.StoreClient, 9 bookmarks.StoreClient,
10 ], 10 ],
11 11
12 properties: { 12 properties: {
13 /** @private */ 13 /** @private */
14 searchTerm_: { 14 searchTerm_: {
15 type: String, 15 type: String,
16 observer: 'onSearchTermChanged_', 16 observer: 'onSearchTermChanged_',
17 }, 17 },
18
19 sidebarWidth: {
20 type: String,
21 observer: 'onSidebarWidthChanged_',
22 },
18 }, 23 },
19 24
20 attached: function() { 25 attached: function() {
21 this.watch('searchTerm_', function(state) { 26 this.watch('searchTerm_', function(state) {
22 return state.search.term; 27 return state.search.term;
23 }); 28 });
24 }, 29 },
25 30
26 /** @return {CrToolbarSearchFieldElement} */ 31 /** @return {CrToolbarSearchFieldElement} */
27 get searchField() { 32 get searchField() {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 78
74 /** 79 /**
75 * @param {Event} e 80 * @param {Event} e
76 * @private 81 * @private
77 */ 82 */
78 onSearchChanged_: function(e) { 83 onSearchChanged_: function(e) {
79 var searchTerm = /** @type {string} */ (e.detail); 84 var searchTerm = /** @type {string} */ (e.detail);
80 this.dispatch(bookmarks.actions.setSearchTerm(searchTerm)); 85 this.dispatch(bookmarks.actions.setSearchTerm(searchTerm));
81 }, 86 },
82 87
88 onSidebarWidthChanged_: function() {
89 this.style.setProperty('--sidebar-width', this.sidebarWidth);
90 },
91
83 /** @private */ 92 /** @private */
84 onSearchTermChanged_: function() { 93 onSearchTermChanged_: function() {
85 this.searchField.setValue(this.searchTerm_ || ''); 94 this.searchField.setValue(this.searchTerm_ || '');
86 }, 95 },
87 }); 96 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/md_bookmarks/toolbar.html ('k') | ui/webui/resources/html/cr/ui/splitter.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698