Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: chrome/browser/resources/settings/settings_menu/settings_menu.js

Issue 981203007: Scaffold for MD-Settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove help Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/settings_menu/settings_menu.js
diff --git a/chrome/browser/resources/settings/settings_menu/settings_menu.js b/chrome/browser/resources/settings/settings_menu/settings_menu.js
new file mode 100644
index 0000000000000000000000000000000000000000..28a30f09a9e749ca161df66c1a8b778c92ddcf74
--- /dev/null
+++ b/chrome/browser/resources/settings/settings_menu/settings_menu.js
@@ -0,0 +1,47 @@
+// Copyright 2015 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.
+
+/**
+ * @fileoverview
+ * 'cr-settings-menu' shows a menu with the given pages.
+ *
+ * Example:
+ *
+ * <cr-settings-menu pages="{{pages}}" selectedIndex="{{index}}">
+ * </cr-settings-menu>
+ *
+ * @group Chrome Settings Elements
+ * @element cr-settings-menu
+ */
+Polymer('cr-settings-menu', {
+ publish: {
+ /**
+ * Pages to show menu items for.
+ *
+ * @attribute pages
+ * @type Array<!Object>
+ * @default []
+ */
+ pages: [],
+
+ /**
+ * Index of the currently selected page.
+ *
+ * @attribute selectedIndex
+ * @type number
+ * default 0
+ */
+ selectedIndex: 0,
+ },
+
+ pageSelected: function(e, detail) {
+ if (!detail.isSelected)
+ return;
+
+ // Issue 33: selectedModel is not updated yet, so grab the model from the
Jeremy Klein 2015/03/09 21:17:14 Weird... I guess it's either this or this.async(..
+ // selectedItem's templateInstance object. See http://goo.gl/KpEYGP.
+ this.fire('cr-settings-page-select',
Kyle Horimoto 2015/03/09 20:59:32 Don't we need to declare this event type?
Jeremy Klein 2015/03/09 21:17:14 Yeah, we should probably at least extract this to
michaelpg 2015/03/12 01:41:40 Removed, as this isn't doing anything.
+ this.$.menu.selectedItem.templateInstance.model);
+ },
+});

Powered by Google App Engine
This is Rietveld 408576698