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() { ...@@ -626,8 +626,7 @@ cr.define('options', function() {
decorate: function() { decorate: function() {
DeletableItemList.prototype.decorate.call(this); DeletableItemList.prototype.decorate.call(this);
this.classList.add('cookie-list'); this.classList.add('cookie-list');
this.data_ = []; this.dataModel = new ArrayDataModel([]);
this.dataModel = new ArrayDataModel(this.data_);
this.addEventListener('keydown', this.handleKeyLeftRight_.bind(this)); this.addEventListener('keydown', this.handleKeyLeftRight_.bind(this));
var sm = new ListSingleSelectionModel(); var sm = new ListSingleSelectionModel();
sm.addEventListener('change', this.cookieSelectionChange_.bind(this)); sm.addEventListener('change', this.cookieSelectionChange_.bind(this));
...@@ -751,7 +750,7 @@ cr.define('options', function() { ...@@ -751,7 +750,7 @@ cr.define('options', function() {
// from options.DeletableItemList // from options.DeletableItemList
/** @inheritDoc */ /** @inheritDoc */
deleteItemAtIndex: function(index) { deleteItemAtIndex: function(index) {
var item = this.data_[index]; var item = this.dataModel.item(index);
if (item) { if (item) {
var pathId = item.pathId; var pathId = item.pathId;
if (pathId) if (pathId)
...@@ -775,7 +774,7 @@ cr.define('options', function() { ...@@ -775,7 +774,7 @@ cr.define('options', function() {
* @param {number} index The index of the tree node to remove. * @param {number} index The index of the tree node to remove.
*/ */
remove: function(index) { remove: function(index) {
if (index < this.data_.length) if (index < this.dataModel.length)
this.dataModel.splice(index, 1); this.dataModel.splice(index, 1);
}, },
...@@ -786,8 +785,7 @@ cr.define('options', function() { ...@@ -786,8 +785,7 @@ cr.define('options', function() {
*/ */
clear: function() { clear: function() {
parentLookup = {}; parentLookup = {};
this.data_ = []; this.dataModel.splice(0, this.dataModel.length);
this.dataModel = new ArrayDataModel(this.data_);
this.redraw(); 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