Chromium Code Reviews| Index: chrome/browser/resources/options/content_settings_exceptions_area.js |
| diff --git a/chrome/browser/resources/options/content_settings_exceptions_area.js b/chrome/browser/resources/options/content_settings_exceptions_area.js |
| index da67d0131addabede11bb365230f1659978ec921..3f64ba4a423744d7b01fbac41ff869761ba61bd9 100644 |
| --- a/chrome/browser/resources/options/content_settings_exceptions_area.js |
| +++ b/chrome/browser/resources/options/content_settings_exceptions_area.js |
| @@ -459,15 +459,23 @@ cr.define('options.contentSettings', function() { |
| /** |
| * Adds an exception to the js model. |
| - * @param {Object} entry A dictionary of values for the exception. |
| + * @param {Object} entries A list of dictionaries of values, each dictionary |
| + * represents an exception. |
| */ |
| - addException: function(entry) { |
| + addExceptions: function(entries) { |
| + var insertIndex = this.dataModel.length; |
| + |
| if (this.isEditable()) { |
| // We have to add it before the Add New Exception row. |
| - this.dataModel.splice(this.dataModel.length - 1, 0, entry); |
| - } else { |
| - this.dataModel.push(entry); |
| + insertIndex = insertIndex - 1; |
| } |
| + |
| + var args = [insertIndex, 0]; |
|
arv (Not doing code reviews)
2011/01/12 00:42:32
more JS magic...
args.push.apply(args, entries);
|
| + for (var i = 0; i < entries.length; i++) { |
| + args.push(entries[i]); |
| + } |
| + |
| + this.dataModel.splice.apply(this.dataModel, args); |
| }, |
| /** |