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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui_lazy/DataGrid.js

Issue 2567873002: DevTools: Add ability to add and edit cookies (Closed)
Patch Set: Add front-end validation. Add `startEditingNextEditableColumnOfDataGridNode` method to DataGrid. Fi… Created 4 years 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
Index: third_party/WebKit/Source/devtools/front_end/ui_lazy/DataGrid.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/DataGrid.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/DataGrid.js
index 3e67015dfd2cbf793fc79ecf32dc0d3b07b85b48..ef3c1ca6625caea90726549558ee3c1eeba87d48 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/DataGrid.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/DataGrid.js
@@ -310,6 +310,18 @@ UI.DataGrid = class extends Common.Object {
}
/**
+ * @param {!UI.DataGridNode} node
+ * @param {string} columnIdentifier
+ */
+ startEditingNextEditableColumnOfDataGridNode(node, columnIdentifier) {
kdzwinel 2016/12/11 22:07:07 probably the longest method name I ever came up wi
+ const column = this._columns[columnIdentifier];
+ const cellIndex = this._visibleColumnsArray.indexOf(column);
+ const nextEditableColumn = this._nextEditableColumn(cellIndex);
+ if (nextEditableColumn !== -1)
+ this._startEditingColumnOfDataGridNode(node, nextEditableColumn);
+ }
+
+ /**
* @param {!Node} target
*/
_startEditing(target) {
@@ -367,7 +379,7 @@ UI.DataGrid = class extends Common.Object {
}
var column = this._columns[columnId];
var cellIndex = this._visibleColumnsArray.indexOf(column);
- var textBeforeEditing = /** @type {string} */ (this._editingNode.data[columnId]);
+ var textBeforeEditing = /** @type {string} */ (this._editingNode.data[columnId] || '');
kdzwinel 2016/12/11 22:07:07 This prevents new "creation row" from being create
var currentEditingNode = this._editingNode;
/**
@@ -1216,6 +1228,8 @@ UI.DataGridNode = class extends Common.Object {
this._expanded = false;
/** @type {boolean} */
this._selected = false;
+ /** @type {boolean} */
+ this._unsaved = false;
/** @type {number|undefined} */
this._depth;
/** @type {boolean|undefined} */
@@ -1276,6 +1290,8 @@ UI.DataGridNode = class extends Common.Object {
this._element.classList.add('selected');
if (this.revealed)
this._element.classList.add('revealed');
+ if (this.unsaved)
+ this._element.classList.add('unsaved');
}
/**
@@ -1344,6 +1360,26 @@ UI.DataGridNode = class extends Common.Object {
/**
* @return {boolean}
*/
+ get unsaved() {
+ return this._unsaved;
+ }
+
+ /**
+ * @param {boolean} x
+ */
+ set unsaved(x) {
+ this._unsaved = x;
+ if (!this._element)
+ return;
+ if (x)
+ this._element.classList.add('unsaved');
+ else
+ this._element.classList.remove('unsaved');
+ }
+
+ /**
+ * @return {boolean}
+ */
hasChildren() {
return this._hasChildren;
}

Powered by Google App Engine
This is Rietveld 408576698