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

Unified Diff: chrome/browser/resources/options2/cookies_list.js

Issue 10096002: Fix cookies list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options2/cookies_list.js
diff --git a/chrome/browser/resources/options2/cookies_list.js b/chrome/browser/resources/options2/cookies_list.js
index e887ca04bacda65936d6c6916179fc50819ec4d7..fa9c16ed6356d6fea5e1dd2feed72fdefc96a7cc 100644
--- a/chrome/browser/resources/options2/cookies_list.js
+++ b/chrome/browser/resources/options2/cookies_list.js
@@ -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();
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698