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

Unified Diff: Source/devtools/front_end/ui/DataGrid.js

Issue 466703002: DevTools: get rid of Element.prototype.removeMatchingStyleClasses (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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
Index: Source/devtools/front_end/ui/DataGrid.js
diff --git a/Source/devtools/front_end/ui/DataGrid.js b/Source/devtools/front_end/ui/DataGrid.js
index 6c1a8e935e7e3afef903a5b52915bc0ecb98013a..460d00eca493ea57cdceef5f3145cc750238c65f 100644
--- a/Source/devtools/front_end/ui/DataGrid.js
+++ b/Source/devtools/front_end/ui/DataGrid.js
@@ -116,7 +116,7 @@ WebInspector.DataGrid = function(columnsArray, editCallback, deleteCallback, ref
cell.appendChild(div);
if (column.sort) {
- cell.classList.add("sort-" + column.sort);
+ cell.classList.add(column.sort);
this._sortColumnCell = cell;
}
@@ -169,8 +169,8 @@ WebInspector.DataGrid.Events = {
/** @enum {string} */
WebInspector.DataGrid.Order = {
- Ascending: "ascending",
- Descending: "descending"
+ Ascending: "sort-ascending",
+ Descending: "sort-descending"
}
/** @enum {string} */
@@ -430,9 +430,9 @@ WebInspector.DataGrid.prototype = {
*/
sortOrder: function()
{
- if (!this._sortColumnCell || this._sortColumnCell.classList.contains("sort-ascending"))
+ if (!this._sortColumnCell || this._sortColumnCell.classList.contains(WebInspector.DataGrid.Order.Ascending))
return WebInspector.DataGrid.Order.Ascending;
- if (this._sortColumnCell.classList.contains("sort-descending"))
+ if (this._sortColumnCell.classList.contains(WebInspector.DataGrid.Order.Descending))
return WebInspector.DataGrid.Order.Descending;
return null;
},
@@ -442,7 +442,7 @@ WebInspector.DataGrid.prototype = {
*/
isSortOrderAscending: function()
{
- return !this._sortColumnCell || this._sortColumnCell.classList.contains("sort-ascending");
+ return !this._sortColumnCell || this._sortColumnCell.classList.contains(WebInspector.DataGrid.Order.Ascending);
},
get headerTableBody()
@@ -875,10 +875,10 @@ WebInspector.DataGrid.prototype = {
sortOrder = WebInspector.DataGrid.Order.Descending;
if (this._sortColumnCell)
- this._sortColumnCell.removeMatchingStyleClasses("sort-\\w+");
+ this._sortColumnCell.classList.remove(WebInspector.DataGrid.Order.Ascending, WebInspector.DataGrid.Order.Descending);
this._sortColumnCell = cell;
- cell.classList.add("sort-" + sortOrder);
+ cell.classList.add(sortOrder);
this.dispatchEventToListeners(WebInspector.DataGrid.Events.SortingChanged);
},
@@ -890,9 +890,9 @@ WebInspector.DataGrid.prototype = {
markColumnAsSortedBy: function(columnIdentifier, sortOrder)
{
if (this._sortColumnCell)
- this._sortColumnCell.removeMatchingStyleClasses("sort-\\w+");
+ this._sortColumnCell.classList.remove(WebInspector.DataGrid.Order.Ascending, WebInspector.DataGrid.Order.Descending);
this._sortColumnCell = this._headerTableHeaders[columnIdentifier];
- this._sortColumnCell.classList.add("sort-" + sortOrder);
+ this._sortColumnCell.classList.add(sortOrder);
},
/**
« Source/devtools/front_end/networkLogView.css ('K') | « Source/devtools/front_end/ui/DOMExtension.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698