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

Unified Diff: chrome/browser/resources/shared/js/cr/ui/table/table_column.js

Issue 11962043: Move webui resources from chrome\browser\resources\shared to ui\webui\resources. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 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/shared/js/cr/ui/table/table_column.js
===================================================================
--- chrome/browser/resources/shared/js/cr/ui/table/table_column.js (revision 177292)
+++ chrome/browser/resources/shared/js/cr/ui/table/table_column.js (working copy)
@@ -1,120 +0,0 @@
-// 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.
-
-/**
- * @fileoverview This is a table column representation
- */
-
-cr.define('cr.ui.table', function() {
- /** @const */ var EventTarget = cr.EventTarget;
- /** @const */ var Event = cr.Event;
-
- /**
- * A table column that wraps column ids and settings.
- * @param {!Array} columnIds Array of column ids.
- * @constructor
- * @extends {EventTarget}
- */
- function TableColumn(id, name, width, endAlign) {
- this.id_ = id;
- this.name_ = name;
- this.width_ = width;
- this.endAlign_ = endAlign;
- }
-
- TableColumn.prototype = {
- __proto__: EventTarget.prototype,
-
- id_: null,
-
- name_: null,
-
- width_: null,
-
- endAlign_: false,
-
- defaultOrder_: 'asc',
-
- /**
- * Clones column.
- * @return {cr.ui.table.TableColumn} Clone of the given column.
- */
- clone: function() {
- var tableColumn = new TableColumn(this.id_, this.name_, this.width_,
- this.endAlign_);
- tableColumn.renderFunction = this.renderFunction_;
- tableColumn.headerRenderFunction = this.headerRenderFunction_;
- tableColumn.defaultOrder = this.defaultOrder_;
- return tableColumn;
- },
-
- /**
- * Renders table cell. This is the default render function.
- * @param {*} dataItem The data item to be rendered.
- * @param {string} columnId The column id.
- * @param {cr.ui.Table} table The table.
- * @return {HTMLElement} Rendered element.
- */
- renderFunction_: function(dataItem, columnId, table) {
- var div = table.ownerDocument.createElement('div');
- div.textContent = dataItem[columnId];
- return div;
- },
-
- /**
- * Renders table header. This is the default render function.
- * @param {cr.ui.Table} table The table.
- * @return {HTMLElement} Rendered element.
- */
- headerRenderFunction_: function(table) {
- return table.ownerDocument.createTextNode(this.name);
- },
- };
-
- /**
- * The column id.
- * @type {string}
- */
- cr.defineProperty(TableColumn, 'id');
-
- /**
- * The column name
- * @type {string}
- */
- cr.defineProperty(TableColumn, 'name');
-
- /**
- * The column width.
- * @type {number}
- */
- cr.defineProperty(TableColumn, 'width');
-
- /**
- * True if the column is aligned to end.
- * @type {boolean}
- */
- cr.defineProperty(TableColumn, 'endAlign');
-
- /**
- * The column render function.
- * @type {Function(*, string, cr.ui.Table): HTMLElement}
- */
- cr.defineProperty(TableColumn, 'renderFunction');
-
- /**
- * The column header render function.
- * @type {Function(cr.ui.Table): HTMLElement}
- */
- cr.defineProperty(TableColumn, 'headerRenderFunction');
-
- /**
- * Default sorting order for the column ('asc' or 'desc').
- * @type {string}
- */
- cr.defineProperty(TableColumn, 'defaultOrder');
-
- return {
- TableColumn: TableColumn
- };
-});

Powered by Google App Engine
This is Rietveld 408576698