Commit 3d13ed73 authored by serya@google.com's avatar serya@google.com

Fix cookies list.

BUG=123403
TEST=Manual test.

Review URL: https://chromiumcodereview.appspot.com/10096002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132375 0039d316-1c4b-4281-b951-d872f2087c98
parent d8a58a0e
......@@ -626,8 +626,7 @@ cr.define('options', function() {
decorate: function() {
DeletableItemList.prototype.decorate.call(this);
this.classList.add('cookie-list');
this.data_ = [];
this.dataModel = new ArrayDataModel(this.data_);
this.dataModel = new ArrayDataModel([]);
this.addEventListener('keydown', this.handleKeyLeftRight_.bind(this));
var sm = new ListSingleSelectionModel();
sm.addEventListener('change', this.cookieSelectionChange_.bind(this));
......@@ -751,7 +750,7 @@ cr.define('options', function() {
// from options.DeletableItemList
/** @inheritDoc */
deleteItemAtIndex: function(index) {
var item = this.data_[index];
var item = this.dataModel.item(index);
if (item) {
var pathId = item.pathId;
if (pathId)
......@@ -775,7 +774,7 @@ cr.define('options', function() {
* @param {number} index The index of the tree node to remove.
*/
remove: function(index) {
if (index < this.data_.length)
if (index < this.dataModel.length)
this.dataModel.splice(index, 1);
},
......@@ -786,8 +785,7 @@ cr.define('options', function() {
*/
clear: function() {
parentLookup = {};
this.data_ = [];
this.dataModel = new ArrayDataModel(this.data_);
this.dataModel.splice(0, this.dataModel.length);
this.redraw();
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment