Commit 0c13a0b6 authored by takise's avatar takise Committed by Commit bot

Fix the tooltip for thumbnail view option in gallery on tabbing

Previously, when tab button was clicked up to thumbnail view option in
gallery, the tooltip for the option did not work. This is also true of
slide view option in thumbnail mode. Both issues are resolved with this
patch.

BUG=549547
TEST=manually tested in the issue
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2626973004
Cr-Commit-Position: refs/heads/master@{#443156}
parent 30b50697
......@@ -125,12 +125,12 @@
</button>
<!-- Use button element for mode button to implement toggle switch
-- button. -->
<button class="mode icon-button" disabled>
<div class="icon slide-mode" i18n-values="aria-label:GALLERY_SLIDE"
has-tooltip></div>
<div class="icon thumbnail-mode"
i18n-values="aria-label:GALLERY_THUMBNAIL"
has-tooltip></div>
<button class="mode icon-button"
i18n-values="aria-label:GALLERY_THUMBNAIL"
has-tooltip
disabled>
<div class="icon slide-mode"></div>
<div class="icon thumbnail-mode"></div>
<files-ripple></files-ripple>
</button>
<button class="slideshow icon-button"
......
......@@ -506,6 +506,7 @@ Gallery.prototype.setCurrentMode_ = function(mode) {
this.container_.setAttribute('mode', this.currentMode_.getName());
this.updateSelectionAndState_();
this.updateModeButtonAttribute_();
};
/**
......@@ -537,6 +538,17 @@ Gallery.prototype.onChangeToSlideMode_ = function() {
this.changeCurrentMode_(this.slideMode_);
};
/**
* Update attributes of slide/thumbnail toggle button
* @private
*/
Gallery.prototype.updateModeButtonAttribute_ = function() {
if (this.currentMode_ === this.slideMode_)
this.modeSwitchButton_.setAttribute("aria-label", str("GALLERY_THUMBNAIL"));
else
this.modeSwitchButton_.setAttribute("aria-label", str("GALLERY_SLIDE"));
};
/**
* Change current mode.
* @param {!(SlideMode|ThumbnailMode)} mode Target mode.
......
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