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

Unified Diff: resources/bookmark_manager/js/cr/ui/listitem.js

Issue 853002: Updating the Chromium reference build for Windows. The continuous... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/reference_builds/chrome/
Patch Set: Added the symbol files back. Created 10 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: resources/bookmark_manager/js/cr/ui/listitem.js
===================================================================
--- resources/bookmark_manager/js/cr/ui/listitem.js (revision 0)
+++ resources/bookmark_manager/js/cr/ui/listitem.js (revision 0)
@@ -0,0 +1,58 @@
+// Copyright (c) 2010 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.
+
+cr.define('cr.ui', function() {
+
+ /**
+ * Creates a new list item element.
+ * @param {string} opt_label The text label for the item.
+ * @constructor
+ * @extends {HTMLLIElement}
+ */
+ var ListItem = cr.ui.define('li');
+
+ ListItem.prototype = {
+ __proto__: HTMLLIElement.prototype,
+
+ /**
+ * Plain text label.
+ * @type {string}
+ */
+ get label() {
+ return this.textContent;
+ },
+ set label(label) {
+ this.textContent = label;
+ },
+
+ /**
+ * Whether the item is the lead in a selection. Setting this does not update
+ * the underlying selection model. This is only used for display purpose.
+ * @type {boolean}
+ */
+ get lead() {
+ return this.hasAttribute('lead');
+ },
+ set lead(lead) {
+ if (lead) {
+ this.setAttribute('lead', '');
+ this.scrollIntoViewIfNeeded(false);
+ } else {
+ this.removeAttribute('lead');
+ }
+ },
+
+ /**
+ * Called when an element is decorated as a list item.
+ */
+ decorate: function() {
+ }
+ };
+
+ cr.defineProperty(ListItem, 'selected', cr.PropertyKind.BOOL_ATTR);
+
+ return {
+ ListItem: ListItem
+ };
+});
« no previous file with comments | « resources/bookmark_manager/js/cr/ui/list.js ('k') | resources/bookmark_manager/js/cr/ui/listselectionmodel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698