Commit 2804c875 authored by Dave Schuyler's avatar Dave Schuyler Committed by Commit Bot

[MD extensions] use .hidden rather than has/set/remove Attribute

This CL is a followup for a comment in CL 792537. There's no user facing
effect of this change. This changes the calls used to hide/unhide an the
dev tools in the toolbar.

Bug: None
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I7da1f779b48f942bfb708a4c574c0881269ca3ec
Reviewed-on: https://chromium-review.googlesource.com/798013Reviewed-by: default avatarDan Beam (no longer on Chrome) <dbeam@chromium.org>
Commit-Queue: Dave Schuyler <dschuyler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520823}
parent 826651af
......@@ -65,8 +65,8 @@ cr.define('extensions', function() {
/** @private */
onDevModeToggleChange_: function() {
const drawer = this.$.devDrawer;
if (drawer.hasAttribute('hidden')) {
drawer.removeAttribute('hidden');
if (drawer.hidden) {
drawer.hidden = false;
// Requesting the offsetTop will cause a reflow (to account for hidden).
/** @suppress {suspiciousCode} */ drawer.offsetTop;
}
......@@ -77,11 +77,7 @@ cr.define('extensions', function() {
onInDevModeChanged_: function() {
// Set the initial state.
this.expanded_ = this.inDevMode;
if (this.inDevMode) {
this.$.devDrawer.removeAttribute('hidden');
} else {
this.$.devDrawer.setAttribute('hidden', '');
}
this.$.devDrawer.hidden = !this.inDevMode;
},
/** @private */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment