Chromium Code Reviews| Index: chrome/browser/resources/md_history/side_bar.js |
| diff --git a/chrome/browser/resources/md_history/side_bar.js b/chrome/browser/resources/md_history/side_bar.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..54587ec072b024daf7335c8e461eb281db45b5bf |
| --- /dev/null |
| +++ b/chrome/browser/resources/md_history/side_bar.js |
| @@ -0,0 +1,28 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +Polymer({ |
| + is: 'side-bar', |
| + |
| + properties: { |
| + selectedDisplay: { |
| + type: String, |
| + value: 'history-button' |
| + } |
| + }, |
| + |
| + changeDisplay: function(e) { |
| + this.selectedPage = e.currentTarget.id; |
| + |
| + var currentButton = |
| + Polymer.dom(this.root).querySelector('.selected'); |
| + currentButton.classList.remove('selected'); |
| + |
| + var buttonPressed = |
| + 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
|
| + buttonPressed.classList.add('selected'); |
| + |
| + this.fire('switch-display', { display: this.selectedPage }); |
| + } |
| +}); |