| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Nokia Inc. All rights reserved. | 2 * Copyright (C) 2008 Nokia Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 }, | 219 }, |
| 220 | 220 |
| 221 _refreshButtonClicked: function(event) | 221 _refreshButtonClicked: function(event) |
| 222 { | 222 { |
| 223 this._update(); | 223 this._update(); |
| 224 }, | 224 }, |
| 225 | 225 |
| 226 _editingCallback: function(editingNode, columnIdentifier, oldText, newText) | 226 _editingCallback: function(editingNode, columnIdentifier, oldText, newText) |
| 227 { | 227 { |
| 228 var domStorage = this.domStorage; | 228 var domStorage = this.domStorage; |
| 229 if ("key" === columnIdentifier) { | 229 if (columnIdentifier === "key") { |
| 230 if (typeof oldText === "string") | 230 if (typeof oldText === "string") |
| 231 domStorage.removeItem(oldText); | 231 domStorage.removeItem(oldText); |
| 232 domStorage.setItem(newText, editingNode.data.value || ''); | 232 domStorage.setItem(newText, editingNode.data.value || ""); |
| 233 this._removeDupes(editingNode); | 233 this._removeDupes(editingNode); |
| 234 } else | 234 } else |
| 235 domStorage.setItem(editingNode.data.key || '', newText); | 235 domStorage.setItem(editingNode.data.key || "", newText); |
| 236 }, | 236 }, |
| 237 | 237 |
| 238 /** | 238 /** |
| 239 * @param {!WebInspector.DataGridNode} masterNode | 239 * @param {!WebInspector.DataGridNode} masterNode |
| 240 */ | 240 */ |
| 241 _removeDupes: function(masterNode) | 241 _removeDupes: function(masterNode) |
| 242 { | 242 { |
| 243 var rootNode = this._dataGrid.rootNode(); | 243 var rootNode = this._dataGrid.rootNode(); |
| 244 var children = rootNode.children; | 244 var children = rootNode.children; |
| 245 for (var i = children.length - 1; i >= 0; --i) { | 245 for (var i = children.length - 1; i >= 0; --i) { |
| 246 var childNode = children[i]; | 246 var childNode = children[i]; |
| 247 if ((childNode.data.key === masterNode.data.key) && (masterNode !==
childNode)) | 247 if ((childNode.data.key === masterNode.data.key) && (masterNode !==
childNode)) |
| 248 rootNode.removeChild(childNode); | 248 rootNode.removeChild(childNode); |
| 249 } | 249 } |
| 250 }, | 250 }, |
| 251 | 251 |
| 252 _deleteCallback: function(node) | 252 _deleteCallback: function(node) |
| 253 { | 253 { |
| 254 if (!node || node.isCreationNode) | 254 if (!node || node.isCreationNode) |
| 255 return; | 255 return; |
| 256 | 256 |
| 257 if (this.domStorage) | 257 if (this.domStorage) |
| 258 this.domStorage.removeItem(node.data.key); | 258 this.domStorage.removeItem(node.data.key); |
| 259 }, | 259 }, |
| 260 | 260 |
| 261 __proto__: WebInspector.VBox.prototype | 261 __proto__: WebInspector.VBox.prototype |
| 262 } | 262 } |
| OLD | NEW |