Vectorize sad tab image.
[chromium-blink-merge.git] / chrome / browser / resources / settings / settings_menu / settings_menu.js
blob73a4f5b68314faf4e6d6dd6204599bf13ad4a218
1 // Copyright 2015 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 /**
6 * @fileoverview
7 * 'cr-settings-menu' shows a menu with a hardcoded set of pages and subpages.
9 * Example:
11 * <cr-settings-menu selected-page-id="{{selectedPageId}}">
12 * </cr-settings-menu>
14 * @group Chrome Settings Elements
15 * @element cr-settings-menu
17 Polymer({
18 is: 'cr-settings-menu',
20 properties: {
21 /**
22 * The current active route.
24 currentRoute: {
25 type: Object,
26 notify: true,
27 observer: 'currentRouteChanged_',
31 /** @private */
32 currentRouteChanged_: function() {
33 var submenu = this.shadowRoot.querySelector(
34 'paper-submenu[data-page="' + this.currentRoute.page + '"]');
35 if (submenu)
36 submenu.opened = true;
39 /** @private */
40 openPage_: function(event) {
41 var submenuRoute = event.currentTarget.dataset.page;
42 if (submenuRoute) {
43 this.currentRoute = {
44 page: submenuRoute,
45 section: '',
46 subpage: [],
50 });