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

Unified Diff: chrome/browser/resources/file_manager/js/ui/preview_panel.js

Issue 23662004: Reland r221579: Files.app: Let the PreviewPanel class control the visibility of the preview panel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix the test. Created 7 years, 3 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
Index: chrome/browser/resources/file_manager/js/ui/preview_panel.js
diff --git a/chrome/browser/resources/file_manager/js/ui/preview_panel.js b/chrome/browser/resources/file_manager/js/ui/preview_panel.js
index c770ac7a4a5fd7765e46f177a3b778f91854fe95..467fc9e2d956d6acc720b3a74449dcd572cf2783 100644
--- a/chrome/browser/resources/file_manager/js/ui/preview_panel.js
+++ b/chrome/browser/resources/file_manager/js/ui/preview_panel.js
@@ -92,11 +92,11 @@ PreviewPanel.Event = Object.freeze({
*/
PreviewPanel.VisibilityType = Object.freeze({
// Preview panel always shows.
- ALWAYS: 'always',
+ ALWAYS_VISIBLE: 'alwaysVisible',
// Preview panel shows when the entries property are set.
AUTO: 'auto',
// Preview panel does not show.
- HIDDEN: 'hidden'
+ ALWAYS_HIDDEN: 'alwaysHidden'
});
/**
@@ -144,6 +144,10 @@ PreviewPanel.prototype = {
PreviewPanel.Visibility_.VISIBLE;
},
+ /**
+ * Obtains the height of preview panel.
+ * @return {number} Height of preview panel.
+ */
get height() {
this.height_ = this.height_ || this.element_.clientHeight;
return this.height_;
@@ -168,14 +172,14 @@ PreviewPanel.prototype.updateVisibility_ = function() {
var visibility = this.element_.getAttribute('visibility');
var newVisible = null;
switch (this.visibilityType_) {
- case PreviewPanel.VisibilityType.ALWAYS:
+ case PreviewPanel.VisibilityType.ALWAYS_VISIBLE:
newVisible = true;
break;
case PreviewPanel.VisibilityType.AUTO:
newVisible = this.entries_.length != 0 ||
!PathUtil.isRootPath(this.currentPath_);
break;
- case PreviewPanel.VisibilityType.HIDDEN:
+ case PreviewPanel.VisibilityType.ALWAYS_HIDDEN:
newVisible = false;
break;
default:
« no previous file with comments | « chrome/browser/resources/file_manager/js/main_scripts.js ('k') | chrome/browser/resources/file_manager/main.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698