Commit fa03e474 authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

[quickview] Use toggleAttribute for toolbar metadata info-button

Using setAttribute and removeAttribute is an anti-pattern in areas our
code: toggleAttribute can be used to achieve the exact same result.

Add a TODO about this.$.innerContentPanel.focus() not working. Comment
is most likely out-of-date, we'll see.

Bug: 992824
Change-Id: I58ab7ae8418273cde9eb41c78b9a9babfdd9658b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2120775Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
Reviewed-by: default avatarAlex Danilo <adanilo@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753505}
parent 11988951
......@@ -182,6 +182,9 @@ const FilesQuickView = Polymer({
},
/**
* TODO(992824): investigate the this.$.innerContentPanel.focus() since the
* has no tabindex it seems, and so the focus() call is ignored.
*
* @param {!Event} event tap event.
*
* @private
......@@ -193,11 +196,7 @@ const FilesQuickView = Polymer({
if (this.hasAttribute('files-ng')) {
this.metadataBoxActive = !this.metadataBoxActive;
if (this.metadataBoxActive) {
event.target.setAttribute('toogle', '');
} else {
event.target.removeAttribute('toogle');
}
event.target.toggleAttribute('toogle', this.metadataBoxActive);
}
},
......
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