Chromium Code Reviews| Index: chrome/common/extensions/docs/static/js/platform_chooser.js |
| diff --git a/chrome/common/extensions/docs/static/js/platform_chooser.js b/chrome/common/extensions/docs/static/js/platform_chooser.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b5cd44fd63480cf589fa59cfc6f86a8cf35163e9 |
| --- /dev/null |
| +++ b/chrome/common/extensions/docs/static/js/platform_chooser.js |
| @@ -0,0 +1,20 @@ |
| +// Copyright (c) 2012 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. |
| + |
| +(function() { |
| + |
| +function init() { |
|
cduvall
2013/05/15 00:50:50
nit: just run init immediately? (function() {...})
not at google - send to devlin
2013/05/15 01:26:50
I like it when these files are complex, but I supp
|
| + var platformChooser = document.getElementById('platform-chooser-popup'); |
| + Array.prototype.forEach.call(platformChooser.getElementsByTagName('button'), |
| + function(button) { |
| + button.addEventListener('click', function(event) { |
| + window.location.assign(button.getAttribute('data-href')); |
| + event.stopPropagation(); |
| + }); |
| + }); |
| +} |
| + |
| +init(); |
| + |
| +})() |