Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 Polymer({ | |
| 6 is: 'side-bar', | |
| 7 | |
| 8 attached: function() { | |
| 9 this.showHistory(); | |
| 10 }, | |
| 11 | |
| 12 properties: { | |
| 13 selectedDisplay: { | |
| 14 type: String, | |
| 15 value: 'history' | |
| 16 } | |
| 17 }, | |
| 18 | |
| 19 // TODO(yingran): possibly use polymer properties to change the styles of the | |
| 20 // menu. Also somehow simplify the below since there is repetition. | |
| 21 /** | |
| 22 * Fires event to display the synced tabs page. | |
| 23 */ | |
| 24 showSyncedTabs: function() { | |
| 25 this.selectedPage = 'synced-tabs'; | |
| 26 this.fire('switch-display', { | |
| 27 display: this.selectedPage | |
| 28 }); | |
| 29 | |
| 30 this.$['tab-button'].style.cursor = 'default'; | |
| 31 this.$['synced-tabs'].style.color = '#47d'; | |
| 32 this.$['history-button'].style.cursor = 'pointer'; | |
| 33 this.$['history'].style.color = '#333'; | |
| 34 }, | |
| 35 | |
| 36 /** | |
| 37 * Fires event to display the history item page. | |
| 38 */ | |
| 39 showHistory: function() { | |
|
calamity
2016/02/02 04:09:47
Needing both of these is kinda lame. You should be
yingran
2016/02/09 04:21:34
Done.
| |
| 40 this.selectedPage = 'history'; | |
| 41 this.fire('switch-display', { | |
| 42 display: this.selectedPage | |
| 43 }); | |
| 44 | |
| 45 this.$['history-button'].style.cursor = 'default'; | |
| 46 this.$['history'].style.color = '#47d'; | |
| 47 this.$['tab-button'].style.cursor = 'pointer'; | |
| 48 this.$['synced-tabs'].style.color = '#333'; | |
|
calamity
2016/02/02 04:09:47
Use a CSS style that changes between these when an
yingran
2016/02/09 04:21:34
Done.
| |
| 49 } | |
| 50 }); | |
| OLD | NEW |