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

Unified Diff: ui/file_manager/gallery/js/gallery.js

Issue 2626973004: Fix the tooltip for thumbnail view option in gallery on tabbing (Closed)
Patch Set: Created 3 years, 11 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 | « ui/file_manager/gallery/gallery.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/gallery/js/gallery.js
diff --git a/ui/file_manager/gallery/js/gallery.js b/ui/file_manager/gallery/js/gallery.js
index 1bbde3214667fb4923938b0c8da90762a0dce4e4..b866cbab962a8b3ce527d56f5e4d45ea9a8b729f 100644
--- a/ui/file_manager/gallery/js/gallery.js
+++ b/ui/file_manager/gallery/js/gallery.js
@@ -537,6 +537,21 @@ Gallery.prototype.onChangeToSlideMode_ = function() {
this.changeCurrentMode_(this.slideMode_);
};
+
+/**
+ * Update attributes of slide/thumbnail toggle button
+ * @param {Event=} event Event that caused this call
+ * @private
+*/
oka 2017/01/12 01:59:24 Add a space before *.
takise 2017/01/12 04:08:05 Done.
+
oka 2017/01/12 01:59:24 Remove this empty line.
takise 2017/01/12 04:08:05 Done.
+Gallery.prototype.updateModeButtonAttribute_ = function(event) {
+ var button = event.currentTarget;
oka 2017/01/12 01:59:24 Are you sure that event is not undefined? If event
takise 2017/01/12 04:08:05 Done.
+ if (this.currentMode_ === this.slideMode_)
+ button.setAttribute("aria-label", str("GALLERY_SLIDE"));
+ else
+ button.setAttribute("aria-label", str("GALLERY_THUMBNAIL"));
+}
+
/**
* Change current mode.
* @param {!(SlideMode|ThumbnailMode)} mode Target mode.
@@ -566,6 +581,8 @@ Gallery.prototype.changeCurrentMode_ = function(mode, opt_event) {
var thumbnailRect = ImageRect.createFromBounds(
this.thumbnailMode_.getThumbnailRect(thumbnailIndex));
+ this.updateModeButtonAttribute_(opt_event);
oka 2017/01/12 01:59:24 I think this line should be moved to setCurrentMod
takise 2017/01/12 04:08:05 Done.
+
if (mode === this.thumbnailMode_) {
this.setCurrentMode_(this.thumbnailMode_);
this.slideMode_.leave(
« no previous file with comments | « ui/file_manager/gallery/gallery.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698