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 properties: { | |
| 9 selectedDisplay: { | |
| 10 type: String, | |
| 11 value: 'history-button' | |
| 12 } | |
| 13 }, | |
| 14 | |
| 15 changeDisplay: function(e) { | |
| 16 this.selectedPage = e.currentTarget.id; | |
| 17 | |
| 18 var currentButton = | |
| 19 Polymer.dom(this.root).querySelector('.selected'); | |
| 20 currentButton.classList.remove('selected'); | |
| 21 | |
| 22 var buttonPressed = | |
| 23 Polymer.dom(this.root).querySelector('#' + e.currentTarget.id); | |
|
calamity
2016/02/11 00:23:31
Can't you just use e.currentTarget?
yingran
2016/02/11 02:06:36
nup
polymer-mini-extracted.js:1233 Uncaught Synta
| |
| 24 buttonPressed.classList.add('selected'); | |
| 25 | |
| 26 this.fire('switch-display', { display: this.selectedPage }); | |
| 27 } | |
| 28 }); | |
| OLD | NEW |