Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / common / extensions / docs / static / js / platform_chooser.js
blob5492cffcb7b0756da3dc9fbff272c00eb55418fa
1 // Copyright 2013 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.
5 // Intializes the platform chooser, the widget in the top left corner with the
6 // 'Apps...Extensions' dropdown.
7 (function() {
9 var platformChooser = document.getElementById('platform-chooser-popup');
10 Array.prototype.forEach.call(platformChooser.getElementsByTagName('button'),
11                              function(button) {
12   button.addEventListener('click', function(event) {
13     window.location.assign(button.getAttribute('data-href'));
14     event.stopPropagation();
15   });
16 });
18 })()