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

Unified Diff: chrome/browser/resources/policy.js

Issue 17341004: Don't rely on the second argument to DOMTokenList.toggle in about:policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/policy.js
diff --git a/chrome/browser/resources/policy.js b/chrome/browser/resources/policy.js
index a044bc92efd8a1f9e5a0eb6f8032e7b40a345ebe..6aa4eee02b77e63d455a54c29ccb84638e1f5893 100644
--- a/chrome/browser/resources/policy.js
+++ b/chrome/browser/resources/policy.js
@@ -162,9 +162,10 @@ cr.define('policy', function() {
// Determine whether the contents of the value column overflows. The
// visibility of the contents, replacement link and additional row
// containing the complete value that depend on this are handled by CSS.
- this.classList.toggle(
- 'has-overflowed-value',
- valueContainer.offsetWidth < valueContainer.valueWidth);
+ if (valueContainer.offsetWidth < valueContainer.valueWidth)
+ this.classList.add('has-overflowed-value');
+ else
+ this.classList.remove('has-overflowed-value');
},
/**
@@ -279,8 +280,10 @@ cr.define('policy', function() {
policy.unset && !showUnset ||
policy.name.toLowerCase().indexOf(this.filterPattern_) == -1;
}
- this.parentElement.classList.toggle(
- 'empty', !this.querySelector('tbody:not([hidden])'));
+ if (this.querySelector('tbody:not([hidden])'))
+ this.parentElement.classList.remove('empty');
+ else
+ this.parentElement.classList.add('empty');
setTimeout(this.checkOverflow_.bind(this), 0);
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698