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

Side by Side Diff: Source/devtools/front_end/resources/DatabaseQueryView.js

Issue 411263003: DevTools: Extract SortableDataGrid. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 return; 136 return;
137 137
138 this._prompt.pushHistoryItem(query); 138 this._prompt.pushHistoryItem(query);
139 this._prompt.text = ""; 139 this._prompt.text = "";
140 140
141 this.database.executeSql(query, this._queryFinished.bind(this, query), t his._queryError.bind(this, query)); 141 this.database.executeSql(query, this._queryFinished.bind(this, query), t his._queryError.bind(this, query));
142 }, 142 },
143 143
144 _queryFinished: function(query, columnNames, values) 144 _queryFinished: function(query, columnNames, values)
145 { 145 {
146 var dataGrid = WebInspector.DataGrid.createSortableDataGrid(columnNames, values); 146 var dataGrid = WebInspector.SortableDataGrid.create(columnNames, values) ;
147 var trimmedQuery = query.trim(); 147 var trimmedQuery = query.trim();
148 148
149 if (dataGrid) { 149 if (dataGrid) {
150 dataGrid.renderInline(); 150 dataGrid.renderInline();
151 this._appendViewQueryResult(trimmedQuery, dataGrid); 151 this._appendViewQueryResult(trimmedQuery, dataGrid);
152 dataGrid.autoSizeColumns(5); 152 dataGrid.autoSizeColumns(5);
153 } 153 }
154 154
155 if (trimmedQuery.match(/^create /i) || trimmedQuery.match(/^drop table / i)) 155 if (trimmedQuery.match(/^create /i) || trimmedQuery.match(/^drop table / i))
156 this.dispatchEventToListeners(WebInspector.DatabaseQueryView.Events. SchemaUpdated, this.database); 156 this.dispatchEventToListeners(WebInspector.DatabaseQueryView.Events. SchemaUpdated, this.database);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 element.appendChild(commandTextElement); 198 element.appendChild(commandTextElement);
199 199
200 var resultElement = document.createElement("div"); 200 var resultElement = document.createElement("div");
201 resultElement.className = "database-query-result"; 201 resultElement.className = "database-query-result";
202 element.appendChild(resultElement); 202 element.appendChild(resultElement);
203 return resultElement; 203 return resultElement;
204 }, 204 },
205 205
206 __proto__: WebInspector.VBox.prototype 206 __proto__: WebInspector.VBox.prototype
207 } 207 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/network/NetworkPanel.js ('k') | Source/devtools/front_end/resources/DatabaseTableView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698